Issue1649

Title Convert: CVS module path with leading '.'
Priority bug Status resolved
Superseder Nosy List CarstenGrohmann, brendan, mathieu.clabaut, pmezard, rturnbull, tonfa
Assigned To Topics convert

Created on 2009-05-05.07:03:06 by CarstenGrohmann, last changed 2010-07-23.18:19:04 by mpm.

Messages
msg12197 (view) Author: rturnbull Date: 2010-03-31.23:34:42
I tried the "stable" build of mercurial with the "patched" cvsps.py file for
teaching cvsps to handle . repository.  My repository is not that complex,
however I did try to get a checkout from cvs of . working with the newest
stable version.  However I always encountered the same error that the
default build (download build) of mercurial.  Any idea when this will be
ready?  Could I help in getting this working?  Please let me know as this
would be really handy to go from cvs direct to hg instead of the proposed
cvs to svn then svn to hg.

Thanks
msg12049 (view) Author: brendan Date: 2010-03-14.23:00:13
See http://hg.intevation.org/mercurial/crew/rev/b4b16e90712f
(convert: teach cvsps to handle . repository (issue1649))
msg12047 (view) Author: pmezard Date: 2010-03-14.22:24:12
Fixed in stable by http://hg.intevation.org/mercurial/crew/rev/b4b16e90712f
msg11961 (view) Author: mathieu.clabaut Date: 2010-03-09.10:33:30
Here is the proposed patched (the one sent to the mailing list was 
accompagned by a new test). The idea is to not use "." as a prefix for 
building the repository path.

diff -r 261cc6b0f15c -r b69a6963d561 hgext/convert/cvsps.py
--- a/hgext/convert/cvsps.py	Thu Feb 18 23:23:17 2010 -0600
+++ b/hgext/convert/cvsps.py	Mon Feb 22 16:24:52 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,10 @@
         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
msg11844 (view) Author: mathieu.clabaut Date: 2010-02-22.12:17:13
Same here.

Patch proposal sent on the mailing list.
msg11110 (view) Author: tonfa Date: 2009-11-30.15:50:42
Same bug here:

$ hg convert /home/tonfa/work/these/compsys/Posters
assuming destination Posters-hg
connecting to bboissin@lipforge.ens-lyon.fr/local/chroot/cvsroot/compsys
scanning source...
collecting CVS rlog
473 log entries
creating changesets
91 changeset entries
sorting...
converting...
90 Initial revision
cvs server: cvs checkout: cannot find module 
`Posters/local/chroot/cvsroot/compsys/Posters/general/Makefile' - ignored

abort: unknown CVS response: error
msg9261 (view) Author: CarstenGrohmann Date: 2009-05-05.07:03:02
Hi,

converting a whole repository fails with:
cvs server: cvs checkout: cannot find module 
`./home/cvs/project_carsten/repository/scripts/cvs.mailloginfo.pl' - ignored

The script exists. I assume the error is the leading '.' It seems '.' means the 
repository name. An absolute path is valid to accessing CVS repos.

It's possibly a logical bug in hgext/convert/cvs.py only. 
line 353: args.append(self.cvsrepo + '/' + name)
Adding a leading '.' to an absolute path converts the path to a relative one.

Steps to reproduce:
===================
1. Checkout a repository with all modules inside. Use the absolute path to the 
repository!
> mkdir cvs
> cd cvs
> cvs -d:pserver:carsten@localhost:/home/cvs/project_carsten/repository 
checkout . 
cvs checkout: Updating .
cvs checkout: Updating CVSROOT
U CVSROOT/checkoutlist
U CVSROOT/commitinfo
U CVSROOT/config
[...]

2. Convert the checkout directories
> /home/carsten/mercurial-1.2.1/hg convert .
assuming destination .-hg
using builtin cvsps
collecting CVS rlog
[...]
1459 changeset entries
connecting to :pserver:carsten@localhost:/home/cvs/project_carsten/repository
scanning source...
sorting...
converting...
1458 Initial revision
cvs server: cvs checkout: cannot find module 
`./home/cvs/project_carsten/repository/scripts/cvs.mailloginfo.pl' - ignored

abort: unknown CVS response: error

More Information:
=================
> cd CVS
> cat Repository
.
> cat Root
:pserver:carsten@localhost:/home/cvs/project_carsten/repository
History
Date User Action Args
2010-07-23 18:19:04mpmsetstatus: testing -> resolved
nosy: tonfa, brendan, pmezard, mathieu.clabaut, CarstenGrohmann, rturnbull
2010-03-31 23:34:42rturnbullsetnosy: + rturnbull
messages: + msg12197
2010-03-14 23:00:14brendansetnosy: + brendan
messages: + msg12049
2010-03-14 22:24:12pmezardsetstatus: chatting -> testing
nosy: + pmezard
messages: + msg12047
2010-03-09 10:33:30mathieu.clabautsetmessages: + msg11961
2010-02-22 12:17:13mathieu.clabautsetmessages: + msg11844
2010-02-22 10:28:00mathieu.clabautsetnosy: + mathieu.clabaut
2009-11-30 15:50:43tonfasetstatus: unread -> chatting
nosy: + tonfa
messages: + msg11110
2009-05-05 07:03:06CarstenGrohmanncreate