Mercurial > hg4j
comparison cmdline/org/tmatesoft/hg/console/Main.java @ 511:122e0600799f
Respect multiple joins/forks in a history of a single file
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 14 Dec 2012 15:39:49 +0100 |
parents | ca5202afea90 |
children | 5dcb4581c8ef |
comparison
equal
deleted
inserted
replaced
510:90093ee56c0d | 511:122e0600799f |
---|---|
170 } | 170 } |
171 | 171 |
172 private void buildFileLog() throws Exception { | 172 private void buildFileLog() throws Exception { |
173 final long start = System.nanoTime(); | 173 final long start = System.nanoTime(); |
174 HgLogCommand cmd = new HgLogCommand(hgRepo); | 174 HgLogCommand cmd = new HgLogCommand(hgRepo); |
175 cmd.file("cmdline/org/tmatesoft/hg/console/Remote.java", true); | 175 cmd.file("file1b.txt", true); |
176 final int[] count = new int[] { 0 }; | |
176 cmd.execute(new HgChangesetTreeHandler() { | 177 cmd.execute(new HgChangesetTreeHandler() { |
177 public void treeElement(HgChangesetTreeHandler.TreeElement entry) { | 178 public void treeElement(HgChangesetTreeHandler.TreeElement entry) { |
178 StringBuilder sb = new StringBuilder(); | 179 StringBuilder sb = new StringBuilder(); |
179 HashSet<Nodeid> test = new HashSet<Nodeid>(entry.childRevisions()); | 180 HashSet<Nodeid> test = new HashSet<Nodeid>(entry.childRevisions()); |
180 for (HgChangeset cc : entry.children()) { | 181 for (HgChangeset cc : entry.children()) { |
206 System.out.printf("fork => [%s]", sb); | 207 System.out.printf("fork => [%s]", sb); |
207 } | 208 } |
208 if (isJoin || isFork) { | 209 if (isJoin || isFork) { |
209 System.out.println(); | 210 System.out.println(); |
210 } | 211 } |
212 count[0]++; | |
211 } | 213 } |
212 }); | 214 }); |
215 System.out.println(count[0]); | |
213 final long end = System.nanoTime(); | 216 final long end = System.nanoTime(); |
214 System.out.printf("buildFileLog: %,d ms\n", (end-start)/1000); | 217 System.out.printf("buildFileLog: %,d ms\n", (end-start)/1000); |
215 } | 218 } |
216 | 219 |
217 private void buildFileLogOld() throws Exception { | 220 private void buildFileLogOld() throws Exception { |