Patchwork [stable] : fix binary file removals in git mode.

login
register
mail settings
Submitter Johan Björk
Date March 5, 2013, 2:25 p.m.
Message ID <CAC_K0er504U6wwc2oWeQzf7tT5i8RSDNYAT=HacYR-hqqZPpTA@mail.gmail.com>
Download mbox | patch
Permalink /patch/1080/
State Rejected
Headers show

Comments

Johan Björk - March 5, 2013, 2:25 p.m.
# HG changeset patch
# User Johan Bjork <jbjoerk@gmail.com>
# Date 1362436451 0
# Branch stable
# Node ID d0a224efdd3cfb5e5b54cdb805b92460a40c5f44
# Parent  605c7c94fd70dcdb2ed695e8420e6ddae10a3a5b
diff: fix binary file removals in git mode.

With the previous version, a binary file removal diff generated with
   diff --git a/bintoregular b/bintoregular
Bryan O'Sullivan - March 8, 2013, 8:37 p.m.
On Tue, Mar 5, 2013 at 6:25 AM, Johan Björk <jbjoerk@gmail.com> wrote:

> diff: fix binary file removals in git mode.
>

This patch doesn't apply.
Johan Björk - March 8, 2013, 11:25 p.m.
Sorry about that, copy-pasted it into the email client and lost some
whitespace.
Newly sent version should work I hope.

/Johan


On Fri, Mar 8, 2013 at 3:37 PM, Bryan O'Sullivan <bos@serpentine.com> wrote:

> On Tue, Mar 5, 2013 at 6:25 AM, Johan Björk <jbjoerk@gmail.com> wrote:
>
>> diff: fix binary file removals in git mode.
>>
>
> This patch doesn't apply.
Johan Björk - March 22, 2013, 3:11 p.m.
Can I do something to get this tiny patch accepted? Should I file a ticket
in the bugtracker?

/Johan


On Fri, Mar 8, 2013 at 6:25 PM, Johan Björk <jbjoerk@gmail.com> wrote:

> Sorry about that, copy-pasted it into the email client and lost some
> whitespace.
> Newly sent version should work I hope.
>
> /Johan
>
>
> On Fri, Mar 8, 2013 at 3:37 PM, Bryan O'Sullivan <bos@serpentine.com>wrote:
>
>> On Tue, Mar 5, 2013 at 6:25 AM, Johan Björk <jbjoerk@gmail.com> wrote:
>>
>>> diff: fix binary file removals in git mode.
>>>
>>
>> This patch doesn't apply.
>
>
>
Bryan O'Sullivan - March 22, 2013, 4:14 p.m.
On Fri, Mar 22, 2013 at 8:11 AM, Johan Björk <jbjoerk@gmail.com> wrote:

> Can I do something to get this tiny patch accepted? Should I file a ticket
> in the bugtracker?
>

The version you resent still doesn't apply.

Patch

diff --git would not apply with 'git apply' with the error
"
error: removal patch leaves file contents
error: <file>: patch does not apply
"

diff -r 605c7c94fd70 -r d0a224efdd3c mercurial/patch.py
--- a/mercurial/patch.py        Thu Feb 28 21:53:13 2013 -0600
+++ b/mercurial/patch.py        Mon Mar 04 22:34:11 2013 +0000
@@ -1756,6 +1756,8 @@ 
                     else:
                         header.append('deleted file mode %s\n' %
                                       gitmode[man1.flags(f)])
+                        if util.binary(to):
+                            dodiff = 'binary'
                 elif not to or util.binary(to):
                     # regular diffs cannot represent empty file deletion
                     losedatafn(f)
diff -r 605c7c94fd70 -r d0a224efdd3c tests/test-diff-upgrade.t
--- a/tests/test-diff-upgrade.t Thu Feb 28 21:53:13 2013 -0600
+++ b/tests/test-diff-upgrade.t Mon Mar 04 22:34:11 2013 +0000
@@ -200,7 +200,11 @@ 
   % git=auto: git diff for rmbinary
   diff --git a/rmbinary b/rmbinary
   deleted file mode 100644
-  Binary file rmbinary has changed
+  index
f76dd238ade08917e6712764a16a22005a50573d..0000000000000000000000000000000000000000
+  GIT binary patch
+  literal 0
+  Hc$@<O00001
+

   % git=auto: git diff for bintoregular