diff cmdline/org/tmatesoft/hg/console/Main.java @ 464:1a3c18d57a8e smartgit3

MqManager evolution: same PatchRecord instances, list patch queues, detect active queue
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 21 Jun 2012 20:27:58 +0200
parents a0507a9f3da0
children 7bcfbc255f48
line wrap: on
line diff
--- a/cmdline/org/tmatesoft/hg/console/Main.java	Wed Jun 20 21:16:21 2012 +0200
+++ b/cmdline/org/tmatesoft/hg/console/Main.java	Thu Jun 21 20:27:58 2012 +0200
@@ -139,6 +139,13 @@
 		for (PatchRecord pr : mqManager.getAppliedPatches()) {
 			System.out.printf("#%-3d %s, known as cset:%s\n", i++, pr.getName(), pr.getRevision().shortNotation());
 		}
+		boolean allAppliedAreKnown = mqManager.getAllKnownPatches().containsAll(mqManager.getAppliedPatches());
+		System.out.printf("[sanity] allAppliedAreKnown:%b, not yet applied:%d\n", allAppliedAreKnown, mqManager.getQueueSize());
+		Assert.assertTrue(allAppliedAreKnown);
+
+		System.out.printf("Queues: %s, active:%s\n", mqManager.getQueueNames(), mqManager.getActiveQueueName());
+		Assert.assertTrue(mqManager.getQueueNames().size() > 1);
+		Assert.assertTrue(mqManager.getActiveQueueName().length() > 0);
 	}