Patchwork test-import-merge.t fails on windows, applying the patch fails directly instead of matching with an offset

login
register
mail settings
Submitter Simon Heimberg
Date Jan. 20, 2014, 9:18 p.m.
Message ID <52DD9298.9030603@besonet.ch>
Download mbox | patch
Permalink /patch/3395/
State Accepted
Headers show

Comments

Simon Heimberg - Jan. 20, 2014, 9:18 p.m.
test-import-merge.t fails since a long time [1]. Does anybody know why
   $ hg import --exact ../a.patch
behaves differently on windows and on other os? The operation is aborted in both places, so the
repo is in the same state. But why are the messages different? Looks like the patch does not
match at all on windows. Does the patch have different line ends, a leading bom, ...?


The failure message:



[1] The first failure is before "stable" build 26 [2] and "default" 
build 42 [3]. The runs before have failed, so no more exact information 
is present.
[2] 
http://hgbuildbot.kublai.com/builders/Windows%202008%20R2%20hg%20tests%20(stable)/builds/26/ 
<http://hgbuildbot.kublai.com/builders/Windows%202008%20R2%20hg%20tests%20%28stable%29/builds/26/>
[3] 
http://hgbuildbot.kublai.com/builders/Windows%202008%20R2%20hg%20tests/builds/42
Matt Mackall - Jan. 20, 2014, 11:09 p.m.
On Mon, 2014-01-20 at 22:18 +0100, Simon Heimberg wrote:
> test-import-merge.t fails since a long time [1]. Does anybody know why
>    $ hg import --exact ../a.patch
> behaves differently on windows and on other os? The operation is aborted in both places, so the
> repo is in the same state. But why are the messages different? Looks like the patch does not
> match at all on windows. Does the patch have different line ends, a leading bom, ...?

Hmmm.

  $ hg export tip > out
  >>> apatch = open("../a.patch", "a")
  >>> apatch.write("".join(open("out").readlines()[7:]))

This "a" looks suspiciously non-portable. It's from this diff:

http://www.selenic.com/hg/diff/3193b23eec61/tests/test-import-merge.t

This change was made in August, possibly after the Windows buildbot
died. I'll add a "b" to the mode to do it in binary mode.
Pierre-Yves David - April 14, 2014, 4:38 a.m.
On 01/20/2014 06:09 PM, Matt Mackall wrote:
> On Mon, 2014-01-20 at 22:18 +0100, Simon Heimberg wrote:
>> test-import-merge.t fails since a long time [1]. Does anybody know why
>>     $ hg import --exact ../a.patch
>> behaves differently on windows and on other os? The operation is aborted in both places, so the
>> repo is in the same state. But why are the messages different? Looks like the patch does not
>> match at all on windows. Does the patch have different line ends, a leading bom, ...?
>
> Hmmm.
>
>    $ hg export tip > out
>    >>> apatch = open("../a.patch", "a")
>    >>> apatch.write("".join(open("out").readlines()[7:]))
>
> This "a" looks suspiciously non-portable. It's from this diff:
>
> http://www.selenic.com/hg/diff/3193b23eec61/tests/test-import-merge.t
>
> This change was made in August, possibly after the Windows buildbot
> died. I'll add a "b" to the mode to do it in binary mode.

anything needs to be done about this patch or should we consider the 
case closed?
Matt Mackall - April 15, 2014, 3:50 p.m.
On Mon, 2014-04-14 at 00:38 -0400, Pierre-Yves David wrote:
> 
> On 01/20/2014 06:09 PM, Matt Mackall wrote:
> > On Mon, 2014-01-20 at 22:18 +0100, Simon Heimberg wrote:
> >> test-import-merge.t fails since a long time [1]. Does anybody know why
> >>     $ hg import --exact ../a.patch
> >> behaves differently on windows and on other os? The operation is aborted in both places, so the
> >> repo is in the same state. But why are the messages different? Looks like the patch does not
> >> match at all on windows. Does the patch have different line ends, a leading bom, ...?
> >
> > Hmmm.
> >
> >    $ hg export tip > out
> >    >>> apatch = open("../a.patch", "a")
> >    >>> apatch.write("".join(open("out").readlines()[7:]))
> >
> > This "a" looks suspiciously non-portable. It's from this diff:
> >
> > http://www.selenic.com/hg/diff/3193b23eec61/tests/test-import-merge.t
> >
> > This change was made in August, possibly after the Windows buildbot
> > died. I'll add a "b" to the mode to do it in binary mode.
> 
> anything needs to be done about this patch or should we consider the 
> case closed?

I fixed it a while ago.

Patch

--- c:\Users\buildbot\w2k8\Windows_2008_R2_hg_tests__stable_\build\tests\test-import-merge.t
+++ c:\Users\buildbot\w2k8\Windows_2008_R2_hg_tests__stable_\build\tests\test-import-merge.t.err
@@ -142,10 +142,9 @@ 
    applying ../a.patch
    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    patching file a
-  Hunk #1 succeeded at 1 with fuzz 1 (offset -1 lines).
-  transaction abort!
-  rollback completed
-  abort: patch is damaged or loses information
+  Hunk #1 FAILED at 0
+  1 out of 1 hunks FAILED -- saving rejects to file a.rej
+  abort: patch failed to apply
    [255]
    $ hg verify
    checking changesets