Mercurial > hg4j
diff cmdline/org/tmatesoft/hg/console/Main.java @ 450:03fd8d079e9c smartgit3
Share PhasesHelper instance among few HgChangesets (mostly affects HgChangesetTreeHandler case)
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 07 Jun 2012 17:06:23 +0200 |
parents | 5787e912f60e |
children | a0507a9f3da0 |
line wrap: on
line diff
--- a/cmdline/org/tmatesoft/hg/console/Main.java Thu Jun 07 16:01:09 2012 +0200 +++ b/cmdline/org/tmatesoft/hg/console/Main.java Thu Jun 07 17:06:23 2012 +0200 @@ -96,11 +96,11 @@ public static void main(String[] args) throws Exception { Main m = new Main(args); - m.testRevisionDescendants(); - for (int i : new int[] {1,2,3}) { - m.dumpPhases(); +// m.testRevisionDescendants(); + for (int i : new int[] {1,2,3,4,5}) { +// m.dumpPhases(); + m.buildFileLog(); } -// m.buildFileLog(); // m.testConsoleLog(); // m.testTreeTraversal(); // m.testRevisionMap(); @@ -173,6 +173,7 @@ } private void buildFileLog() throws Exception { + final long start = System.nanoTime(); HgLogCommand cmd = new HgLogCommand(hgRepo); cmd.file("file1", false); cmd.execute(new HgChangesetTreeHandler() { @@ -190,7 +191,7 @@ final boolean isJoin = !parents.first().isNull() && !parents.second().isNull(); final boolean isFork = entry.children().size() > 1; final HgChangeset cset = entry.changeset(); - System.out.printf("%d:%s - %s\n", cset.getRevision(), cset.getNodeid().shortNotation(), cset.getComment()); + System.out.printf("%d:%s - %s (%s)\n", cset.getRevision(), cset.getNodeid().shortNotation(), cset.getComment(), cset.getPhase()); if (!isJoin && !isFork && !entry.children().isEmpty()) { System.out.printf("\t=> %s\n", sb); } @@ -216,6 +217,8 @@ } } }); + final long end = System.nanoTime(); + System.out.printf("buildFileLog: %,d ms\n", (end-start)/1000); } private void buildFileLogOld() throws Exception {