changeset 210:6a2481866491

Wrong parent assignment when building branch chain
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 28 Apr 2011 03:55:23 +0200
parents 9ce3b26798c4
children 644ee58c9f16
files src/org/tmatesoft/hg/internal/RepositoryComparator.java src/org/tmatesoft/hg/repo/HgRemoteRepository.java
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/RepositoryComparator.java	Thu Apr 28 03:44:45 2011 +0200
+++ b/src/org/tmatesoft/hg/internal/RepositoryComparator.java	Thu Apr 28 03:55:23 2011 +0200
@@ -260,7 +260,7 @@
 						if (bc == null) {
 							head2chain.put(rb.p1, bc = new BranchChain(rb.p1));
 						}
-						chainElement.p2 = bc;
+						chainElement.p1 = bc;
 					}
 					if (hasP2 && !localRepo.knownNode(rb.p2)) {
 						toQuery.add(rb.p2);
@@ -373,9 +373,13 @@
 		private void internalDump(String prefix) {
 			if (p1 != null) {
 				System.out.println(prefix + p1.toString());
+			} else if (p2 != null) {
+				System.out.println(prefix + "NONE?!");
 			}
 			if (p2 != null) {
 				System.out.println(prefix + p2.toString());
+			} else if (p1 != null) {
+				System.out.println(prefix + "NONE?!");
 			}
 			prefix += "  ";
 			if (p1 != null) {
--- a/src/org/tmatesoft/hg/repo/HgRemoteRepository.java	Thu Apr 28 03:44:45 2011 +0200
+++ b/src/org/tmatesoft/hg/repo/HgRemoteRepository.java	Thu Apr 28 03:55:23 2011 +0200
@@ -343,7 +343,7 @@
 			}
 			File tf = writeBundle(c.getInputStream(), false, "HG10GZ" /*didn't see any other that zip*/);
 			if (debug) {
-				System.out.printf("Wrote bundle %s for roots %s", tf, sb);
+				System.out.printf("Wrote bundle %s for roots %s\n", tf, sb);
 			}
 			return getLookupHelper().loadBundle(tf);
 		} catch (MalformedURLException ex) {