# HG changeset patch # User Artem Tikhomirov # Date 1355854080 -3600 # Node ID 9922d1f7cb2addb337106e13fc0e2eae75f153d2 # Parent 0ae5768081aa227d5cb08981f861b5581a18280c Update test to use new command configuration argument (used to have followAncestry == true by default) diff -r 0ae5768081aa -r 9922d1f7cb2a src/org/tmatesoft/hg/core/HgLogCommand.java --- a/src/org/tmatesoft/hg/core/HgLogCommand.java Tue Dec 18 18:57:03 2012 +0100 +++ b/src/org/tmatesoft/hg/core/HgLogCommand.java Tue Dec 18 19:08:00 2012 +0100 @@ -353,6 +353,7 @@ final HgFileRenameHandlerMixin renameHandler = Adaptable.Factory.getAdapter(handler, HgFileRenameHandlerMixin.class, null); + // XXX rename. dispatcher is not a proper name (most of the job done - managing history chunk interconnection) final HandlerDispatcher dispatcher = new HandlerDispatcher() { @Override @@ -365,6 +366,8 @@ // renamed files in the queue are placed with respect to #iterateDirection // i.e. if we iterate from new to old, recent filenames come first List> fileRenamesQueue = buildFileRenamesQueue(); + // XXX perhaps, makes sense to look at selected file's revision when followAncestry is true + // to ensure file we attempt to trace is in the WC's parent. Native hg aborts if not. progressHelper.start(4 * fileRenamesQueue.size()); for (int namesIndex = 0, renamesQueueSize = fileRenamesQueue.size(); namesIndex < renamesQueueSize; namesIndex++) { @@ -825,14 +828,12 @@ /** * method to merge two history chunks for renamed file so that - * this node's history continues with that of child + * this node's history continues (or forks, if we don't followAncestry) + * with that of child * @param child */ public void bindChild(HistoryNode child) { assert child.parent1 == null && child.parent2 == null; - // for the last element in history empty children are by construction: - // we don't iterate further than last element of interest in TreeBuildInspector#go - assert children == null || children.isEmpty(); child.parent1 = this; addChild(child); } diff -r 0ae5768081aa -r 9922d1f7cb2a test/org/tmatesoft/hg/test/TestHistory.java --- a/test/org/tmatesoft/hg/test/TestHistory.java Tue Dec 18 18:57:03 2012 +0100 +++ b/test/org/tmatesoft/hg/test/TestHistory.java Tue Dec 18 19:08:00 2012 +0100 @@ -157,7 +157,7 @@ } }); h.checkPrevInParents = true; - new HgLogCommand(repo).file(fname, true).execute(h); + new HgLogCommand(repo).file(fname, true, true).execute(h); assertEquals(1, h.getAdapterUse(HgFileRenameHandlerMixin.class)); @@ -368,12 +368,12 @@ // if (checkPrevInChildren && !cmdResult.isEmpty()) { HgChangeset prevChangeset = reverseResult ? cmdResult.getFirst() : cmdResult.getLast(); - String msg = String.format("No parent-child bind betwee revisions %d and %d", prevChangeset.getRevisionIndex(), entry.changeset().getRevisionIndex()); + String msg = String.format("No parent-child bind between revisions %d and %d", prevChangeset.getRevisionIndex(), entry.changeset().getRevisionIndex()); errorCollector.assertTrue(msg, entry.children().contains(prevChangeset)); } if (checkPrevInParents && !cmdResult.isEmpty()) { HgChangeset prevChangeset = reverseResult ? cmdResult.getFirst() : cmdResult.getLast(); - String msg = String.format("No parent-child bind betwee revisions %d and %d", prevChangeset.getRevisionIndex(), entry.changeset().getRevisionIndex()); + String msg = String.format("No parent-child bind between revisions %d and %d", prevChangeset.getRevisionIndex(), entry.changeset().getRevisionIndex()); errorCollector.assertTrue(msg, p.first() == prevChangeset || p.second() == prevChangeset); } //