--- a/tests/test-automv.t Fri Feb 19 22:28:09 2016 +0100
+++ b/tests/test-automv.t Tue Feb 16 15:58:32 2016 +0000
@@ -13,7 +13,7 @@
Test automv command for commit
- $ echo 'foo' > a.txt
+ $ printf 'foo\nbar\nbaz\n' > a.txt
$ hg add a.txt
$ hg commit -m 'init repo with a'
@@ -37,6 +37,24 @@
$ mv a.txt b.txt
$ hg rm a.txt
$ hg add b.txt
+ $ printf '\n' >> b.txt
+ $ hg status -C
+ A b.txt
+ R a.txt
+ $ hg commit -m 'msg'
+ detected move of 1 files
+ created new head
+ $ hg status --change . -C
+ A b.txt
+ a.txt
+ R a.txt
+ $ hg up -r 0
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+mv/rm/add/modif
+ $ mv a.txt b.txt
+ $ hg rm a.txt
+ $ hg add b.txt
$ printf '\nfoo\n' >> b.txt
$ hg status -C
A b.txt
@@ -161,6 +179,29 @@
$ mv a.txt b.txt
$ hg rm a.txt
$ hg add b.txt
+ $ printf '\n' >> b.txt
+ $ hg status -C
+ A b.txt
+ R a.txt
+ $ hg commit --amend -m 'amended'
+ detected move of 1 files
+ saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
+ $ hg status --change . -C
+ A b.txt
+ a.txt
+ A c.txt
+ R a.txt
+ $ hg up -r 0
+ 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+mv/rm/add/modif
+ $ echo 'c' > c.txt
+ $ hg add c.txt
+ $ hg commit -m 'revision to amend to'
+ created new head
+ $ mv a.txt b.txt
+ $ hg rm a.txt
+ $ hg add b.txt
$ printf '\nfoo\n' >> b.txt
$ hg status -C
A b.txt
@@ -285,3 +326,13 @@
$ hg status --change . -C
A b.txt
R a.txt
+
+error conditions
+
+ $ cat >> $HGRCPATH << EOF
+ > [automv]
+ > similarity=110
+ > EOF
+ $ hg commit -m 'revision to amend to'
+ abort: automv.similarity must be between 0 and 100
+ [255]