You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Max Bowsher <ma...@ukf.net> on 2004/01/01 17:10:25 UTC

[PATCH] cvs2svn issue 1505

Issue 1505: http://subversion.tigris.org/issues/show_bug.cgi?id=1505

Here is the patch I propose to commit to resolve issue 1505.

Since it involves changing existing test-data, I'm posting it for comments
first.

Karl: The changes to main-cvsrepos will require updates to
test-data/verification. I'll work on that once this is committed.

Max.


Index: test-data/unnamed-branch-cvsrepos/CVSROOT/README
===================================================================
--- test-data/unnamed-branch-cvsrepos/CVSROOT/README (revision 0)
+++ test-data/unnamed-branch-cvsrepos/CVSROOT/README (revision 0)
@@ -0,0 +1,8 @@
+This CVSROOT/ directory is only here to convince CVS that this is a
+real repository.  Without it, CVS operations fail with an error like:
+
+  cvs [checkout aborted]: .../main-cvsrepos/CVSROOT: No such file or
directory
+
+Of course, CVS doesn't seem to require that there actually be any
+files in CVSROOT/, which kind of makes one wonder why it cares about
+the directory at all.
Index: test-data/unnamed-branch-cvsrepos/unnamed-branch,v
===================================================================
--- test-data/unnamed-branch-cvsrepos/unnamed-branch,v (revision 0)
+++ test-data/unnamed-branch-cvsrepos/unnamed-branch,v (revision 0)
@@ -0,0 +1,37 @@
+head 1.1;
+access;
+symbols;
+locks; strict;
+comment @; @;
+
+
+1.1
+date 93.06.18.05.46.07; author jrandom; state Exp;
+branches
+ 1.1.1.1;
+next ;
+
+1.1.1.1
+date 93.06.18.05.46.08; author jrandom; state Exp;
+branches;
+next ;
+
+
+desc
+@@
+
+
+1.1
+log
+@Initial revision
+@
+text
+@@
+
+
+1.1.1.1
+log
+@Updated CVS
+@
+text
+@@
Index: test-data/main-cvsrepos/partial-prune/sub/Attic/first,v
===================================================================
--- test-data/main-cvsrepos/partial-prune/sub/Attic/first,v (revision 8134)
+++ test-data/main-cvsrepos/partial-prune/sub/Attic/first,v (working copy)
@@ -1,6 +1,7 @@
 head 1.3;
 access;
-symbols;
+symbols
+ vendorbranch:1.1.1;
 locks; strict;
 comment @; @;

Index: test-data/main-cvsrepos/partial-prune/sub/Attic/second,v
===================================================================
--- test-data/main-cvsrepos/partial-prune/sub/Attic/second,v (revision 8134)
+++ test-data/main-cvsrepos/partial-prune/sub/Attic/second,v (working copy)
@@ -1,6 +1,7 @@
 head 1.2;
 access;
-symbols;
+symbols
+ vendorbranch:1.1.1;
 locks; strict;
 comment @# @;

Index: test-data/main-cvsrepos/full-prune-reappear/sub/Attic/first,v
===================================================================
--- test-data/main-cvsrepos/full-prune-reappear/sub/Attic/first,v (revision
8134)
+++ test-data/main-cvsrepos/full-prune-reappear/sub/Attic/first,v (working
copy)
@@ -1,6 +1,7 @@
 head 1.3;
 access;
-symbols;
+symbols
+ vendorbranch:1.1.1;
 locks; strict;
 comment @; @;

Index: test-data/main-cvsrepos/full-prune-reappear/sub/Attic/second,v
===================================================================
--- test-data/main-cvsrepos/full-prune-reappear/sub/Attic/second,v (revision
8134)
+++ test-data/main-cvsrepos/full-prune-reappear/sub/Attic/second,v (working
copy)
@@ -1,6 +1,7 @@
 head 1.2;
 access;
-symbols;
+symbols
+ vendorbranch:1.1.1;
 locks; strict;
 comment @# @;

Index: test-data/main-cvsrepos/full-prune/Attic/first,v
===================================================================
--- test-data/main-cvsrepos/full-prune/Attic/first,v (revision 8134)
+++ test-data/main-cvsrepos/full-prune/Attic/first,v (working copy)
@@ -1,6 +1,7 @@
 head 1.3;
 access;
-symbols;
+symbols
+ vendorbranch:1.1.1;
 locks; strict;
 comment @; @;

Index: test-data/main-cvsrepos/full-prune/Attic/second,v
===================================================================
--- test-data/main-cvsrepos/full-prune/Attic/second,v (revision 8134)
+++ test-data/main-cvsrepos/full-prune/Attic/second,v (working copy)
@@ -1,6 +1,7 @@
 head 1.2;
 access;
-symbols;
+symbols
+ vendorbranch:1.1.1;
 locks; strict;
 comment @# @;

Index: test-data/double-delete-cvsrepos/twice-removed,v
===================================================================
--- test-data/double-delete-cvsrepos/twice-removed,v (revision 8134)
+++ test-data/double-delete-cvsrepos/twice-removed,v (working copy)
@@ -1,6 +1,7 @@
 head 1.3;
 access;
-symbols;
+symbols
+ vendorbranch:1.1.1;
 locks; strict;
 comment @; @;

Index: run-tests.py
===================================================================
--- run-tests.py (revision 8134)
+++ run-tests.py (working copy)
@@ -746,6 +746,14 @@
   repos, wc, logs = ensure_conversion('resync-misgroups')


+def unnamed_branch():
+  "fail on encountering an unnamed branch"
+  ret, ign, ign = ensure_conversion('unnamed-branch',
+                                    '.*has no branch name')
+  if ret:
+    raise svntest.Failure
+
+
 #----------------------------------------------------------------------

 ########################################################################
@@ -772,6 +780,7 @@
               double_delete,
               split_branch,
               resync_misgroups,
+              unnamed_branch,
              ]

 if __name__ == '__main__':
Index: cvs2svn.py
===================================================================
--- cvs2svn.py (revision 8134)
+++ cvs2svn.py (working copy)
@@ -176,8 +176,15 @@
     # record the previous revision for sanity checking later
     if trunk_rev.match(revision):
       self.prev[revision] = next
-    elif next:
-      self.prev[next] = revision
+    else:
+      if next:
+        self.prev[next] = revision
+      if self.get_branch_name(revision) is None:
+        sys.stderr.write("Error while parsing '%s':\n"
+                         "   revision '%s' has no branch name.\n" \
+                         % (self.fname, revision))
+        sys.exit(1)
+
     for b in branches:
       self.prev[b] = revision




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org