[PATCH 3 of 3] subrepo: tests for diff/status -S of added/removed subrepo (issue3056)
Dov Feldstern
dovdevel at gmail.com
Wed May 16 16:47:00 CDT 2012
# HG changeset patch
# User Dov Feldstern <dfeldstern at gmail.com>
# Date 1337203165 -10800
# Branch stable
# Node ID ead1f33de92c510cb2ff701fca6c767cd9a52842
# Parent f9ecaf272cea4082584ba2ee6e8aced44a814b32
subrepo: tests for diff/status -S of added/removed subrepo (issue3056)
When comparing two revisions, one of which includes a given subrepo
which doesn't exist in the other, diff and status (-S) should show the
contents of that subrepo as part of the added/removed files. This
changeset provides tests for the correct behavior.
diff -r f9ecaf272cea -r ead1f33de92c tests/test-subrepo.t
--- a/tests/test-subrepo.t Thu May 17 00:19:20 2012 +0300
+++ b/tests/test-subrepo.t Thu May 17 00:19:25 2012 +0300
@@ -1042,3 +1042,64 @@
$ hg st -S
? s/f19
$ rm s/f19
+
+Issue3056: diff/status -S should also include contents of added or
+removed subrepos.
+
+ $ hg init repo
+ $ cd repo
+ $ echo file > file
+ $ hg add file
+ $ hg commit -m0
+ $ hg init sub
+ $ echo subfile > sub/subfile
+ $ hg -R sub add sub/subfile
+ $ echo sub = sub > .hgsub
+ $ hg add .hgsub
+ $ hg commit -S -m1
+ committing subrepository sub
+
+ $ hg diff --nodates -S -r0:1
+ diff -r 6bafe29c6137 -r 50662f194e8f .hgsub
+ --- /dev/null
+ +++ b/.hgsub
+ @@ -0,0 +1,1 @@
+ +sub = sub
+ diff -r 6bafe29c6137 -r 50662f194e8f .hgsubstate
+ --- /dev/null
+ +++ b/.hgsubstate
+ @@ -0,0 +1,1 @@
+ +8abf66896adf956cc6e7e4e66659857a4ac16315 sub
+ diff -r 000000000000 -r 8abf66896adf sub/subfile
+ --- /dev/null
+ +++ b/sub/subfile
+ @@ -0,0 +1,1 @@
+ +subfile
+
+ $ hg status -S --rev 0 --rev 1
+ A .hgsub
+ A .hgsubstate
+ A sub/subfile
+
+ $ hg diff --nodates -S -r1:0
+ diff -r 50662f194e8f -r 6bafe29c6137 .hgsub
+ --- a/.hgsub
+ +++ /dev/null
+ @@ -1,1 +0,0 @@
+ -sub = sub
+ diff -r 50662f194e8f -r 6bafe29c6137 .hgsubstate
+ --- a/.hgsubstate
+ +++ /dev/null
+ @@ -1,1 +0,0 @@
+ -8abf66896adf956cc6e7e4e66659857a4ac16315 sub
+ diff -r 8abf66896adf -r 000000000000 sub/subfile
+ --- a/sub/subfile
+ +++ /dev/null
+ @@ -1,1 +0,0 @@
+ -subfile
+
+ $ hg status -S --rev 1 --rev 0
+ R .hgsub
+ R .hgsubstate
+ R sub/subfile
+
More information about the Mercurial-devel
mailing list