diff tests/test-commit-amend.t @ 16553:9224cc2e99cc stable

amend: fix copy records handling (issue3410) Messing with the dirstate before the intermediate commit seems error prone. Instead, commit and recompute the copies with copies.pathcopies(), then use that with commitctx(). Since copies.pathcopies() does not support file replacement very well, the whole .renamed() condition in samefile() is removed and the "file replacement caused by differing copy source" effect is discarded. Test shamelessly stolen from Idan Kamara <idankk86@gmail.com>
author Patrick Mezard <patrick@mezard.eu>
date Mon, 30 Apr 2012 20:45:45 +0200
parents 90ca344a7c55
children f30226b1a46a
line wrap: on
line diff
--- a/tests/test-commit-amend.t	Mon Apr 30 20:36:29 2012 +0200
+++ b/tests/test-commit-amend.t	Mon Apr 30 20:45:45 2012 +0200
@@ -293,11 +293,23 @@
   $ hg cp a f
   $ mv f.orig f
   $ hg ci --amend -m replacef
-  saved backup bundle to $TESTTMP/.hg/strip-backup/0ce2c92dc50d-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/20a7413547f9-amend-backup.hg
   $ hg st --change . --copies
-  M f
   $ hg log -r . --template "{file_copies}\n"
-  f (a)
+  
+
+Move added file (issue3410):
+
+  $ echo g >> g
+  $ hg ci -Am g
+  adding g
+  $ hg mv g h
+  $ hg ci --amend
+  saved backup bundle to $TESTTMP/.hg/strip-backup/5daa77a5d616-amend-backup.hg
+  $ hg st --change . --copies h
+  A h
+  $ hg log -r . --template "{file_copies}\n"
+  
 
 Can't rollback an amend: