Issue1841

Title convert from cvs: AssertionError: expected revision number
Priority bug Status chatting
Superseder Nosy List frank, jhein, lloyd, pmezard
Assigned To Topics convert

Created on 2009-09-23.21:24:02 by jhein, last changed 2010-02-15.20:34:57 by pmezard.

Files
File name Uploaded Type Edit Remove
cvsps.py.diff lloyd, 2010-02-04.02:38:15 application/octet-stream
Messages
msg11731 (view) Author: pmezard Date: 2010-02-15.20:34:57
@lloyd: could you provide the same patch in export format, so I have your
username/email and a log entry?
msg11592 (view) Author: frank Date: 2010-02-04.08:41:52
This patch looks pretty benign, and I have no problem with it going in.
msg11589 (view) Author: lloyd Date: 2010-02-04.02:38:15
There is a second case where lookahead is required and the attached diff
fixes it. Should a separate issue be opened for the case where a log history
has been entered as a log message? That's quite hostile input and the fix
for that is quite different. I guess that the revision numbers could be
tracked and entries thay are not in sequence are the hostile input. Also,
the CVS head revision gives some limits on what revision numbers are possible.
msg10588 (view) Author: jhein Date: 2009-09-28.16:08:45
Also, I've seen cases where a single line lookahead will not do the job. 
Some people paste multiple full revision logs (including the 'revision'
line) as "documentation" for their commit (like a merge of multiple changes
from a different cvs branch).  It happens unfortunately.  Without using cvs
or rcs to grab the log entry for a revision, it's hard in some cases in the
real world to tell where a cvs log entry ends.
msg10587 (view) Author: jhein Date: 2009-09-28.16:04:30
I am running 1.3.1 which has that change.  So, no, it wasn't fixed.  The
exception happens in state 5 in createlog(), whereas the lookahead added in
the changeset you mentioned does not happen until state 7.

p.s. 'cvs admin' is out since this is a read-only cvs repo from a third
party (and incremental converts are needed, so a 1-time hack is not a good
option).
msg10567 (view) Author: frank Date: 2009-09-24.10:32:49
Was this not fixed with 9811cc670c51af8dd369f7925f6f4401a976d747?

cvsps: cvs log loop uses lookahead to avoid misleading text

Changes cvsps.py's cvs log reader to use a one-line lookahead, so
that possibly misleading log messages can be disambiguated.  In
particular I have past committers who used cvs log's 28-character
row of hyphens within commit messages; this throws cvsps and disrupts
conversion.  The only alternative in this case is to edit the cvs
,v file by hand, which bloodies mercurial's "don't change history"
principle.

Or use cvs admin -m.
msg10559 (view) Author: jhein Date: 2009-09-23.21:24:02
hgext/convert/cvs.py can be confused by certain log entries.

The most recent example I ran into was a log entry that had 28 dashes in the
middle of the log.  This confused cvs.py which expected a revision line to
be next.

 .
 .
----------------------------
revision 1.6.10.3
date: 2009/05/22 22:07:49;  author: foo;  state: Exp;  lines: +9 -1
branches:  1.6.10.3.4;
merge from head:
   ... blah blah
----------------------------
date: 2009/04/19 15:48:16;  author: mtm;  state: Exp;  lines: +4 -2
  ... blah blah some change on head
----------------------------
 .
 .

This is only one cvs log entry, but cvs.py gets confused and thinks
otherwise, throwing this error:

AssertionError: expected revision number

Possible solutions?
 - don't die on unexpected log parsing issues, but rather assume it was not
a new cvs log entry
 - better: use cvs to grab the log entry instead of trying to guess where
log entries begin and end in cvs.py (e.g., 'cvs log -N -r1.6.10.3' in the
above example would output the log lines which we can record and skip over
in cvs.py)
History
Date User Action Args
2010-02-15 20:34:57pmezardsetnosy: + pmezard
messages: + msg11731
2010-02-04 08:41:52franksetnosy: frank, jhein, lloyd
messages: + msg11592
2010-02-04 02:38:15lloydsetfiles: + cvsps.py.diff
nosy: + lloyd
messages: + msg11589
2009-09-28 16:08:45jheinsetmessages: + msg10588
2009-09-28 16:04:31jheinsetmessages: + msg10587
2009-09-24 10:32:49franksetstatus: unread -> chatting
nosy: + frank
messages: + msg10567
2009-09-23 21:26:16jheinsettitle: cvsps: AssertionError: expected revision number -> convert from cvs: AssertionError: expected revision number
2009-09-23 21:24:02jheincreate