Issue181

Title Improve patch detection for hg import
Priority wish Status chatting
Superseder Nosy List ThomasAH, junkblocker
Assigned To ThomasAH Topics

Created on 2006-03-24.07:50:12 by ThomasAH, last changed 2007-06-22.21:42:44 by mpm.

Messages
msg820 (view) Author: ThomasAH Date: 2006-03-24.09:36:43
# attempt to detect the start of a patch
    # (this heuristic is borrowed from quilt)
    diffre = re.compile(r'(?:Index:[ \t]|diff[ \t]|RCS file: |' +
                        'retrieving revision [0-9]+(\.[0-9]+)*$|' +
                        '(---|\*\*\*)[ \t])')

When improving the re, this should be corrected, too:
1. the three strings don't need the + operators, this just makes
   reading the regexp harder.
2. only the first string is raw, so it is only luck that \. and \*
   don't get evaluated as something unwanted:
   >>> print repr(r'22\22' + '22\22')
   '22\\2222\x12'
msg819 (view) Author: ThomasAH Date: 2006-03-24.07:50:08
hg import's diffre only looks at single lines when trying to detect the start of
a patch, so lines like
--- TK Soh <teekaysoh@yahoo.com> wrote:
confuse it.
Additionally 'hg import' should write a warning if a patch without a description
is imported, but it should continue without needing --force.
History
Date User Action Args
2007-06-22 21:42:44mpmsetpriority: bug -> wish
2006-04-15 02:25:38junkblockersetnosy: + junkblocker
2006-03-24 09:36:47ThomasAHsetpriority: wish -> bug
status: unread -> chatting
messages: + msg820
2006-03-24 07:50:12ThomasAHcreate