[PATCH STABLE V2] opener: do not unlink symlinks on 'w'rite

Adrian Buehlmann adrian at cadifra.com
Fri Nov 26 03:29:38 CST 2010


On 2010-11-25 23:55, Christian Ebert wrote:
> * Adrian Buehlmann on Thursday, November 25, 2010 at 23:40:33 +0100
>> # HG changeset patch
>> # User Adrian Buehlmann <adrian at cadifra.com>
>> # Date 1290708399 -3600
>> # Branch stable
>> # Node ID 0162f745b6ba9f422e22c71f03b0c7d91a17cacb
>> # Parent  dd24f3e7ca9e68a49fd7f38803e4d98469cad6e4
>> opener: do not unlink symlinks on 'w'rite
>>
>> The current code replaces symlinks with a normal file on 'w'rite.
>>
>> This patch restores the pre 1.7.1 behavior, which preserves symlinks.
> 
> I will try to get on your nerves again ;-) test-hardlinks.t
> throws an error with this patch on MacOS X:

Nice try indeed (to get on my nerves). But it's hardly a Mac OS X
problem :). Read on.

> ~/hgworkspace/hg-crew-mq/tests▷hg•default•13041:092d0f81d652[opener.diff]$ ./run-tests.py test-hardlinks.t
> 
> ERROR: /Users/chris/hgworkspace/hg-crew-mq/tests/test-hardlinks.t output changed
> --- /Users/chris/hgworkspace/hg-crew-mq/tests/test-hardlinks.t
> +++ /Users/chris/hgworkspace/hg-crew-mq/tests/test-hardlinks.t.err
> @@ -210,10 +210,14 @@
> 
> 
>    $ cd r3
> +  /var/folders/Uv/Uv1fv0Yz2RaBNU+BYnlOsU+++TM/-Tmp-/tmpxsGiFzhg-tst: line 139: cd: r3: No such file or directory
> +  [1]
>    $ hg tip --template '{rev}:{node|short}\n'
> -  11:a6451b6bc41f
> +  1:7069c422939c
>    $ echo bla > f1
>    $ hg ci -m1
> +  nothing changed
> +  [1]
>    $ cd ..
> 
>  Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):

Yeah. It fails in the same way on Linux if I apply the patch on the
default branch :)

Please apply it on the stable branch. The patch is for stable, not default.

The patch happens to apply cleanly on default as well, but it can't
possibly work, because test-hardlinks.t was already refactored in
default. The changes to the tests this patch here does to stable will
need to be merged into default (in case the patch is pushed).


More information about the Mercurial-devel mailing list