changeset 10696:28e9a9907236

Merge with crew-stable
author Patrick Mezard <pmezard@gmail.com>
date Sun, 14 Mar 2010 23:18:50 +0100
parents d7732d2df54a (current diff) b4b16e90712f (diff)
children 7b0a0d498cc0
files
diffstat 3 files changed, 37 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/cvsps.py	Sun Mar 14 23:10:52 2010 +0100
+++ b/hgext/convert/cvsps.py	Sun Mar 14 23:18:50 2010 +0100
@@ -124,9 +124,9 @@
         # Get the real directory in the repository
         try:
             prefix = open(os.path.join('CVS','Repository')).read().strip()
+            directory = prefix
             if prefix == ".":
                 prefix = ""
-            directory = prefix
         except IOError:
             raise logerror('Not a CVS sandbox')
 
@@ -184,7 +184,11 @@
         p = util.normpath(getrepopath(root))
         if not p.endswith('/'):
             p += '/'
-        prefix = p + util.normpath(prefix)
+        if prefix:
+            # looks like normpath replaces "" by "."
+            prefix = p + util.normpath(prefix)
+        else:
+            prefix = p
     cmd.append(['log', 'rlog'][rlog])
     if date:
         # no space between option and date string
--- a/tests/test-convert-cvs	Sun Mar 14 23:10:52 2010 +0100
+++ b/tests/test-convert-cvs	Sun Mar 14 23:18:50 2010 +0100
@@ -75,6 +75,15 @@
 hgcat b/c
 hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
 
+echo % 'convert full repository (issue1649)'
+cvscall -q -d "$CVSROOT" checkout -d srcfull "." | grep -v CVSROOT
+ls srcfull
+hg convert srcfull srcfull-hg \
+    | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' \
+    | grep -v 'log entries' | grep -v 'hook:'
+hg cat -r tip srcfull-hg/src/a
+hg cat -r tip srcfull-hg/src/b/c
+
 echo % commit new file revisions
 cd src
 echo a >> a
--- a/tests/test-convert-cvs.out	Sun Mar 14 23:10:52 2010 +0100
+++ b/tests/test-convert-cvs.out	Sun Mar 14 23:18:50 2010 +0100
@@ -53,6 +53,28 @@
 2 update tags files: .hgtags
 1 ci0 files: b/c
 0 Initial revision files: b/c
+% convert full repository (issue1649)
+U srcfull/src/a
+U srcfull/src/b/c
+CVS
+CVSROOT
+src
+initializing destination srcfull-hg repository
+connecting to cvsrepo
+scanning source...
+collecting CVS rlog
+creating changesets
+4 changeset entries
+sorting...
+converting...
+3 Initial revision
+2 import
+1 initial checkin
+0 ci0
+updating tags
+a
+c
+c
 % commit new file revisions
 checking in src/a,v
 checking in src/b/c,v