diff hgext/convert/cvsps.py @ 10695:b4b16e90712f stable

convert: teach cvsps to handle . repository (issue1649) For a CVS repository checked out with "cvs co .", the prefix used to strip of what we get from CVS was previously erroneously set to "repopath/.". We now prevent the dot to be added. Test folded in test-convert-cvs and simplified by Patrick M?zard <pmezard@gmail.com>.
author Mathieu Clabaut <mathieu.clabaut@systerel.fr>
date Tue, 09 Mar 2010 12:09:57 +0100
parents 08a0f04b56bd
children 35893dcfd40c
line wrap: on
line diff
--- a/hgext/convert/cvsps.py	Sun Mar 14 18:46:38 2010 +0100
+++ b/hgext/convert/cvsps.py	Tue Mar 09 12:09:57 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