summaryrefslogtreecommitdiff
path: root/tests/test-subrepo.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-subrepo.t')
-rw-r--r--tests/test-subrepo.t314
1 files changed, 75 insertions, 239 deletions
diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
index bb58c2f..dba8278 100644
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -1,8 +1,6 @@
-Let commit recurse into subrepos by default to match pre-2.0 behavior:
-
- $ echo "[ui]" >> $HGRCPATH
- $ echo "commitsubrepos = Yes" >> $HGRCPATH
-
+ $ rm -rf sub
+ $ mkdir sub
+ $ cd sub
$ hg init t
$ cd t
@@ -34,21 +32,7 @@ Issue2232: committing a subrepo without .hgsub
commit: 1 added, 1 subrepos
update: (current)
$ hg ci -m1
-
-Revert subrepo and test subrepo fileset keyword:
-
- $ echo b > s/a
- $ hg revert "set:subrepo('glob:s*')"
- reverting subrepo s
- reverting s/a (glob)
- $ rm s/a.orig
-
-Revert subrepo with no backup. The "reverting s/a" line is gone since
-we're really running 'hg update' in the subrepo:
-
- $ echo b > s/a
- $ hg revert --no-backup s
- reverting subrepo s
+ committing subrepository s
Issue2022: update -C
@@ -68,14 +52,6 @@ Issue2022: update -C
commit: (clean)
update: (current)
-commands that require a clean repo should respect subrepos
-
- $ echo b >> s/a
- $ hg backout tip
- abort: uncommitted changes in subrepo s
- [255]
- $ hg revert -C -R s s/a
-
add sub sub
$ echo ss = ss > s/.hgsub
@@ -91,7 +67,7 @@ add sub sub
update: (current)
$ hg ci -m2
committing subrepository s
- committing subrepository s/ss (glob)
+ committing subrepository s/ss
$ hg sum
parent: 2:df30734270ae tip
2
@@ -104,24 +80,18 @@ bump sub rev (and check it is ignored by ui.commitsubrepos)
$ echo b > s/a
$ hg -R s ci -ms1
$ hg --config ui.commitsubrepos=no ci -m3
+ committing subrepository s
leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
$ echo c > s/a
$ hg --config ui.commitsubrepos=no ci -m4
abort: uncommitted changes in subrepo s
- (use --subrepos for recursive commit)
[255]
- $ hg id
- f6affe3fbfaa+ tip
- $ hg -R s ci -mc
- $ hg id
- f6affe3fbfaa+ tip
- $ echo d > s/a
$ hg ci -m4
committing subrepository s
$ hg tip -R s
- changeset: 4:02dcf1d70411
+ changeset: 3:1c833a7a9e3a
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
@@ -141,7 +111,7 @@ restore
$ hg debugsub
path s
source s
- revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
+ revision 1c833a7a9e3a4445c711aaf0f012379cd0d4034e
new branch for merge tests
@@ -151,7 +121,7 @@ new branch for merge tests
$ hg init t
$ echo t > t/t
$ hg -R t add t
- adding t/t (glob)
+ adding t/t
5
@@ -203,16 +173,16 @@ merge tests
$ hg merge 6 --debug # test change
searching for copies back to rev 2
resolving manifests
- overwrite: False, partial: False
- ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
+ overwrite None partial False
+ ancestor 1f14a2e2d3ec local f0d2028bf86d+ remote 1831e14459c4
.hgsubstate: versions differ -> m
updating: .hgsubstate 1/1 files (100.00%)
subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
getting subrepo t
resolving manifests
- overwrite: True, partial: False
- ancestor: 60ca1237c194+, local: 60ca1237c194+, remote: 6747d179aa9a
+ overwrite True partial False
+ ancestor 60ca1237c194+ local 60ca1237c194+ remote 6747d179aa9a
t: remote is newer -> g
updating: t 1/1 files (100.00%)
getting t
@@ -231,8 +201,8 @@ merge tests
$ HGMERGE=internal:merge hg merge --debug 7 # test conflict
searching for copies back to rev 2
resolving manifests
- overwrite: False, partial: False
- ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
+ overwrite None partial False
+ ancestor 1831e14459c4 local e45c8b14af55+ remote f94576341bcf
.hgsubstate: versions differ -> m
updating: .hgsubstate 1/1 files (100.00%)
subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
@@ -240,8 +210,8 @@ merge tests
merging subrepo t
searching for copies back to rev 2
resolving manifests
- overwrite: False, partial: False
- ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
+ overwrite None partial False
+ ancestor 6747d179aa9a local 20a0db6fbf6c+ remote 7af322bc1198
t: versions differ -> m
preserving t for resolve of t
updating: t 1/1 files (100.00%)
@@ -249,7 +219,7 @@ merge tests
merging t
my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
warning: conflicts during merge.
- merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
+ merging t failed!
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -269,9 +239,9 @@ clone
$ cd ..
$ hg clone t tc
updating to branch default
- cloning subrepo s from $TESTTMP/t/s (glob)
- cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
- cloning subrepo t from $TESTTMP/t/t (glob)
+ cloning subrepo s from $TESTTMP/sub/t/s
+ cloning subrepo s/ss from $TESTTMP/sub/t/s/ss
+ cloning subrepo t from $TESTTMP/sub/t/t
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd tc
$ hg debugsub
@@ -288,14 +258,14 @@ push
$ hg ci -m11
committing subrepository t
$ hg push
- pushing to $TESTTMP/t (glob)
- pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
+ pushing to $TESTTMP/sub/t
+ pushing subrepo s/ss to $TESTTMP/sub/t/s/ss
searching for changes
no changes found
- pushing subrepo s to $TESTTMP/t/s (glob)
+ pushing subrepo s to $TESTTMP/sub/t/s
searching for changes
no changes found
- pushing subrepo t to $TESTTMP/t/t (glob)
+ pushing subrepo t to $TESTTMP/sub/t/t
searching for changes
adding changesets
adding manifests
@@ -313,27 +283,27 @@ push -f
$ hg ci -m12
committing subrepository s
$ hg push
- pushing to $TESTTMP/t (glob)
- pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
+ pushing to $TESTTMP/sub/t
+ pushing subrepo s/ss to $TESTTMP/sub/t/s/ss
searching for changes
no changes found
- pushing subrepo s to $TESTTMP/t/s (glob)
+ pushing subrepo s to $TESTTMP/sub/t/s
searching for changes
abort: push creates new remote head 12a213df6fa9!
(did you forget to merge? use push -f to force)
[255]
$ hg push -f
- pushing to $TESTTMP/t (glob)
- pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
+ pushing to $TESTTMP/sub/t
+ pushing subrepo s/ss to $TESTTMP/sub/t/s/ss
searching for changes
no changes found
- pushing subrepo s to $TESTTMP/t/s (glob)
+ pushing subrepo s to $TESTTMP/sub/t/s
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
- pushing subrepo t to $TESTTMP/t/t (glob)
+ pushing subrepo t to $TESTTMP/sub/t/t
searching for changes
no changes found
searching for changes
@@ -355,7 +325,7 @@ pull
$ cd ../tc
$ hg pull
- pulling from $TESTTMP/t (glob)
+ pulling from $TESTTMP/sub/t
searching for changes
adding changesets
adding manifests
@@ -366,7 +336,7 @@ pull
should pull t
$ hg up
- pulling subrepo t from $TESTTMP/t/t (glob)
+ pulling subrepo t from $TESTTMP/sub/t/t
searching for changes
adding changesets
adding manifests
@@ -411,7 +381,6 @@ shouldn't need merging
adding a
$ hg branch br
marked working directory as branch br
- (branches are permanent and global, did you want a bookmark?)
$ echo a >> a
$ hg ci -m1
$ hg up default
@@ -459,14 +428,15 @@ shouldn't need merging
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg ci -Am1
adding .hgsub
+ committing subrepository s
$ hg branch br
marked working directory as branch br
- (branches are permanent and global, did you want a bookmark?)
$ echo b > b
$ hg -R s up 3
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg ci -Am1
adding b
+ committing subrepository s
$ hg up default
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo c > c
@@ -485,6 +455,7 @@ shouldn't need merging
$ echo d > d
$ hg ci -Am1
adding d
+ committing subrepository s
$ hg up 3
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg -R s up 5
@@ -492,6 +463,7 @@ shouldn't need merging
$ echo e > e
$ hg ci -Am1
adding e
+ committing subrepository s
$ hg up 5
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -509,16 +481,18 @@ test subrepo delete from .hgsubstate
$ echo test > testdelete/nested/foo
$ echo test > testdelete/nested2/foo
$ hg -R testdelete/nested add
- adding testdelete/nested/foo (glob)
+ adding testdelete/nested/foo
$ hg -R testdelete/nested2 add
- adding testdelete/nested2/foo (glob)
+ adding testdelete/nested2/foo
$ hg -R testdelete/nested ci -m test
$ hg -R testdelete/nested2 ci -m test
$ echo nested = nested > testdelete/.hgsub
$ echo nested2 = nested2 >> testdelete/.hgsub
$ hg -R testdelete add
- adding testdelete/.hgsub (glob)
+ adding testdelete/.hgsub
$ hg -R testdelete ci -m "nested 1 & 2 added"
+ committing subrepository nested
+ committing subrepository nested2
$ echo nested = nested > testdelete/.hgsub
$ hg -R testdelete ci -m "nested 2 deleted"
$ cat testdelete/.hgsubstate
@@ -534,20 +508,22 @@ test repository cloning
$ hg init nested_absolute
$ echo test > nested_absolute/foo
$ hg -R nested_absolute add
- adding nested_absolute/foo (glob)
+ adding nested_absolute/foo
$ hg -R nested_absolute ci -mtest
$ cd mercurial
$ hg init nested_relative
$ echo test2 > nested_relative/foo2
$ hg -R nested_relative add
- adding nested_relative/foo2 (glob)
+ adding nested_relative/foo2
$ hg -R nested_relative ci -mtest2
$ hg init main
$ echo "nested_relative = ../nested_relative" > main/.hgsub
$ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
$ hg -R main add
- adding main/.hgsub (glob)
+ adding main/.hgsub
$ hg -R main ci -m "add subrepos"
+ committing subrepository nested_absolute
+ committing subrepository nested_relative
$ cd ..
$ hg clone mercurial/main mercurial2/main
updating to branch default
@@ -555,9 +531,9 @@ test repository cloning
$ cat mercurial2/main/nested_absolute/.hg/hgrc \
> mercurial2/main/nested_relative/.hg/hgrc
[paths]
- default = $TESTTMP/mercurial/nested_absolute
+ default = $TESTTMP/sub/mercurial/nested_absolute
[paths]
- default = $TESTTMP/mercurial/nested_relative
+ default = $TESTTMP/sub/mercurial/nested_relative
$ rm -rf mercurial mercurial2
Issue1977: multirepo push should fail if subrepo push fails
@@ -570,9 +546,10 @@ Issue1977: multirepo push should fail if subrepo push fails
$ echo s = s > repo/.hgsub
$ hg -R repo ci -Am1
adding .hgsub
+ committing subrepository s
$ hg clone repo repo2
updating to branch default
- cloning subrepo s from $TESTTMP/repo/s (glob)
+ cloning subrepo s from $TESTTMP/sub/repo/s
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -q -R repo2 pull -u
$ echo 1 > repo2/s/a
@@ -584,6 +561,7 @@ Issue1977: multirepo push should fail if subrepo push fails
$ hg -R repo2/s ci -m3
created new head
$ hg -R repo2 ci -m3
+ committing subrepository s
$ hg -q -R repo2 push
abort: push creates new remote head 9d66565e64e1!
(did you forget to merge? use push -f to force)
@@ -605,10 +583,10 @@ Prepare a repo with subrepo
$ echo sub/repo = sub/repo > .hgsub
$ hg add .hgsub
$ hg ci -mtest
- committing subrepository sub/repo (glob)
+ committing subrepository sub/repo
$ echo test >> sub/repo/foo
$ hg ci -mtest
- committing subrepository sub/repo (glob)
+ committing subrepository sub/repo
$ cd ..
Create repo without default path, pull top repo, and see what happens on update
@@ -623,7 +601,7 @@ Create repo without default path, pull top repo, and see what happens on update
added 2 changesets with 3 changes to 2 files
(run 'hg update' to get a working copy)
$ hg -R issue1852b update
- abort: default path for subrepository sub/repo not found (glob)
+ abort: default path for subrepository sub/repo not found
[255]
Pull -u now doesn't help
@@ -642,14 +620,14 @@ Try the same, but with pull -u
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
- cloning subrepo sub/repo from issue1852a/sub/repo (glob)
+ cloning subrepo sub/repo from issue1852a/sub/repo
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Try to push from the other side
$ hg -R issue1852a push `pwd`/issue1852c
- pushing to $TESTTMP/issue1852c
- pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
+ pushing to $TESTTMP/sub/issue1852c
+ pushing subrepo sub/repo to $TESTTMP/sub/issue1852c/sub/repo
searching for changes
no changes found
searching for changes
@@ -693,11 +671,12 @@ subrepository:
$ echo subrepo-2 = subrepo-2 >> .hgsub
$ hg add .hgsub
$ hg ci -m 'Added subrepos'
+ committing subrepository subrepo-1
committing subrepository subrepo-2
$ hg st subrepo-2/file
Check hg update --clean
- $ cd $TESTTMP/t
+ $ cd $TESTTMP/sub/t
$ rm -r t/t.orig
$ hg status -S --all
C .hgsub
@@ -725,7 +704,7 @@ Check hg update --clean
? s/c
Sticky subrepositories, no changes
- $ cd $TESTTMP/t
+ $ cd $TESTTMP/sub/t
$ hg id
925c17564ef8 tip
$ hg -R s id
@@ -747,7 +726,7 @@ Sticky subrepositorys, file changes
$ hg add -S s/f1
$ hg add -S t/f1
$ hg id
- 365661e5936a+
+ 365661e5936a
$ hg -R s id
fc627a69481f+
$ hg -R t id
@@ -791,7 +770,7 @@ Sticky subrepository, revision updates
$ hg id
e45c8b14af55+
$ hg -R s id
- 02dcf1d70411
+ 1c833a7a9e3a
$ hg -R t id
7af322bc1198
@@ -803,21 +782,21 @@ Sticky subrepository, file changes and revision updates
$ hg id
e45c8b14af55+
$ hg -R s id
- 02dcf1d70411+
+ 1c833a7a9e3a+
$ hg -R t id
7af322bc1198+
$ hg update tip
subrepository sources for s differ
- use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)?
+ use (l)ocal source (1c833a7a9e3a) or (r)emote source (12a213df6fa9)?
l
subrepository sources for t differ
use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)?
l
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg id
- 925c17564ef8+ tip
+ 925c17564ef8 tip
$ hg -R s id
- 02dcf1d70411+
+ 1c833a7a9e3a+
$ hg -R t id
7af322bc1198+
@@ -850,16 +829,17 @@ Test that removing .hgsubstate doesn't break anything:
$ hg rm -f .hgsubstate
$ hg ci -mrm
- nothing changed
- [1]
+ committing subrepository s
+ committing subrepository t
+ created new head
$ hg log -vr tip
- changeset: 13:925c17564ef8
+ changeset: 14:3941e0aa5236
tag: tip
+ parent: 11:365661e5936a
user: test
date: Thu Jan 01 00:00:00 1970 +0000
- files: .hgsubstate
description:
- 13
+ rm
@@ -867,11 +847,9 @@ Test that removing .hgsub removes .hgsubstate:
$ hg rm .hgsub
$ hg ci -mrm2
- created new head
$ hg log -vr tip
- changeset: 14:2400bccd50af
+ changeset: 15:8b31de9d13d1
tag: tip
- parent: 11:365661e5936a
user: test
date: Thu Jan 01 00:00:00 1970 +0000
files: .hgsub .hgsubstate
@@ -879,145 +857,3 @@ Test that removing .hgsub removes .hgsubstate:
rm2
-Test issue3153: diff -S with deleted subrepos
-
- $ hg diff --nodates -S -c .
- diff -r 365661e5936a -r 2400bccd50af .hgsub
- --- a/.hgsub
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -s = s
- -t = t
- diff -r 365661e5936a -r 2400bccd50af .hgsubstate
- --- a/.hgsubstate
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
- -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
-
-Test behavior of add for explicit path in subrepo:
- $ cd ..
- $ hg init explicit
- $ cd explicit
- $ echo s = s > .hgsub
- $ hg add .hgsub
- $ hg init s
- $ hg ci -m0
-Adding with an explicit path in a subrepo adds the file
- $ echo c1 > f1
- $ echo c2 > s/f2
- $ hg st -S
- ? f1
- ? s/f2
- $ hg add s/f2
- $ hg st -S
- A s/f2
- ? f1
- $ hg ci -R s -m0
- $ hg ci -Am1
- adding f1
-Adding with an explicit path in a subrepo with -S has the same behavior
- $ echo c3 > f3
- $ echo c4 > s/f4
- $ hg st -S
- ? f3
- ? s/f4
- $ hg add -S s/f4
- $ hg st -S
- A s/f4
- ? f3
- $ hg ci -R s -m1
- $ hg ci -Ama2
- adding f3
-Adding without a path or pattern silently ignores subrepos
- $ echo c5 > f5
- $ echo c6 > s/f6
- $ echo c7 > s/f7
- $ hg st -S
- ? f5
- ? s/f6
- ? s/f7
- $ hg add
- adding f5
- $ hg st -S
- A f5
- ? s/f6
- ? s/f7
- $ hg ci -R s -Am2
- adding f6
- adding f7
- $ hg ci -m3
-Adding without a path or pattern with -S also adds files in subrepos
- $ echo c8 > f8
- $ echo c9 > s/f9
- $ echo c10 > s/f10
- $ hg st -S
- ? f8
- ? s/f10
- ? s/f9
- $ hg add -S
- adding f8
- adding s/f10 (glob)
- adding s/f9 (glob)
- $ hg st -S
- A f8
- A s/f10
- A s/f9
- $ hg ci -R s -m3
- $ hg ci -m4
-Adding with a pattern silently ignores subrepos
- $ echo c11 > fm11
- $ echo c12 > fn12
- $ echo c13 > s/fm13
- $ echo c14 > s/fn14
- $ hg st -S
- ? fm11
- ? fn12
- ? s/fm13
- ? s/fn14
- $ hg add 'glob:**fm*'
- adding fm11
- $ hg st -S
- A fm11
- ? fn12
- ? s/fm13
- ? s/fn14
- $ hg ci -R s -Am4
- adding fm13
- adding fn14
- $ hg ci -Am5
- adding fn12
-Adding with a pattern with -S also adds matches in subrepos
- $ echo c15 > fm15
- $ echo c16 > fn16
- $ echo c17 > s/fm17
- $ echo c18 > s/fn18
- $ hg st -S
- ? fm15
- ? fn16
- ? s/fm17
- ? s/fn18
- $ hg add -S 'glob:**fm*'
- adding fm15
- adding s/fm17 (glob)
- $ hg st -S
- A fm15
- A s/fm17
- ? fn16
- ? s/fn18
- $ hg ci -R s -Am5
- adding fn18
- $ hg ci -Am6
- adding fn16
-
-Test behavior of forget for explicit path in subrepo:
-Forgetting an explicit path in a subrepo untracks the file
- $ echo c19 > s/f19
- $ hg add s/f19
- $ hg st -S
- A s/f19
- $ hg forget s/f19
- $ hg st -S
- ? s/f19
- $ rm s/f19
- $ cd ..