diff tests/test-rebase-collapse.t @ 16551:ebf6d38c9063 stable

localrepo: add setparents() to adjust dirstate copies (issue3407) The fix introduced in eab9119c5dee was only partially successful. It is correct to turn dirstate 'm' merge records into normal/dirty ones but copy records are lost in the process. To adjust them as well, we need to look in the first parent manifest to know which files were added and preserve only related records. But the dirstate does not have access to changesets, the logic has to moved at another level, in localrepo.
author Patrick Mezard <patrick@mezard.eu>
date Sun, 29 Apr 2012 22:25:55 +0200
parents 4f795f5fbb0b
children d1afbf03e69a
line wrap: on
line diff
--- a/tests/test-rebase-collapse.t	Sun Apr 29 16:18:46 2012 +0200
+++ b/tests/test-rebase-collapse.t	Sun Apr 29 22:25:55 2012 +0200
@@ -541,3 +541,52 @@
   @@ -0,0 +1,2 @@
   +d
   +blah
+
+  $ cd ..
+
+Rebase, collapse and copies
+
+  $ hg init copies
+  $ cd copies
+  $ hg unbundle "$TESTDIR/bundles/renames.hg"
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 11 changes to 7 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg up -q tip
+  $ hg tglog
+  @  3: 'move2'
+  |
+  o  2: 'move1'
+  |
+  | o  1: 'change'
+  |/
+  o  0: 'add'
+  
+  $ hg rebase --collapse -d 1
+  merging a and d to d
+  merging b and e to e
+  merging c and f to f
+  merging e and g to g
+  merging f and c to c
+  saved backup bundle to $TESTTMP/copies/.hg/strip-backup/*-backup.hg (glob)
+  $ hg st
+  $ hg st --copies --change .
+  A d
+    a
+  A g
+    b
+  R b
+  $ cat c
+  c
+  c
+  $ cat d
+  a
+  a
+  $ cat g
+  b
+  b
+  $ hg log -r . --template "{file_copies}\n"
+  d (a)g (b)
+  $ cd ..