comparison src/org/tmatesoft/hg/core/HgLogCommand.java @ 517:9922d1f7cb2a

Update test to use new command configuration argument (used to have followAncestry == true by default)
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 18 Dec 2012 19:08:00 +0100
parents 0ae5768081aa
children 0d5e1ea7955e
comparison
equal deleted inserted replaced
516:0ae5768081aa 517:9922d1f7cb2a
351 final ProgressSupport progressHelper = getProgressSupport(handler); 351 final ProgressSupport progressHelper = getProgressSupport(handler);
352 final CancelSupport cancelHelper = getCancelSupport(handler, true); 352 final CancelSupport cancelHelper = getCancelSupport(handler, true);
353 final HgFileRenameHandlerMixin renameHandler = Adaptable.Factory.getAdapter(handler, HgFileRenameHandlerMixin.class, null); 353 final HgFileRenameHandlerMixin renameHandler = Adaptable.Factory.getAdapter(handler, HgFileRenameHandlerMixin.class, null);
354 354
355 355
356 // XXX rename. dispatcher is not a proper name (most of the job done - managing history chunk interconnection)
356 final HandlerDispatcher dispatcher = new HandlerDispatcher() { 357 final HandlerDispatcher dispatcher = new HandlerDispatcher() {
357 358
358 @Override 359 @Override
359 protected void once(HistoryNode n) throws HgCallbackTargetException, CancelledException { 360 protected void once(HistoryNode n) throws HgCallbackTargetException, CancelledException {
360 handler.treeElement(ei.init(n, currentFileNode)); 361 handler.treeElement(ei.init(n, currentFileNode));
363 }; 364 };
364 365
365 // renamed files in the queue are placed with respect to #iterateDirection 366 // renamed files in the queue are placed with respect to #iterateDirection
366 // i.e. if we iterate from new to old, recent filenames come first 367 // i.e. if we iterate from new to old, recent filenames come first
367 List<Pair<HgDataFile, Nodeid>> fileRenamesQueue = buildFileRenamesQueue(); 368 List<Pair<HgDataFile, Nodeid>> fileRenamesQueue = buildFileRenamesQueue();
369 // XXX perhaps, makes sense to look at selected file's revision when followAncestry is true
370 // to ensure file we attempt to trace is in the WC's parent. Native hg aborts if not.
368 progressHelper.start(4 * fileRenamesQueue.size()); 371 progressHelper.start(4 * fileRenamesQueue.size());
369 for (int namesIndex = 0, renamesQueueSize = fileRenamesQueue.size(); namesIndex < renamesQueueSize; namesIndex++) { 372 for (int namesIndex = 0, renamesQueueSize = fileRenamesQueue.size(); namesIndex < renamesQueueSize; namesIndex++) {
370 373
371 final Pair<HgDataFile, Nodeid> renameInfo = fileRenamesQueue.get(namesIndex); 374 final Pair<HgDataFile, Nodeid> renameInfo = fileRenamesQueue.get(namesIndex);
372 dispatcher.prepare(progressHelper, renameInfo); 375 dispatcher.prepare(progressHelper, renameInfo);
823 children.add(child); 826 children.add(child);
824 } 827 }
825 828
826 /** 829 /**
827 * method to merge two history chunks for renamed file so that 830 * method to merge two history chunks for renamed file so that
828 * this node's history continues with that of child 831 * this node's history continues (or forks, if we don't followAncestry)
832 * with that of child
829 * @param child 833 * @param child
830 */ 834 */
831 public void bindChild(HistoryNode child) { 835 public void bindChild(HistoryNode child) {
832 assert child.parent1 == null && child.parent2 == null; 836 assert child.parent1 == null && child.parent2 == null;
833 // for the last element in history empty children are by construction:
834 // we don't iterate further than last element of interest in TreeBuildInspector#go
835 assert children == null || children.isEmpty();
836 child.parent1 = this; 837 child.parent1 = this;
837 addChild(child); 838 addChild(child);
838 } 839 }
839 840
840 public String toString() { 841 public String toString() {