tests/test-convert-bzr-114.t
author Pulkit Goyal <7895pulkit@gmail.com>
Thu, 09 Apr 2020 16:06:03 +0530
changeset 44687 1b8fd4af3318
parent 26066 89872688893f
child 47377 26127236b229
permissions -rw-r--r--
mergestate: store about files resolved in favour of other Committing a merge sometimes wrongly creates a new filenode where it can re-use an existing one. This happens because the commit code does it's own calculation and does not know what happened on merge. This starts storing information in mergestate about files which were automatically merged and the other/remote version of file was used. We need this information at commit to pick the filenode parent for the new commit. This issue was found by Pierre-Yves David and idea to store the relevant parts in mergestate is also suggested by him. Somethings which can be further investigated are: 1) refactoring of commit logic more to depend on this information 2) maybe a more generic solution? Differential Revision: https://phab.mercurial-scm.org/D8392

#require bzr bzr114

  $ . "$TESTDIR/bzr-definitions"

The file/directory replacement can only be reproduced on
bzr >= 1.4. Merge it back in test-convert-bzr-directories once
this version becomes mainstream.
replace file with dir

  $ mkdir test-replace-file-with-dir
  $ cd test-replace-file-with-dir
  $ bzr init -q source
  $ cd source
  $ echo d > d
  $ bzr add -q d
  $ bzr commit -q -m 'add d file'
  $ rm d
  $ mkdir d
  $ bzr add -q d
  $ bzr commit -q -m 'replace with d dir'
  $ echo a > d/a
  $ bzr add -q d/a
  $ bzr commit -q -m 'add d/a'
  $ cd ..
  $ hg convert source source-hg
  initializing destination source-hg repository
  scanning source...
  sorting...
  converting...
  2 add d file
  1 replace with d dir
  0 add d/a
  $ manifest source-hg tip
  % manifest of tip
  644   d/a
  $ cd source-hg
  $ hg update
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cd ../..