view tests/test-merge-force.t @ 49777:e1953a34c110

bundle: emit full snapshot as is, without doing a redelta With the new `forced` delta-reused policy, it become important to be able to send full snapshot where full snapshot are needed. Otherwise, the fallback delta will simply be used on the client sideā€¦ creating monstrous delta chain, since revision that are meant as a reset of delta-chain chain becoming too complex are simply adding a new full delta-tree on the leaf of another one. In the `non-forced` cases, client process full snapshot from the bundle differently from deltas, so client will still try to convert the full snapshot into a delta if possible. So this will no lead to pathological storage explosion. I have considered making this configurable, but the impact seems limited enough that it does not seems to be worth it. Especially with the current sparse-revlog format that use "delta-tree" with multiple level snapshots, full snapshot are much less frequent and not that different from other intermediate snapshot that we are already sending over the wire anyway. CPU wise, this will help the bundling side a little as it will not need to reconstruct revisions and compute deltas. The unbundling side might save a tiny amount of CPU as it won't need to reconstruct the delta-base to reconstruct the revision full text. This only slightly visible in some of the benchmarks. And have no real impact on most of them. ### data-env-vars.name = pypy-2018-08-01-zstd-sparse-revlog # benchmark.name = perf-bundle # benchmark.variants.revs = last-40000 before: 11.467186 seconds just-emit-full: 11.190576 seconds (-2.41%) with-pull-force: 11.041091 seconds (-3.72%) # benchmark.name = perf-unbundle # benchmark.variants.revs = last-40000 before: 16.744862 just-emit-full:: 16.561036 seconds (-1.10%) with-pull-force: 16.389344 seconds (-2.12%) # benchmark.name = pull # benchmark.variants.revs = last-40000 before: 26.870569 just-emit-full: 26.391188 seconds (-1.78%) with-pull-force: 25.633184 seconds (-4.60%) Space wise (so network-wise) the impact is fairly small. When taking compression into account. Below are tests the size of `hg bundle --all` for a handful of benchmark repositories (with bzip, zstd compression and without it) This show a small increase in the bundle size, but nothing really significant except maybe for mozilla-try (+12%) that nobody really pulls large chunk of anyway. Mozilla-try is also the repository that benefit the most for not having to recompute deltas client size. ### mercurial: bzip-before: 26 406 342 bytes bzip-after: 26 691 543 bytes +1.08% zstd-before: 27 918 645 bytes zstd-after: 28 075 896 bytes +0.56% none-before: 98 675 601 bytes none-after: 100 411 237 bytes +1.76% ### pypy bzip-before: 201 295 752 bytes bzip-after: 209 780 282 bytes +4.21% zstd-before: 202 974 795 bytes zstd-after: 205 165 780 bytes +1.08% none-before: 871 070 261 bytes none-after: 993 595 057 bytes +14.07% ### netbeans bzip-before: 601 314 330 bytes bzip-after: 614 246 241 bytes +2.15% zstd-before: 604 745 136 bytes zstd-after: 615 497 705 bytes +1.78% none-before: 3 338 238 571 bytes none-after: 3 439 422 535 bytes +3.03% ### mozilla-central bzip-before: 1 493 006 921 bytes bzip-after: 1 549 650 570 bytes +3.79% zstd-before: 1 481 910 102 bytes zstd-after: 1 513 052 415 bytes +2.10% none-before: 6 535 929 910 bytes none-after: 7 010 191 342 bytes +7.26% ### mozilla-try bzip-before: 6 583 425 999 bytes bzip-after: 7 423 536 928 bytes +12.76% zstd-before: 6 021 009 212 bytes zstd-after: 6 674 922 420 bytes +10.86% none-before: 22 954 739 558 bytes none-after: 26 013 854 771 bytes +13.32%
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 07 Dec 2022 20:12:23 +0100
parents a51c522c0064
children
line wrap: on
line source

Set up a base, local, and remote changeset, as well as the working copy state.
Files names are of the form base_remote_local_working-copy. For example,
content1_content2_content1_content2-untracked represents a
file that was modified in the remote changeset, left untouched in the
local changeset, and then modified in the working copy to match the
remote content, then finally forgotten.

  $ hg init repo
  $ cd repo

Create base changeset

  $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 3 1
  $ hg addremove -q --similarity 0
  $ hg commit -qm 'base'

Create remote changeset

  $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 3 2
  $ hg addremove -q --similarity 0
  $ hg commit -qm 'remote'

Create local changeset

  $ hg update -q 0
  $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 3 3
  $ hg addremove -q --similarity 0
  $ hg commit -qm 'local'

Set up working directory

  $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 3 wc
  $ hg addremove -q --similarity 0
  $ hg forget *_*_*_*-untracked
  $ rm *_*_*_missing-*

  $ hg status -A
  M content1_content1_content1_content4-tracked
  M content1_content1_content3_content1-tracked
  M content1_content1_content3_content4-tracked
  M content1_content2_content1_content2-tracked
  M content1_content2_content1_content4-tracked
  M content1_content2_content2_content1-tracked
  M content1_content2_content2_content4-tracked
  M content1_content2_content3_content1-tracked
  M content1_content2_content3_content2-tracked
  M content1_content2_content3_content4-tracked
  M content1_missing_content1_content4-tracked
  M content1_missing_content3_content1-tracked
  M content1_missing_content3_content4-tracked
  M missing_content2_content2_content4-tracked
  M missing_content2_content3_content2-tracked
  M missing_content2_content3_content4-tracked
  M missing_missing_content3_content4-tracked
  A content1_content1_missing_content1-tracked
  A content1_content1_missing_content4-tracked
  A content1_content2_missing_content1-tracked
  A content1_content2_missing_content2-tracked
  A content1_content2_missing_content4-tracked
  A content1_missing_missing_content1-tracked
  A content1_missing_missing_content4-tracked
  A missing_content2_missing_content2-tracked
  A missing_content2_missing_content4-tracked
  A missing_missing_missing_content4-tracked
  R content1_content1_content1_content1-untracked
  R content1_content1_content1_content4-untracked
  R content1_content1_content1_missing-untracked
  R content1_content1_content3_content1-untracked
  R content1_content1_content3_content3-untracked
  R content1_content1_content3_content4-untracked
  R content1_content1_content3_missing-untracked
  R content1_content2_content1_content1-untracked
  R content1_content2_content1_content2-untracked
  R content1_content2_content1_content4-untracked
  R content1_content2_content1_missing-untracked
  R content1_content2_content2_content1-untracked
  R content1_content2_content2_content2-untracked
  R content1_content2_content2_content4-untracked
  R content1_content2_content2_missing-untracked
  R content1_content2_content3_content1-untracked
  R content1_content2_content3_content2-untracked
  R content1_content2_content3_content3-untracked
  R content1_content2_content3_content4-untracked
  R content1_content2_content3_missing-untracked
  R content1_missing_content1_content1-untracked
  R content1_missing_content1_content4-untracked
  R content1_missing_content1_missing-untracked
  R content1_missing_content3_content1-untracked
  R content1_missing_content3_content3-untracked
  R content1_missing_content3_content4-untracked
  R content1_missing_content3_missing-untracked
  R missing_content2_content2_content2-untracked
  R missing_content2_content2_content4-untracked
  R missing_content2_content2_missing-untracked
  R missing_content2_content3_content2-untracked
  R missing_content2_content3_content3-untracked
  R missing_content2_content3_content4-untracked
  R missing_content2_content3_missing-untracked
  R missing_missing_content3_content3-untracked
  R missing_missing_content3_content4-untracked
  R missing_missing_content3_missing-untracked
  ! content1_content1_content1_missing-tracked
  ! content1_content1_content3_missing-tracked
  ! content1_content1_missing_missing-tracked
  ! content1_content2_content1_missing-tracked
  ! content1_content2_content2_missing-tracked
  ! content1_content2_content3_missing-tracked
  ! content1_content2_missing_missing-tracked
  ! content1_missing_content1_missing-tracked
  ! content1_missing_content3_missing-tracked
  ! content1_missing_missing_missing-tracked
  ! missing_content2_content2_missing-tracked
  ! missing_content2_content3_missing-tracked
  ! missing_content2_missing_missing-tracked
  ! missing_missing_content3_missing-tracked
  ! missing_missing_missing_missing-tracked
  ? content1_content1_missing_content1-untracked
  ? content1_content1_missing_content4-untracked
  ? content1_content2_missing_content1-untracked
  ? content1_content2_missing_content2-untracked
  ? content1_content2_missing_content4-untracked
  ? content1_missing_missing_content1-untracked
  ? content1_missing_missing_content4-untracked
  ? missing_content2_missing_content2-untracked
  ? missing_content2_missing_content4-untracked
  ? missing_missing_missing_content4-untracked
  C content1_content1_content1_content1-tracked
  C content1_content1_content3_content3-tracked
  C content1_content2_content1_content1-tracked
  C content1_content2_content2_content2-tracked
  C content1_content2_content3_content3-tracked
  C content1_missing_content1_content1-tracked
  C content1_missing_content3_content3-tracked
  C missing_content2_content2_content2-tracked
  C missing_content2_content3_content3-tracked
  C missing_missing_content3_content3-tracked

Merge with remote

# Notes:
# - local and remote changed content1_content2_*_content2-untracked
#   in the same way, so it could potentially be left alone

  $ hg merge -f --tool internal:merge3 'desc("remote")' 2>&1 | tee $TESTTMP/merge-output-1
  file 'content1_missing_content1_content4-tracked' was deleted in other [merge rev] but was modified in local [working copy].
  You can use (c)hanged version, (d)elete, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_missing_content3_content3-tracked' was deleted in other [merge rev] but was modified in local [working copy].
  You can use (c)hanged version, (d)elete, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_missing_content3_content4-tracked' was deleted in other [merge rev] but was modified in local [working copy].
  You can use (c)hanged version, (d)elete, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_missing_missing_content4-tracked' was deleted in other [merge rev] but was modified in local [working copy].
  You can use (c)hanged version, (d)elete, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content1_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content1_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content1_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content1_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content1_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content2_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content2_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content2_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content2_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content2_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content3_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content3_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content3_content3-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content3_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content3_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content3_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_missing_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_missing_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_missing_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_missing_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_missing_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  merging content1_content2_content1_content4-tracked
  warning: conflicts while merging content1_content2_content1_content4-tracked! (edit, then use 'hg resolve --mark')
  merging content1_content2_content2_content1-tracked
  merging content1_content2_content2_content4-tracked
  warning: conflicts while merging content1_content2_content2_content4-tracked! (edit, then use 'hg resolve --mark')
  merging content1_content2_content3_content1-tracked
  merging content1_content2_content3_content3-tracked
  warning: conflicts while merging content1_content2_content3_content3-tracked! (edit, then use 'hg resolve --mark')
  merging content1_content2_content3_content4-tracked
  warning: conflicts while merging content1_content2_content3_content4-tracked! (edit, then use 'hg resolve --mark')
  merging content1_content2_missing_content1-tracked
  merging content1_content2_missing_content4-tracked
  warning: conflicts while merging content1_content2_missing_content4-tracked! (edit, then use 'hg resolve --mark')
  merging missing_content2_content2_content4-tracked
  warning: conflicts while merging missing_content2_content2_content4-tracked! (edit, then use 'hg resolve --mark')
  merging missing_content2_content3_content3-tracked
  warning: conflicts while merging missing_content2_content3_content3-tracked! (edit, then use 'hg resolve --mark')
  merging missing_content2_content3_content4-tracked
  warning: conflicts while merging missing_content2_content3_content4-tracked! (edit, then use 'hg resolve --mark')
  merging missing_content2_missing_content4-tracked
  warning: conflicts while merging missing_content2_missing_content4-tracked! (edit, then use 'hg resolve --mark')
  merging missing_content2_missing_content4-untracked
  warning: conflicts while merging missing_content2_missing_content4-untracked! (edit, then use 'hg resolve --mark')
  18 files updated, 3 files merged, 8 files removed, 35 files unresolved
  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon

Check which files need to be resolved (should correspond to the output above).
This should be the files for which the base (1st filename segment), the remote
(2nd segment) and the working copy (4th segment) are all different.

Interestingly, one untracked file got merged and added, which corresponds to the
odd 'if force and branchmerge and different' case in manifestmerge().

  $ hg resolve -l
  U content1_content2_content1_content1-untracked
  U content1_content2_content1_content2-untracked
  U content1_content2_content1_content4-tracked
  U content1_content2_content1_content4-untracked
  U content1_content2_content1_missing-tracked
  U content1_content2_content1_missing-untracked
  R content1_content2_content2_content1-tracked
  U content1_content2_content2_content1-untracked
  U content1_content2_content2_content2-untracked
  U content1_content2_content2_content4-tracked
  U content1_content2_content2_content4-untracked
  U content1_content2_content2_missing-tracked
  U content1_content2_content2_missing-untracked
  R content1_content2_content3_content1-tracked
  U content1_content2_content3_content1-untracked
  U content1_content2_content3_content2-untracked
  U content1_content2_content3_content3-tracked
  U content1_content2_content3_content3-untracked
  U content1_content2_content3_content4-tracked
  U content1_content2_content3_content4-untracked
  U content1_content2_content3_missing-tracked
  U content1_content2_content3_missing-untracked
  R content1_content2_missing_content1-tracked
  U content1_content2_missing_content1-untracked
  U content1_content2_missing_content2-untracked
  U content1_content2_missing_content4-tracked
  U content1_content2_missing_content4-untracked
  U content1_content2_missing_missing-tracked
  U content1_content2_missing_missing-untracked
  U content1_missing_content1_content4-tracked
  U content1_missing_content3_content3-tracked
  U content1_missing_content3_content4-tracked
  U content1_missing_missing_content4-tracked
  U missing_content2_content2_content4-tracked
  U missing_content2_content3_content3-tracked
  U missing_content2_content3_content4-tracked
  U missing_content2_missing_content4-tracked
  U missing_content2_missing_content4-untracked

Check status and file content

Some files get added (e.g. content1_content2_content1_content1-untracked)

It is not intuitive that content1_content2_content1_content4-tracked gets
merged while content1_content2_content1_content4-untracked gets overwritten.
Any *_content2_*-untracked triggers the modified/deleted prompt and then gets
overwritten.

A lot of untracked files become tracked, for example
content1_content2_content2_content2-untracked.

*_missing_missing_missing-tracked is reported as removed ('R'), which
doesn't make sense since the file did not exist in the parent, but on the
other hand, merged-in additions are reported as modifications, which is
almost as strange.

missing_missing_content3_missing-tracked becomes removed ('R'), even though
the remote side did not touch the file

  $ checkstatus() {
  >   for f in `"$PYTHON" $TESTDIR/generate-working-copy-states.py filelist 3`
  >   do
  >     echo
  >     hg status -A $f
  >     if test -f $f
  >     then
  >       cat $f
  >     else
  >       echo '<missing>'
  >     fi
  >   done
  > }
  $ checkstatus 2>&1 | tee $TESTTMP/status1
  
  C content1_content1_content1_content1-tracked
  content1
  
  R content1_content1_content1_content1-untracked
  content1
  
  M content1_content1_content1_content4-tracked
  content4
  
  R content1_content1_content1_content4-untracked
  content4
  
  ! content1_content1_content1_missing-tracked
  <missing>
  
  R content1_content1_content1_missing-untracked
  <missing>
  
  M content1_content1_content3_content1-tracked
  content1
  
  R content1_content1_content3_content1-untracked
  content1
  
  C content1_content1_content3_content3-tracked
  content3
  
  R content1_content1_content3_content3-untracked
  content3
  
  M content1_content1_content3_content4-tracked
  content4
  
  R content1_content1_content3_content4-untracked
  content4
  
  ! content1_content1_content3_missing-tracked
  <missing>
  
  R content1_content1_content3_missing-untracked
  <missing>
  
  A content1_content1_missing_content1-tracked
  content1
  
  ? content1_content1_missing_content1-untracked
  content1
  
  A content1_content1_missing_content4-tracked
  content4
  
  ? content1_content1_missing_content4-untracked
  content4
  
  ! content1_content1_missing_missing-tracked
  <missing>
  
  content1_content1_missing_missing-untracked: * (glob)
  <missing>
  
  M content1_content2_content1_content1-tracked
  content2
  
  M content1_content2_content1_content1-untracked
  content2
  
  M content1_content2_content1_content2-tracked
  content2
  
  M content1_content2_content1_content2-untracked
  content2
  
  M content1_content2_content1_content4-tracked
  <<<<<<< working copy:    0447570f1af6 - test: local
  content4
  ||||||| common ancestor: 8ef80617fa20 - test: base
  content1
  =======
  content2
  >>>>>>> merge rev:       85100b8c675b - test: remote
  
  M content1_content2_content1_content4-untracked
  content2
  
  M content1_content2_content1_missing-tracked
  content2
  
  M content1_content2_content1_missing-untracked
  content2
  
  M content1_content2_content2_content1-tracked
  content2
  
  M content1_content2_content2_content1-untracked
  content2
  
  C content1_content2_content2_content2-tracked
  content2
  
  M content1_content2_content2_content2-untracked
  content2
  
  M content1_content2_content2_content4-tracked
  <<<<<<< working copy:    0447570f1af6 - test: local
  content4
  ||||||| common ancestor: 8ef80617fa20 - test: base
  content1
  =======
  content2
  >>>>>>> merge rev:       85100b8c675b - test: remote
  
  M content1_content2_content2_content4-untracked
  content2
  
  M content1_content2_content2_missing-tracked
  content2
  
  M content1_content2_content2_missing-untracked
  content2
  
  M content1_content2_content3_content1-tracked
  content2
  
  M content1_content2_content3_content1-untracked
  content2
  
  M content1_content2_content3_content2-tracked
  content2
  
  M content1_content2_content3_content2-untracked
  content2
  
  M content1_content2_content3_content3-tracked
  <<<<<<< working copy:    0447570f1af6 - test: local
  content3
  ||||||| common ancestor: 8ef80617fa20 - test: base
  content1
  =======
  content2
  >>>>>>> merge rev:       85100b8c675b - test: remote
  
  M content1_content2_content3_content3-untracked
  content2
  
  M content1_content2_content3_content4-tracked
  <<<<<<< working copy:    0447570f1af6 - test: local
  content4
  ||||||| common ancestor: 8ef80617fa20 - test: base
  content1
  =======
  content2
  >>>>>>> merge rev:       85100b8c675b - test: remote
  
  M content1_content2_content3_content4-untracked
  content2
  
  M content1_content2_content3_missing-tracked
  content2
  
  M content1_content2_content3_missing-untracked
  content2
  
  M content1_content2_missing_content1-tracked
  content2
  
  M content1_content2_missing_content1-untracked
  content2
  
  M content1_content2_missing_content2-tracked
  content2
  
  M content1_content2_missing_content2-untracked
  content2
  
  M content1_content2_missing_content4-tracked
  <<<<<<< working copy:    0447570f1af6 - test: local
  content4
  ||||||| common ancestor: 8ef80617fa20 - test: base
  content1
  =======
  content2
  >>>>>>> merge rev:       85100b8c675b - test: remote
  
  M content1_content2_missing_content4-untracked
  content2
  
  M content1_content2_missing_missing-tracked
  content2
  
  M content1_content2_missing_missing-untracked
  content2
  
  R content1_missing_content1_content1-tracked
  <missing>
  
  R content1_missing_content1_content1-untracked
  content1
  
  M content1_missing_content1_content4-tracked
  content4
  
  R content1_missing_content1_content4-untracked
  content4
  
  R content1_missing_content1_missing-tracked
  <missing>
  
  R content1_missing_content1_missing-untracked
  <missing>
  
  R content1_missing_content3_content1-tracked
  <missing>
  
  R content1_missing_content3_content1-untracked
  content1
  
  C content1_missing_content3_content3-tracked
  content3
  
  R content1_missing_content3_content3-untracked
  content3
  
  M content1_missing_content3_content4-tracked
  content4
  
  R content1_missing_content3_content4-untracked
  content4
  
  R content1_missing_content3_missing-tracked
  <missing>
  
  R content1_missing_content3_missing-untracked
  <missing>
  
  R content1_missing_missing_content1-tracked
  <missing>
  
  ? content1_missing_missing_content1-untracked
  content1
  
  A content1_missing_missing_content4-tracked
  content4
  
  ? content1_missing_missing_content4-untracked
  content4
  
  R content1_missing_missing_missing-tracked
  <missing>
  
  content1_missing_missing_missing-untracked: * (glob)
  <missing>
  
  C missing_content2_content2_content2-tracked
  content2
  
  M missing_content2_content2_content2-untracked
  content2
  
  M missing_content2_content2_content4-tracked
  <<<<<<< working copy:    0447570f1af6 - test: local
  content4
  ||||||| common ancestor: 000000000000 - : 
  =======
  content2
  >>>>>>> merge rev:       85100b8c675b - test: remote
  
  M missing_content2_content2_content4-untracked
  content2
  
  M missing_content2_content2_missing-tracked
  content2
  
  M missing_content2_content2_missing-untracked
  content2
  
  M missing_content2_content3_content2-tracked
  content2
  
  M missing_content2_content3_content2-untracked
  content2
  
  M missing_content2_content3_content3-tracked
  <<<<<<< working copy:    0447570f1af6 - test: local
  content3
  ||||||| common ancestor: 000000000000 - : 
  =======
  content2
  >>>>>>> merge rev:       85100b8c675b - test: remote
  
  M missing_content2_content3_content3-untracked
  content2
  
  M missing_content2_content3_content4-tracked
  <<<<<<< working copy:    0447570f1af6 - test: local
  content4
  ||||||| common ancestor: 000000000000 - : 
  =======
  content2
  >>>>>>> merge rev:       85100b8c675b - test: remote
  
  M missing_content2_content3_content4-untracked
  content2
  
  M missing_content2_content3_missing-tracked
  content2
  
  M missing_content2_content3_missing-untracked
  content2
  
  M missing_content2_missing_content2-tracked
  content2
  
  M missing_content2_missing_content2-untracked
  content2
  
  M missing_content2_missing_content4-tracked
  <<<<<<< working copy:    0447570f1af6 - test: local
  content4
  ||||||| common ancestor: 000000000000 - : 
  =======
  content2
  >>>>>>> merge rev:       85100b8c675b - test: remote
  
  M missing_content2_missing_content4-untracked
  <<<<<<< working copy:    0447570f1af6 - test: local
  content4
  ||||||| common ancestor: 000000000000 - : 
  =======
  content2
  >>>>>>> merge rev:       85100b8c675b - test: remote
  
  M missing_content2_missing_missing-tracked
  content2
  
  M missing_content2_missing_missing-untracked
  content2
  
  C missing_missing_content3_content3-tracked
  content3
  
  R missing_missing_content3_content3-untracked
  content3
  
  M missing_missing_content3_content4-tracked
  content4
  
  R missing_missing_content3_content4-untracked
  content4
  
  R missing_missing_content3_missing-tracked
  <missing>
  
  R missing_missing_content3_missing-untracked
  <missing>
  
  A missing_missing_missing_content4-tracked
  content4
  
  ? missing_missing_missing_content4-untracked
  content4
  
  R missing_missing_missing_missing-tracked
  <missing>
  
  missing_missing_missing_missing-untracked: * (glob)
  <missing>

  $ for f in `"$PYTHON" $TESTDIR/generate-working-copy-states.py filelist 3`
  > do
  >   if test -f ${f}.orig
  >   then
  >     echo ${f}.orig:
  >     cat ${f}.orig
  >   fi
  > done
  content1_content2_content1_content4-tracked.orig:
  content4
  content1_content2_content2_content4-tracked.orig:
  content4
  content1_content2_content3_content3-tracked.orig:
  content3
  content1_content2_content3_content4-tracked.orig:
  content4
  content1_content2_missing_content4-tracked.orig:
  content4
  missing_content2_content2_content4-tracked.orig:
  content4
  missing_content2_content3_content3-tracked.orig:
  content3
  missing_content2_content3_content4-tracked.orig:
  content4
  missing_content2_missing_content4-tracked.orig:
  content4
  missing_content2_missing_content4-untracked.orig:
  content4

Re-resolve and check status

  $ hg resolve --unmark --all
  $ hg resolve --all --tool :local
  (no more unresolved files)
  $ hg resolve --unmark --all
  $ hg resolve --all --tool internal:merge3
  file 'content1_content2_content1_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content1_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  merging content1_content2_content1_content4-tracked
  warning: conflicts while merging content1_content2_content1_content4-tracked! (edit, then use 'hg resolve --mark')
  file 'content1_content2_content1_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content1_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content1_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  merging content1_content2_content2_content1-tracked
  file 'content1_content2_content2_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content2_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  merging content1_content2_content2_content4-tracked
  warning: conflicts while merging content1_content2_content2_content4-tracked! (edit, then use 'hg resolve --mark')
  file 'content1_content2_content2_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content2_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content2_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  merging content1_content2_content3_content1-tracked
  file 'content1_content2_content3_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content3_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  merging content1_content2_content3_content3-tracked
  warning: conflicts while merging content1_content2_content3_content3-tracked! (edit, then use 'hg resolve --mark')
  file 'content1_content2_content3_content3-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  merging content1_content2_content3_content4-tracked
  warning: conflicts while merging content1_content2_content3_content4-tracked! (edit, then use 'hg resolve --mark')
  file 'content1_content2_content3_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content3_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_content3_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  merging content1_content2_missing_content1-tracked
  file 'content1_content2_missing_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_missing_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  merging content1_content2_missing_content4-tracked
  warning: conflicts while merging content1_content2_missing_content4-tracked! (edit, then use 'hg resolve --mark')
  file 'content1_content2_missing_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_missing_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_content2_missing_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_missing_content1_content4-tracked' was deleted in other [merge rev] but was modified in local [working copy].
  You can use (c)hanged version, (d)elete, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_missing_content3_content3-tracked' was deleted in other [merge rev] but was modified in local [working copy].
  You can use (c)hanged version, (d)elete, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_missing_content3_content4-tracked' was deleted in other [merge rev] but was modified in local [working copy].
  You can use (c)hanged version, (d)elete, or leave (u)nresolved.
  What do you want to do? u
  file 'content1_missing_missing_content4-tracked' was deleted in other [merge rev] but was modified in local [working copy].
  You can use (c)hanged version, (d)elete, or leave (u)nresolved.
  What do you want to do? u
  merging missing_content2_content2_content4-tracked
  warning: conflicts while merging missing_content2_content2_content4-tracked! (edit, then use 'hg resolve --mark')
  merging missing_content2_content3_content3-tracked
  warning: conflicts while merging missing_content2_content3_content3-tracked! (edit, then use 'hg resolve --mark')
  merging missing_content2_content3_content4-tracked
  warning: conflicts while merging missing_content2_content3_content4-tracked! (edit, then use 'hg resolve --mark')
  merging missing_content2_missing_content4-tracked
  warning: conflicts while merging missing_content2_missing_content4-tracked! (edit, then use 'hg resolve --mark')
  merging missing_content2_missing_content4-untracked
  warning: conflicts while merging missing_content2_missing_content4-untracked! (edit, then use 'hg resolve --mark')
  [1]
  $ checkstatus > $TESTTMP/status2 2>&1
  $ cmp $TESTTMP/status1 $TESTTMP/status2 || diff -U8 $TESTTMP/status1 $TESTTMP/status2

Set up working directory again

  $ hg -q update --clean 2
  $ hg --config extensions.purge= purge
  $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 3 wc
  $ hg addremove -q --similarity 0
  $ hg forget *_*_*_*-untracked
  $ rm *_*_*_missing-*

Merge with checkunknown = warn, see that behavior is the same as before
  $ hg merge -f --tool internal:merge3 'desc("remote")' --config merge.checkunknown=warn > $TESTTMP/merge-output-2 2>&1
  [1]
  $ cmp $TESTTMP/merge-output-1 $TESTTMP/merge-output-2 || diff -U8 $TESTTMP/merge-output-1 $TESTTMP/merge-output-2