[PATCH] test-merge-tools: fix flaky test by avoiding debugsetparents

Augie Fackler raf at durin42.com
Wed Feb 11 08:37:50 CST 2015


On Feb 10, 2015, at 7:24 PM, Martin von Zweigbergk <martinvonz at google.com> wrote:

> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at google.com>
> # Date 1423613835 28800
> #      Tue Feb 10 16:17:15 2015 -0800
> # Node ID 4bba350e6e54c663a0763870bcd7a6f95857f601
> # Parent  415414caf43924082eeab9ef1ce329cb2ab1f8eb
> test-merge-tools: fix flaky test by avoiding debugsetparents

Queued this, thanks.

> 
> debugsetparents is a debug command and does not provide the same
> guarantees as non-debug commands do. In particular, when the user sets
> a different parent, any clean files will remain clean in the dirstate
> even though the new parent might have a different version of the file
> (so it should appear modified compared to the new parent). Let's
> instead achieve the same effect by updating to the new parent and
> reverting the contents back to what they were.
> 
> This fix can be tested by passing '--config
> debug.dirstate.delaywrite=2' to the 'hg update' command in the
> beforemerge().
> 
> diff -r 415414caf439 -r 4bba350e6e54 tests/test-merge-tools.t
> --- a/tests/test-merge-tools.t	Mon Feb 09 16:20:55 2015 -0800
> +++ b/tests/test-merge-tools.t	Tue Feb 10 16:17:15 2015 -0800
> @@ -603,7 +603,8 @@
>   true.priority=1
>   true.executable=cat
>   # hg update -C 1
> -  $ hg debugsetparent 0
> +  $ hg update -q 0
> +  $ hg revert -q -r 1 .
>   $ hg update -r 2
>   merging f
>   revision 1
> @@ -628,7 +629,8 @@
>   true.priority=1
>   true.executable=cat
>   # hg update -C 1
> -  $ hg debugsetparent 0
> +  $ hg update -q 0
> +  $ hg revert -q -r 1 .
>   $ hg update -r 2 --tool false
>   merging f
>   merging f failed!
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150211/f0a2287c/attachment.pgp>


More information about the Mercurial-devel mailing list