Patchwork [7,of,7,V2,mergedriver] filemerge: break overall filemerge into separate premerge and merge steps

login
register
mail settings
Submitter Siddharth Agarwal
Date Oct. 12, 2015, 7:45 a.m.
Message ID <9b87df69e14cf4933784.1444635942@dev6666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/10953/
State Accepted
Headers show

Comments

Siddharth Agarwal - Oct. 12, 2015, 7:45 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1444621634 25200
#      Sun Oct 11 20:47:14 2015 -0700
# Node ID 9b87df69e14cf4933784d4287b8750e1ea607e41
# Parent  82558c58ceeeae364c1d65413c8860d48c7d3e97
filemerge: break overall filemerge into separate premerge and merge steps

This means that in ms.resolve we must call merge after calling premerge. This
doesn't yet mean that all premerges happen before any merges -- however, this
does get us closer to our goal.

The output differences are because we recompute the merge tool. The only
user-visible difference caused by this patch is that if the tool is missing
we'll print the warning twice. Not a huge deal, though.
Augie Fackler - Oct. 12, 2015, 2:44 p.m.
On Mon, Oct 12, 2015 at 12:45:42AM -0700, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1444621634 25200
> #      Sun Oct 11 20:47:14 2015 -0700
> # Node ID 9b87df69e14cf4933784d4287b8750e1ea607e41
> # Parent  82558c58ceeeae364c1d65413c8860d48c7d3e97
> filemerge: break overall filemerge into separate premerge and merge steps

Based on my understanding of how this topic is going, I've queued these. Thanks!

>
> This means that in ms.resolve we must call merge after calling premerge. This
> doesn't yet mean that all premerges happen before any merges -- however, this
> does get us closer to our goal.
>
> The output differences are because we recompute the merge tool. The only
> user-visible difference caused by this patch is that if the tool is missing
> we'll print the warning twice. Not a huge deal, though.
>
> diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
> --- a/mercurial/filemerge.py
> +++ b/mercurial/filemerge.py
> @@ -519,6 +519,8 @@ def _filemerge(premerge, repo, mynode, o
>
>          if premerge and mergetype == fullmerge:
>              r = _premerge(repo, toolconf, files, labels=labels)
> +            # complete if premerge successful (r is 0)
> +            return not r, r
>
>          if not r:  # premerge successfully merged the file
>              needcheck = False
> @@ -575,9 +577,7 @@ def premerge(repo, mynode, orig, fcd, fc
>      return _filemerge(True, repo, mynode, orig, fcd, fco, fca, labels=labels)
>
>  def filemerge(repo, mynode, orig, fcd, fco, fca, labels=None):
> -    # premerge = True is temporary -- will be changed to False once premerge
> -    # function above is ready
> -    return _filemerge(True, repo, mynode, orig, fcd, fco, fca, labels=labels)
> +    return _filemerge(False, repo, mynode, orig, fcd, fco, fca, labels=labels)
>
>  # tell hggettext to extract docstrings from these functions:
>  i18nfunctions = internals.values()
> diff --git a/mercurial/merge.py b/mercurial/merge.py
> --- a/mercurial/merge.py
> +++ b/mercurial/merge.py
> @@ -309,8 +309,11 @@ class mergestate(object):
>          f = self._repo.vfs('merge/' + hash)
>          self._repo.wwrite(dfile, f.read(), flags)
>          f.close()
> -        complete, r = filemerge.filemerge(self._repo, self._local, lfile, fcd,
> -                                          fco, fca, labels=labels)
> +        complete, r = filemerge.premerge(self._repo, self._local, lfile, fcd,
> +                                         fco, fca, labels=labels)
> +        if not complete:
> +            complete, r = filemerge.filemerge(self._repo, self._local, lfile,
> +                                              fcd, fco, fca, labels=labels)
>          if r is None:
>              # no real conflict
>              del self._state[dfile]
> diff --git a/tests/test-graft.t b/tests/test-graft.t
> --- a/tests/test-graft.t
> +++ b/tests/test-graft.t
> @@ -187,6 +187,8 @@ Graft out of order, skipping a merge and
>    picked tool ':merge' for e (binary False symlink False)
>    merging e
>    my e@1905859650ec+ other e@9c233e8e184d ancestor e@68795b066622
> +  picked tool ':merge' for e (binary False symlink False)
> +  my e@1905859650ec+ other e@9c233e8e184d ancestor e@68795b066622
>    warning: conflicts during merge.
>    merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
>    abort: unresolved conflicts, can't continue
> diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t
> --- a/tests/test-merge-criss-cross.t
> +++ b/tests/test-merge-criss-cross.t
> @@ -86,6 +86,8 @@ Criss cross merging
>    picked tool ':dump' for f2 (binary False symlink False)
>    merging f2
>    my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@40494bf2444c
> +  picked tool ':dump' for f2 (binary False symlink False)
> +  my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@40494bf2444c
>    1 files updated, 0 files merged, 0 files removed, 1 files unresolved
>    use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
>    [1]
> diff --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t
> --- a/tests/test-merge-tools.t
> +++ b/tests/test-merge-tools.t
> @@ -351,6 +351,7 @@ merge-patterns specifies executable not
>    $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool
>    couldn't find merge tool true specified for f
>    merging f
> +  couldn't find merge tool true specified for f
>    merging f failed!
>    0 files updated, 0 files merged, 0 files removed, 1 files unresolved
>    use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
> @@ -374,6 +375,7 @@ merge-patterns specifies executable with
>    $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool
>    couldn't find merge tool true specified for f
>    merging f
> +  couldn't find merge tool true specified for f
>    merging f failed!
>    0 files updated, 0 files merged, 0 files removed, 1 files unresolved
>    use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
> diff --git a/tests/test-merge7.t b/tests/test-merge7.t
> --- a/tests/test-merge7.t
> +++ b/tests/test-merge7.t
> @@ -89,6 +89,8 @@ pull and merge from test-a again
>    picked tool ':merge' for test.txt (binary False symlink False)
>    merging test.txt
>    my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
> +  picked tool ':merge' for test.txt (binary False symlink False)
> +  my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
>    warning: conflicts during merge.
>    merging test.txt incomplete! (edit conflicts, then use 'hg resolve --mark')
>    0 files updated, 0 files merged, 0 files removed, 1 files unresolved
> diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
> --- a/tests/test-rename-merge2.t
> +++ b/tests/test-rename-merge2.t
> @@ -98,6 +98,8 @@ args:
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 2 files merged, 0 files removed, 0 files unresolved
> @@ -135,7 +137,9 @@ args:
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
> -  launching merge tool: python ../merge *$TESTTMP/t/t/rev* * (glob)
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
> +  launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    1 files updated, 2 files merged, 0 files removed, 0 files unresolved
>    (branch merge, don't forget to commit)
> @@ -171,6 +175,8 @@ args:
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 2 files merged, 0 files removed, 0 files unresolved
> @@ -205,6 +211,8 @@ args:
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 2 files merged, 0 files removed, 0 files unresolved
> @@ -235,6 +243,8 @@ args:
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    1 files updated, 1 files merged, 0 files removed, 0 files unresolved
> @@ -263,6 +273,8 @@ args:
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 1 files merged, 0 files removed, 0 files unresolved
> @@ -295,6 +307,8 @@ args:
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    1 files updated, 1 files merged, 1 files removed, 0 files unresolved
> @@ -322,6 +336,8 @@ args:
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 1 files merged, 0 files removed, 0 files unresolved
> @@ -347,12 +363,16 @@ args:
>    picked tool 'python ../merge' for b (binary False symlink False)
>    merging b
>    my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
> +  picked tool 'python ../merge' for b (binary False symlink False)
> +  my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
>    merge tool returned: 0
>     rev: versions differ -> m
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 2 files merged, 0 files removed, 0 files unresolved
> @@ -388,6 +408,8 @@ m "um a c" "um x c" "      " "10 do merg
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    note: possible conflict - a was renamed multiple times to:
> @@ -417,12 +439,16 @@ m "um a c" "um x c" "      " "10 do merg
>    picked tool 'python ../merge' for b (binary False symlink False)
>    merging b
>    my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
> +  picked tool 'python ../merge' for b (binary False symlink False)
> +  my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
>    launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
>    merge tool returned: 0
>     rev: versions differ -> m
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 2 files merged, 0 files removed, 0 files unresolved
> @@ -451,12 +477,16 @@ m "um a c" "um x c" "      " "10 do merg
>    picked tool 'python ../merge' for b (binary False symlink False)
>    merging b
>    my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
> +  picked tool 'python ../merge' for b (binary False symlink False)
> +  my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
>    launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
>    merge tool returned: 0
>     rev: versions differ -> m
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 2 files merged, 1 files removed, 0 files unresolved
> @@ -484,12 +514,16 @@ m "um a c" "um x c" "      " "10 do merg
>    picked tool 'python ../merge' for b (binary False symlink False)
>    merging b
>    my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
> +  picked tool 'python ../merge' for b (binary False symlink False)
> +  my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
>    launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
>    merge tool returned: 0
>     rev: versions differ -> m
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    1 files updated, 2 files merged, 0 files removed, 0 files unresolved
> @@ -518,12 +552,16 @@ m "um a c" "um x c" "      " "10 do merg
>    picked tool 'python ../merge' for b (binary False symlink False)
>    merging b
>    my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
> +  picked tool 'python ../merge' for b (binary False symlink False)
> +  my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
>    launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
>    merge tool returned: 0
>     rev: versions differ -> m
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 2 files merged, 1 files removed, 0 files unresolved
> @@ -551,12 +589,16 @@ m "um a c" "um x c" "      " "10 do merg
>    picked tool 'python ../merge' for b (binary False symlink False)
>    merging b
>    my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
> +  picked tool 'python ../merge' for b (binary False symlink False)
> +  my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
>    launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
>    merge tool returned: 0
>     rev: versions differ -> m
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    1 files updated, 2 files merged, 0 files removed, 0 files unresolved
> @@ -584,12 +626,16 @@ m "um a c" "um x c" "      " "10 do merg
>    picked tool 'python ../merge' for b (binary False symlink False)
>    merging b
>    my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
> +  picked tool 'python ../merge' for b (binary False symlink False)
> +  my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
>    launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
>    merge tool returned: 0
>     rev: versions differ -> m
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 2 files merged, 0 files removed, 0 files unresolved
> @@ -620,12 +666,16 @@ m "um a c" "um x c" "      " "10 do merg
>    picked tool 'python ../merge' for b (binary False symlink False)
>    merging b
>    my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
> +  picked tool 'python ../merge' for b (binary False symlink False)
> +  my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
>    launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
>    merge tool returned: 0
>     rev: versions differ -> m
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    1 files updated, 2 files merged, 0 files removed, 0 files unresolved
> @@ -655,12 +705,16 @@ m "um a c" "um x c" "      " "10 do merg
>    picked tool 'python ../merge' for b (binary False symlink False)
>    merging b
>    my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
> +  picked tool 'python ../merge' for b (binary False symlink False)
> +  my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
>    launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
>    merge tool returned: 0
>     rev: versions differ -> m
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 2 files merged, 0 files removed, 0 files unresolved
> @@ -691,12 +745,16 @@ m "um a c" "um x c" "      " "10 do merg
>    picked tool 'python ../merge' for b (binary False symlink False)
>    merging a and b to b
>    my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
> +  picked tool 'python ../merge' for b (binary False symlink False)
> +  my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
>    merge tool returned: 0
>     rev: versions differ -> m
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 2 files merged, 0 files removed, 0 files unresolved
> @@ -726,12 +784,16 @@ m "um a c" "um x c" "      " "10 do merg
>    picked tool 'python ../merge' for b (binary False symlink False)
>    merging b and a to b
>    my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
> +  picked tool 'python ../merge' for b (binary False symlink False)
> +  my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
>    merge tool returned: 0
>     rev: versions differ -> m
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    0 files updated, 2 files merged, 0 files removed, 0 files unresolved
> @@ -773,6 +835,8 @@ m "nm a b" "um x a" "      " "22 get a,
>    picked tool 'python ../merge' for rev (binary False symlink False)
>    merging rev
>    my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
> +  picked tool 'python ../merge' for rev (binary False symlink False)
> +  my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
>    launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
>    merge tool returned: 0
>    1 files updated, 2 files merged, 0 files removed, 0 files unresolved
> diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
> --- a/tests/test-subrepo.t
> +++ b/tests/test-subrepo.t
> @@ -300,6 +300,8 @@ merge tests
>    picked tool ':merge' for t (binary False symlink False)
>    merging t
>    my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
> +  picked tool ':merge' for t (binary False symlink False)
> +  my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
>    warning: conflicts during merge.
>    merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
>    0 files updated, 0 files merged, 0 files removed, 1 files unresolved
> diff --git a/tests/test-up-local-change.t b/tests/test-up-local-change.t
> --- a/tests/test-up-local-change.t
> +++ b/tests/test-up-local-change.t
> @@ -53,7 +53,9 @@
>    picked tool 'true' for a (binary False symlink False)
>    merging a
>    my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
> -  launching merge tool: true *$TESTTMP/r2/a* * (glob)
> +  picked tool 'true' for a (binary False symlink False)
> +  my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
> +  launching merge tool: true *$TESTTMP/r2/a* * * (glob)
>    merge tool returned: 0
>    1 files updated, 1 files merged, 0 files removed, 0 files unresolved
>    $ hg parents
> @@ -74,7 +76,9 @@
>    picked tool 'true' for a (binary False symlink False)
>    merging a
>    my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
> -  launching merge tool: true *$TESTTMP/r2/a* * (glob)
> +  picked tool 'true' for a (binary False symlink False)
> +  my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
> +  launching merge tool: true *$TESTTMP/r2/a* * * (glob)
>    merge tool returned: 0
>    0 files updated, 1 files merged, 1 files removed, 0 files unresolved
>    $ hg parents
> @@ -103,7 +107,9 @@
>    picked tool 'true' for a (binary False symlink False)
>    merging a
>    my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
> -  launching merge tool: true *$TESTTMP/r2/a* * (glob)
> +  picked tool 'true' for a (binary False symlink False)
> +  my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
> +  launching merge tool: true *$TESTTMP/r2/a* * * (glob)
>    merge tool returned: 0
>    1 files updated, 1 files merged, 0 files removed, 0 files unresolved
>    $ hg parents
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -519,6 +519,8 @@  def _filemerge(premerge, repo, mynode, o
 
         if premerge and mergetype == fullmerge:
             r = _premerge(repo, toolconf, files, labels=labels)
+            # complete if premerge successful (r is 0)
+            return not r, r
 
         if not r:  # premerge successfully merged the file
             needcheck = False
@@ -575,9 +577,7 @@  def premerge(repo, mynode, orig, fcd, fc
     return _filemerge(True, repo, mynode, orig, fcd, fco, fca, labels=labels)
 
 def filemerge(repo, mynode, orig, fcd, fco, fca, labels=None):
-    # premerge = True is temporary -- will be changed to False once premerge
-    # function above is ready
-    return _filemerge(True, repo, mynode, orig, fcd, fco, fca, labels=labels)
+    return _filemerge(False, repo, mynode, orig, fcd, fco, fca, labels=labels)
 
 # tell hggettext to extract docstrings from these functions:
 i18nfunctions = internals.values()
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -309,8 +309,11 @@  class mergestate(object):
         f = self._repo.vfs('merge/' + hash)
         self._repo.wwrite(dfile, f.read(), flags)
         f.close()
-        complete, r = filemerge.filemerge(self._repo, self._local, lfile, fcd,
-                                          fco, fca, labels=labels)
+        complete, r = filemerge.premerge(self._repo, self._local, lfile, fcd,
+                                         fco, fca, labels=labels)
+        if not complete:
+            complete, r = filemerge.filemerge(self._repo, self._local, lfile,
+                                              fcd, fco, fca, labels=labels)
         if r is None:
             # no real conflict
             del self._state[dfile]
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -187,6 +187,8 @@  Graft out of order, skipping a merge and
   picked tool ':merge' for e (binary False symlink False)
   merging e
   my e@1905859650ec+ other e@9c233e8e184d ancestor e@68795b066622
+  picked tool ':merge' for e (binary False symlink False)
+  my e@1905859650ec+ other e@9c233e8e184d ancestor e@68795b066622
   warning: conflicts during merge.
   merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
   abort: unresolved conflicts, can't continue
diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t
--- a/tests/test-merge-criss-cross.t
+++ b/tests/test-merge-criss-cross.t
@@ -86,6 +86,8 @@  Criss cross merging
   picked tool ':dump' for f2 (binary False symlink False)
   merging f2
   my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@40494bf2444c
+  picked tool ':dump' for f2 (binary False symlink False)
+  my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@40494bf2444c
   1 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
   [1]
diff --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t
--- a/tests/test-merge-tools.t
+++ b/tests/test-merge-tools.t
@@ -351,6 +351,7 @@  merge-patterns specifies executable not 
   $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool
   couldn't find merge tool true specified for f
   merging f
+  couldn't find merge tool true specified for f
   merging f failed!
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
@@ -374,6 +375,7 @@  merge-patterns specifies executable with
   $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool
   couldn't find merge tool true specified for f
   merging f
+  couldn't find merge tool true specified for f
   merging f failed!
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
diff --git a/tests/test-merge7.t b/tests/test-merge7.t
--- a/tests/test-merge7.t
+++ b/tests/test-merge7.t
@@ -89,6 +89,8 @@  pull and merge from test-a again
   picked tool ':merge' for test.txt (binary False symlink False)
   merging test.txt
   my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
+  picked tool ':merge' for test.txt (binary False symlink False)
+  my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
   warning: conflicts during merge.
   merging test.txt incomplete! (edit conflicts, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -98,6 +98,8 @@  args:
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -135,7 +137,9 @@  args:
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
-  launching merge tool: python ../merge *$TESTTMP/t/t/rev* * (glob)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
+  launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 2 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -171,6 +175,8 @@  args:
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -205,6 +211,8 @@  args:
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -235,6 +243,8 @@  args:
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
@@ -263,6 +273,8 @@  args:
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
@@ -295,6 +307,8 @@  args:
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 1 files merged, 1 files removed, 0 files unresolved
@@ -322,6 +336,8 @@  args:
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
@@ -347,12 +363,16 @@  args:
   picked tool 'python ../merge' for b (binary False symlink False)
   merging b
   my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
+  picked tool 'python ../merge' for b (binary False symlink False)
+  my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -388,6 +408,8 @@  m "um a c" "um x c" "      " "10 do merg
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   note: possible conflict - a was renamed multiple times to:
@@ -417,12 +439,16 @@  m "um a c" "um x c" "      " "10 do merg
   picked tool 'python ../merge' for b (binary False symlink False)
   merging b
   my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
+  picked tool 'python ../merge' for b (binary False symlink False)
+  my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
   launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -451,12 +477,16 @@  m "um a c" "um x c" "      " "10 do merg
   picked tool 'python ../merge' for b (binary False symlink False)
   merging b
   my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
+  picked tool 'python ../merge' for b (binary False symlink False)
+  my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
   launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 1 files removed, 0 files unresolved
@@ -484,12 +514,16 @@  m "um a c" "um x c" "      " "10 do merg
   picked tool 'python ../merge' for b (binary False symlink False)
   merging b
   my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
+  picked tool 'python ../merge' for b (binary False symlink False)
+  my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
   launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -518,12 +552,16 @@  m "um a c" "um x c" "      " "10 do merg
   picked tool 'python ../merge' for b (binary False symlink False)
   merging b
   my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
+  picked tool 'python ../merge' for b (binary False symlink False)
+  my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
   launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 1 files removed, 0 files unresolved
@@ -551,12 +589,16 @@  m "um a c" "um x c" "      " "10 do merg
   picked tool 'python ../merge' for b (binary False symlink False)
   merging b
   my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
+  picked tool 'python ../merge' for b (binary False symlink False)
+  my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
   launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -584,12 +626,16 @@  m "um a c" "um x c" "      " "10 do merg
   picked tool 'python ../merge' for b (binary False symlink False)
   merging b
   my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
+  picked tool 'python ../merge' for b (binary False symlink False)
+  my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
   launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -620,12 +666,16 @@  m "um a c" "um x c" "      " "10 do merg
   picked tool 'python ../merge' for b (binary False symlink False)
   merging b
   my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
+  picked tool 'python ../merge' for b (binary False symlink False)
+  my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
   launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -655,12 +705,16 @@  m "um a c" "um x c" "      " "10 do merg
   picked tool 'python ../merge' for b (binary False symlink False)
   merging b
   my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
+  picked tool 'python ../merge' for b (binary False symlink False)
+  my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
   launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -691,12 +745,16 @@  m "um a c" "um x c" "      " "10 do merg
   picked tool 'python ../merge' for b (binary False symlink False)
   merging a and b to b
   my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
+  picked tool 'python ../merge' for b (binary False symlink False)
+  my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -726,12 +784,16 @@  m "um a c" "um x c" "      " "10 do merg
   picked tool 'python ../merge' for b (binary False symlink False)
   merging b and a to b
   my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
+  picked tool 'python ../merge' for b (binary False symlink False)
+  my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -773,6 +835,8 @@  m "nm a b" "um x a" "      " "22 get a, 
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 2 files merged, 0 files removed, 0 files unresolved
diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -300,6 +300,8 @@  merge tests
   picked tool ':merge' for t (binary False symlink False)
   merging t
   my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
+  picked tool ':merge' for t (binary False symlink False)
+  my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
   warning: conflicts during merge.
   merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
diff --git a/tests/test-up-local-change.t b/tests/test-up-local-change.t
--- a/tests/test-up-local-change.t
+++ b/tests/test-up-local-change.t
@@ -53,7 +53,9 @@ 
   picked tool 'true' for a (binary False symlink False)
   merging a
   my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
-  launching merge tool: true *$TESTTMP/r2/a* * (glob)
+  picked tool 'true' for a (binary False symlink False)
+  my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
+  launching merge tool: true *$TESTTMP/r2/a* * * (glob)
   merge tool returned: 0
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
   $ hg parents
@@ -74,7 +76,9 @@ 
   picked tool 'true' for a (binary False symlink False)
   merging a
   my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
-  launching merge tool: true *$TESTTMP/r2/a* * (glob)
+  picked tool 'true' for a (binary False symlink False)
+  my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
+  launching merge tool: true *$TESTTMP/r2/a* * * (glob)
   merge tool returned: 0
   0 files updated, 1 files merged, 1 files removed, 0 files unresolved
   $ hg parents
@@ -103,7 +107,9 @@ 
   picked tool 'true' for a (binary False symlink False)
   merging a
   my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
-  launching merge tool: true *$TESTTMP/r2/a* * (glob)
+  picked tool 'true' for a (binary False symlink False)
+  my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
+  launching merge tool: true *$TESTTMP/r2/a* * * (glob)
   merge tool returned: 0
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
   $ hg parents