convert: test clean p2 file missing

bfc58bf915b4 introduced "clever" reuse of p2 but did that convert could fail
with
  abort: f1@f73e02ae52c5: not found in manifest!
when it tried to reuse a file from p2 but the file didn't exist there, for
example because filemap changes.

b5e7ec5dace8 fixed that (using changes from 64a7de6e3aa1), but with a quite
different reasoning and test case.

Add another test that makes sure this case is covered too.
This commit is contained in:
Mads Kiilerich 2015-10-24 01:54:46 +02:00
parent 4258ec762f
commit aa36050c92

View File

@ -740,4 +740,48 @@ test converting merges into a repo that contains other files
- converted/a
- toberemoved
$ cd ..
Test case where cleanp2 contains a file that doesn't exist in p2 - for
example because filemap changed.
$ hg init cleanp2
$ cd cleanp2
$ touch f f1 f2 && hg ci -Aqm '0'
$ echo f1 > f1 && echo >> f && hg ci -m '1'
$ hg up -qr0 && echo f2 > f2 && echo >> f && hg ci -qm '2'
$ echo "include f" > filemap
$ hg convert --filemap filemap .
assuming destination .-hg
initializing destination .-hg repository
scanning source...
sorting...
converting...
2 0
1 1
0 2
$ hg merge && hg ci -qm '3'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ echo "include ." > filemap
$ hg convert --filemap filemap .
assuming destination .-hg
scanning source...
sorting...
converting...
0 3
$ hg -R .-hg log -G -T '{shortest(node)} {desc}\n{files % "- {file}\n"}\n'
o e9ed 3
|\
| o 33a0 2
| | - f
| |
o | f73e 1
|/ - f
|
o d681 0
- f
$ hg -R .-hg mani -r tip
f
$ cd ..