[PATCH] convert: handle deleted files when converting from Perforce (issue4743)

Matt Mackall mpm at selenic.com
Wed Jul 8 14:01:01 CDT 2015


On Wed, 2015-07-08 at 13:34 -0500, Matt Mackall wrote:
> On Wed, 2015-07-08 at 09:49 +0100, Eugene Baranov wrote:
> > Hmm, I think something went wrong when importing changeset since for
> > some reason https://selenic.com/repo/hg/rev/97fd07e38b83 doesn't
> > actually contain any changes: "diffstat0 files changed, 0
> > insertions(+), 0 deletions(-)"
> 
> Indeed! You've discovered an "interesting" problem:
> 
> $ hg import --debug -v ~/patches/convert-handle-deleted-files-when-converting-from.patch
> applying /home/mpm/patches/convert-handle-deleted-files-when-converting-from.patch
> Subject: 
> 
> Content-Type: text/plain
> found patch at byte 320
> patch generated by hg export
> From: Eugene Baranov <eug.baranov at gmail.com>
> message:
> convert: handle deleted files when converting from Perforce (issue4743)
> patching file hgext/convert/p4.py
> applied to working directory
> 
> $ patch -p1 < ~/patches/convert-handle-deleted-files-when-converting-from.patch
> patching file hgext/convert/p4.py
> patch: **** malformed patch at line 14:                  raise IOError(d["generic"], data)
> 
> So looks like our patch importer is quietly dropping things where patch
> complains. But what's wrong with the patch? Turns out the patch I'm
> trying to apply looks like this:
> 
> --- a/hgext/convert/p4.py                                                                                                                                                                                                                      
> +++ b/hgext/convert/p4.py                                                                                                                                                                                                                      
> @@ -164 +164 @@
> 
> ..while the patch you sent looks like this:
> 
> --- a/hgext/convert/p4.py                                                                                                                                                                                                                      
> +++ b/hgext/convert/p4.py                                                                                                                                                                                                                      
> @@ -164,7 +164,8 @@
> 
> ..which is apparently caused by a bug in the recountdiff tool my scripts
> use in case I edit a patch in flight.

Actually, the issue is that the second line of your diff as received is
empty (rather than containing a single space). Many modern email clients
helpfully mangle whitespace whenever possible, which makes all the patch
tools unhappy.

I'll fix this up locally. Please checkout the patchbomb extension or
pushgate for ways of reliably sending diffs.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list