tests: show that merging with sparse is broken when rename is involved
This patch adds test to show that merging with sparse is broken when you have a
rename on one side and just modification on another side.
Differential Revision: https://phab.mercurial-scm.org/D4340
--- a/tests/test-sparse-merges.t Sat Aug 25 22:19:42 2018 +0300
+++ b/tests/test-sparse-merges.t Tue Aug 21 15:09:22 2018 +0300
@@ -119,3 +119,67 @@
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
[1]
+
+ $ cd ..
+
+Testing merging of a file which is renamed+modified on one side and modified on
+another
+
+ $ hg init mvtest
+ $ cd mvtest
+ $ echo "syntax: glob" >> .hgignore
+ $ echo "*.orig" >> .hgignore
+ $ hg ci -Aqm "added .hgignore"
+ $ for ch in a d; do echo foo > $ch; hg ci -Aqm "added "$ch; done;
+ $ cat >> .hg/hgrc <<EOF
+ > [alias]
+ > glog = log -GT "{rev}:{node|short} {desc}"
+ > [extensions]
+ > sparse =
+ > EOF
+
+ $ hg glog
+ @ 2:f29feff37cfc added d
+ |
+ o 1:617125d27d6b added a
+ |
+ o 0:53f3774ed939 added .hgignore
+
+ $ echo babar >> a
+ $ hg ci -m "added babar to a"
+
+ $ hg up '.^'
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg mv a amove
+ $ hg ci -m "moved a to amove"
+ created new head
+
+ $ hg up 3
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ hg glog
+ o 4:5d1e85955f6d moved a to amove
+ |
+ | @ 3:a06e41a6c16c added babar to a
+ |/
+ o 2:f29feff37cfc added d
+ |
+ o 1:617125d27d6b added a
+ |
+ o 0:53f3774ed939 added .hgignore
+
+ $ hg debugsparse --exclude "a"
+ $ ls
+ d
+
+ $ hg merge
+ abort: $ENOENT$: $TESTTMP/mvtest/a
+ [255]
+
+ $ hg up -C 4
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ hg merge
+ merging amove and a to amove
+ abort: cannot add 'a' - it is outside the sparse checkout
+ (include file with `hg debugsparse --include <pattern>` or use `hg add -s <file>` to include file directory while adding)
+ [255]