changeset 26844:e24eee55c129

convert: test clean p2 file missing 216fa1ba9993 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. 5ca587348875 fixed that (using changes from a75d24539aba), but with a quite different reasoning and test case. Add another test that makes sure this case is covered too.
author Mads Kiilerich <madski@unity3d.com>
date Sat, 24 Oct 2015 01:54:46 +0200
parents f580c78ea667
children 7a77ee434179
files tests/test-convert-filemap.t
diffstat 1 files changed, 44 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-convert-filemap.t	Mon Nov 02 11:56:59 2015 +0000
+++ b/tests/test-convert-filemap.t	Sat Oct 24 01:54:46 2015 +0200
@@ -740,4 +740,48 @@
      - 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 ..