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

Eugene Baranov eug.baranov at gmail.com
Wed Jul 8 14:03:05 CDT 2015


It felt like my first Mercurial patch was special in some way. :)

On 8 July 2015 at 19:34, Matt Mackall <mpm at selenic.com> 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.
>
> --
> Mathematics is the supreme nostalgia of our time.
>


More information about the Mercurial-devel mailing list