diff cmdline/org/tmatesoft/hg/console/Main.java @ 220:8de327242aa0

Basic information about branches
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 19 May 2011 04:14:45 +0200
parents 3a7696fb457c
children 373e07cd3991
line wrap: on
line diff
--- a/cmdline/org/tmatesoft/hg/console/Main.java	Tue May 17 05:43:09 2011 +0200
+++ b/cmdline/org/tmatesoft/hg/console/Main.java	Thu May 19 04:14:45 2011 +0200
@@ -28,6 +28,7 @@
 import org.tmatesoft.hg.core.Nodeid;
 import org.tmatesoft.hg.internal.ByteArrayChannel;
 import org.tmatesoft.hg.internal.DigestHelper;
+import org.tmatesoft.hg.repo.HgBranches;
 import org.tmatesoft.hg.repo.HgDataFile;
 import org.tmatesoft.hg.repo.HgInternals;
 import org.tmatesoft.hg.repo.HgManifest;
@@ -60,7 +61,8 @@
 
 	public static void main(String[] args) throws Exception {
 		Main m = new Main(args);
-		m.inflaterLengthException();
+		m.dumpBranches();
+//		m.inflaterLengthException();
 //		m.dumpIgnored();
 //		m.dumpDirstate();
 //		m.testStatusInternals();
@@ -70,6 +72,20 @@
 //		m.bunchOfTests();
 	}
 	
+	private void dumpBranches() {
+		HgBranches b = hgRepo.getBranches();
+		for (HgBranches.BranchInfo bi : b.getAllBranches()) {
+			System.out.print(bi.getName());
+			if (bi.isClosed()) {
+				System.out.print("!");
+			}
+			System.out.print(" ");
+			System.out.print(bi.getStart());
+			System.out.print(" ");
+			System.out.println(bi.getHeads());
+		}
+	}
+	
 	private void inflaterLengthException() throws Exception {
 		HgDataFile f1 = hgRepo.getFileNode("src/com/tmate/hgkit/console/Bundle.java");
 		HgDataFile f2 = hgRepo.getFileNode("test-repos.jar");