diff src/org/tmatesoft/hg/core/HgIncomingCommand.java @ 698:822f3a83ff57

in, out and clone tests pass for ssh repositories. Infrastructure to decouple HgRemoteRepository from specific Connector implementation
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 06 Aug 2013 21:18:33 +0200
parents 6526d8adbc0f
children
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgIncomingCommand.java	Tue Aug 06 13:34:34 2013 +0200
+++ b/src/org/tmatesoft/hg/core/HgIncomingCommand.java	Tue Aug 06 21:18:33 2013 +0200
@@ -155,9 +155,17 @@
 				
 				public void next(int revisionNumber, Nodeid nodeid, RawChangeset cset) throws HgRuntimeException {
 					if (parentHelper.knownNode(nodeid)) {
-						if (!common.contains(nodeid)) {
-							throw new HgInvalidStateException("Bundle shall not report known nodes other than roots we've supplied");
-						}
+						// FIXME getCommon() and remote.changegroup do not work together nicely.
+						// e.g. for hgtest-annotate-merge repository and TestIncoming, common reports r0 and r5 (ancestor of r5)
+						// because there's a distinct branch from r0 (in addition to those after r5). 
+						// remote.changegroup however answers with revisions that are children of either, 
+						/// so revisions 0..5 are reported as well and the next check fails. Instead, shall pass
+						// not common, but 'first to load' to remote.changegroup() or use another method (e.g. getbundle)
+						// Note, sending r5 only (i.e. checking for ancestors in common) won't help, changegroup sends children of
+						// requested roots only, and doesn't look for anything else
+//						if (!common.contains(nodeid)) {
+//							throw new HgInvalidStateException("Bundle shall not report known nodes other than roots we've supplied");
+//						}
 						return;
 					}
 					transformer.next(localIndex++, nodeid, cset);