[PATCH 0 of 3] convert: Built-in cvsps for hg cvs import (6).

Patrick Mézard pmezard at gmail.com
Sat Jun 7 11:44:04 CDT 2008


Frank A. Kingswood a écrit :
> Patrick Mézard wrote:
>> I have not really used it but given the amount of work you put in and
>> the overall feedback, I am for the inclusion in Mercurial if the
>> following points are resolved:
>>
>> 1- Coding style is incorrect in cvs.py, I will annotate the message.
>> 2- Coding style of cvsps and cvsps.py do not follow Mercurial style
>> (same remarks as in [1]). I find it annoying but won't fight against
>> it if others are OK with it. What's blocking for me is the identation,
>> I dislike having one differing from the python standard of 4 spaces
>> per tab. Not everybody is a wizard at editor configuration, it's good
>> to follow this convention.
> 
> OK. From your other message that boils down to whitespace only.
> 
>> 3- The new tests do not pass under Windows, the error output is copied
>> below.
> [...]
>> +cvs server: cvs checkout: cannot find module
> `src/c:\docume~1\trick\locals~1\temp\hgtests.qjk7mu\test-convert-cvs-branch\cvsrepo/src/a'
> - ignored
>> +
>> +abort: unknown CVS response: error
> 
> After the CVS checkout fails obviously we're dead.
> 
> I do not have access to a Windows machine to try this on, but I can
> guess that if this is a slash vs backslash issue. Can you help debug the
> script on Windows? Are you running with cygwin CVS or native?

No it's more complicated and painful:

http://www.selenic.com/mercurial/wiki/index.cgi/WindowsTestingPlan


You are right, in this particular case, what happens is the file paths returned by cvsps.py are absoluted instead of being relative to the current module. In practice, cvsps.py is full of expectations about Unix-like file paths. I don't have the time to delve into this right now, and even a simple critical code review will probably find most of them. What I can do is provide relevant outputs from cvs tools under Windows. Here is a customized trace of a cvsps.py call. Lines in quotes are produced by a "print repr(line)" right after the main decoding loop "for line in util.popen(' '.join(cmd)):" in cvsps.py (I suspected EOL issues too, but cannot find any for now). Non-quoted lines are test output context.

"""
using builtin cvsps
collecting CVS rlog
'\n'
'RCS file: c:\\docume~1\\trick\\locals~1\\temp\\hgtests.wxuxbp\\test-convert-cvs-builtincvsps\\cvsrepo/src/a,v\n'
'head: 1.1\n'
'branch: 1.1.1\n'
'locks: strict\n'
'access list:\n'
'symbolic names:\n'
'\tstart: 1.1.1.1\n'
'\tINITIAL: 1.1.1\n'
'keyword substitution: kv\n'
'total revisions: 2;\tselected revisions: 2\n'
'description:\n'
'----------------------------\n'
'revision 1.1\n'
'date: 2008/06/07 16:30:52;  author: Trick;  state: Exp;\n'
'branches:  1.1.1;\n'
'Initial revision\n'
'----------------------------\n'
'revision 1.1.1.1\n'
'date: 2008/06/07 16:30:52;  author: Trick;  state: Exp;  lines: +0 -0\n'
'import\n'
'=============================================================================\n'
'\n'
'RCS file: c:\\docume~1\\trick\\locals~1\\temp\\hgtests.wxuxbp\\test-convert-cvs-builtincvsps\\cvsrepo/src/b/c,v\n'
'head: 1.2\n'
'branch:\n'
'locks: strict\n'
'access list:\n'
'symbolic names:\n'
'\tstart: 1.1.1.1\n'
'\tINITIAL: 1.1.1\n'
'keyword substitution: kv\n'
'total revisions: 3;\tselected revisions: 3\n'
'description:\n'
'----------------------------\n'
'revision 1.2\n'
'date: 2008/06/07 16:30:55;  author: Trick;  state: Exp;  lines: +1 -0\n'
'ci0\n'
'----------------------------\n'
'revision 1.1\n'
'date: 2008/06/07 16:30:52;  author: Trick;  state: Exp;\n'
'branches:  1.1.1;\n'
'Initial revision\n'
'----------------------------\n'
'revision 1.1.1.1\n'
'date: 2008/06/07 16:30:52;  author: Trick;  state: Exp;  lines: +0 -0\n'
'import\n'
'=============================================================================\n'
5 log entries
creating changesets
3 changeset entries
"""

Hope that helps.

--
Patrick Mézard


More information about the Mercurial-devel mailing list