DORMANTno replies

[PATCH] Handle the case where cvsps claims a branch is an ancestor of itself

From: Christian Biesinger <hidden>
Date: 2016-06-15 22:42:18
Subsystem: the rest · Maintainer: Linus Torvalds

cvsps sometimes claims that a branch is an ancestor of itself. That confuses
cvsimport. This checkin makes it change the ancestor to HEAD instead.

Signed-off-by: Christian Biesinger <redacted>

---

On the mozilla.org CVS repository, cvsps managed to output a branch as an
ancestor of itself... This patch allows cvsimport to handle that, although
I'm not sure if this is a good idea (a better fix might be to make cvsps not
do that. I haven't debugged yet why it does this)

 git-cvsimport.perl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

71f7fdb5fd6eccf75ca3c9e070391f94f013dd7e
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 4b8ca95..74d6e10 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -811,6 +811,10 @@ while(<CVS>) {
 				print "In patchset $patchset: ancestor branch unknown, setting to $opt_o" if $opt_v;
 				$ancestor = $opt_o;
 			}
+			if ($ancestor eq $branch) {
+				print "CVSPS INCONSISTENCY: Branch is an ancestor of itself. Setting ancestor to $opt_o\n";
+				$ancestor = $opt_o;
+			}
 			if(-f "$git_dir/refs/heads/$branch") {
 				print STDERR "Branch $branch already exists!\n";
 				$state=11;
-- 
1.1.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help