[PATCH 1 of 8] tests: expand test with checking the isolation of subrepo config
Simon Heimberg
simohe at besonet.ch
Mon Oct 22 09:55:55 UTC 2012
# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1349372802 -7200
# Node ID 75053afab605dfef2f51075550fcebf6e10f80db
# Parent 7f377964aced1271f8c2d37b8fa55c89b761e94c
tests: expand test with checking the isolation of subrepo config
Thest that subrepos do not get configuration from parent repos.
No new repo is created in the test, so it should run (almost) as quick as
before.
diff -r 7f377964aced -r 75053afab605 tests/test-subrepo.t
--- a/tests/test-subrepo.t Mon Okt 15 23:32:28 2012 +0200
+++ b/tests/test-subrepo.t Don Okt 04 19:46:42 2012 +0200
@@ -3,14 +3,39 @@
$ echo "[ui]" >> $HGRCPATH
$ echo "commitsubrepos = Yes" >> $HGRCPATH
+Set hooks to test subrepo ui inheritance
+ $ cp $HGRCPATH $HGRCPATH.nohook
+ $ cat >> $HGRCPATH << EOF
+ >
+ > [hooks]
+ > changegroup.g = echo _ changegroup hooks in \`pwd\` _
+ > incoming.g = echo _ incoming hooks in \`pwd\` _
+ > outgoing.g = echo _ outgoing hooks in \`pwd\` _
+ > commit.g = echo _ commit hooks in \`pwd\` _
+ > update.g = echo _ update hooks in \`pwd\` _
+ > EOF
+
+
$ hg init t
$ cd t
+ $ cat > .hg/hgrc << EOF
+ > [hooks]
+ > changegroup.t = echo . h rt
+ > incoming.t = echo . h rt i
+ > outgoing.t = echo . h rt o
+ > commit.t = echo . h rt c
+ > tag.t = echo . h rt t
+ > update.t = echo . h rt u
+ > EOF
+
first revision, no sub
$ echo a > a
$ hg ci -Am0
adding a
+ _ commit hooks in $TESTTMP/t _ (glob)
+ . h rt c
add first sub
@@ -18,6 +43,7 @@
$ hg add .hgsub
$ hg init s
$ echo a > s/a
+ $ sed "s/ rt/ rts/g" .hg/hgrc > s/.hg/hgrc
Issue2232: committing a subrepo without .hgsub
@@ -27,6 +53,8 @@
$ hg -R s ci -Ams0
adding a
+ _ commit hooks in $TESTTMP/t/s _ (glob)
+ . h rts c
$ hg sum
parent: 0:f7b1eb17ad24 tip
0
@@ -34,6 +62,8 @@
commit: 1 added, 1 subrepos
update: (current)
$ hg ci -m1
+ _ commit hooks in $TESTTMP/t _ (glob)
+ . h rt c
Revert subrepo and test subrepo fileset keyword:
@@ -41,6 +71,8 @@
$ hg revert "set:subrepo('glob:s*')"
reverting subrepo s
reverting s/a (glob)
+ _ update hooks in $TESTTMP/t/s _ (glob)
+ . h rts u
$ rm s/a.orig
Revert subrepo with no backup. The "reverting s/a" line is gone since
@@ -49,6 +81,8 @@
$ echo b > s/a
$ hg revert --no-backup s
reverting subrepo s
+ _ update hooks in $TESTTMP/t/s _ (glob)
+ . h rts u
Issue2022: update -C
@@ -60,6 +94,10 @@
commit: 1 subrepos
update: (current)
$ hg co -C 1
+ _ update hooks in $TESTTMP/t/s _ (glob)
+ . h rts u
+ _ update hooks in $TESTTMP/t _ (glob)
+ . h rt u
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg sum
parent: 1:7cf8cfea66e4 tip
@@ -80,6 +118,8 @@
$ echo ss = ss > s/.hgsub
$ hg init s/ss
+ $ sed "s/ rt/ rtss/g" .hg/hgrc > s/ss/.hg/hgrc
+
$ echo a > s/ss/a
$ hg -R s add s/.hgsub
$ hg -R s/ss add s/ss/a
@@ -92,6 +132,12 @@
$ hg ci -m2
committing subrepository s
committing subrepository s/ss (glob)
+ _ commit hooks in $TESTTMP/t/s/ss _ (glob)
+ . h rtss c
+ _ commit hooks in $TESTTMP/t/s _ (glob)
+ . h rts c
+ _ commit hooks in $TESTTMP/t _ (glob)
+ . h rt c
$ hg sum
parent: 2:df30734270ae tip
2
@@ -103,7 +149,11 @@
$ echo b > s/a
$ hg -R s ci -ms1
+ _ commit hooks in $TESTTMP/t/s _ (glob)
+ . h rts c
$ hg --config ui.commitsubrepos=no ci -m3
+ _ commit hooks in $TESTTMP/t _ (glob)
+ . h rt c
leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
@@ -115,11 +165,17 @@
$ hg id
f6affe3fbfaa+ tip
$ hg -R s ci -mc
+ _ commit hooks in $TESTTMP/t/s _ (glob)
+ . h rts c
$ hg id
f6affe3fbfaa+ tip
$ echo d > s/a
$ hg ci -m4
committing subrepository s
+ _ commit hooks in $TESTTMP/t/s _ (glob)
+ . h rts c
+ _ commit hooks in $TESTTMP/t _ (glob)
+ . h rt c
$ hg tip -R s
changeset: 4:02dcf1d70411
tag: tip
@@ -131,12 +187,24 @@
check caching
$ hg co 0
+ _ update hooks in $TESTTMP/t/s/ss _ (glob)
+ . h rtss u
+ _ update hooks in $TESTTMP/t/s _ (glob)
+ . h rts u
+ _ update hooks in $TESTTMP/t _ (glob)
+ . h rt u
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ hg debugsub
restore
$ hg co
+ _ update hooks in $TESTTMP/t/s/ss _ (glob)
+ . h rtss u
+ _ update hooks in $TESTTMP/t/s _ (glob)
+ . h rts u
+ _ update hooks in $TESTTMP/t _ (glob)
+ . h rt u
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg debugsub
path s
@@ -146,6 +214,12 @@
new branch for merge tests
$ hg co 1
+ _ update hooks in $TESTTMP/t/s/ss _ (glob)
+ . h rtss u
+ _ update hooks in $TESTTMP/t/s _ (glob)
+ . h rts u
+ _ update hooks in $TESTTMP/t _ (glob)
+ . h rt u
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo t = t >> .hgsub
$ hg init t
@@ -157,6 +231,9 @@
$ hg ci -m5 # add sub
committing subrepository t
+ _ commit hooks in $TESTTMP/t/t _ (glob)
+ _ commit hooks in $TESTTMP/t _ (glob)
+ . h rt c
created new head
$ echo t2 > t/t
@@ -165,6 +242,9 @@
$ hg st -R s
$ hg ci -m6 # change sub
committing subrepository t
+ _ commit hooks in $TESTTMP/t/t _ (glob)
+ _ commit hooks in $TESTTMP/t _ (glob)
+ . h rt c
$ hg debugsub
path s
source s
@@ -178,17 +258,31 @@
$ hg ci -m7 # change sub again for conflict test
committing subrepository t
+ _ commit hooks in $TESTTMP/t/t _ (glob)
+ _ commit hooks in $TESTTMP/t _ (glob)
+ . h rt c
$ hg rm .hgsub
8
$ hg ci -m8 # remove sub
+ _ commit hooks in $TESTTMP/t _ (glob)
+ . h rt c
merge tests
$ hg co -C 3
+ _ update hooks in $TESTTMP/t/s/ss _ (glob)
+ . h rtss u
+ _ update hooks in $TESTTMP/t/s _ (glob)
+ . h rts u
+ _ update hooks in $TESTTMP/t _ (glob)
+ . h rt u
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge 5 # test adding
+ _ update hooks in $TESTTMP/t/t _ (glob)
+ _ update hooks in $TESTTMP/t _ (glob)
+ . h rt u
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg debugsub
@@ -199,6 +293,8 @@
source t
revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
$ hg ci -m9
+ _ commit hooks in $TESTTMP/t _ (glob)
+ . h rt c
created new head
$ hg merge 6 --debug # test change
searching for copies back to rev 2
@@ -216,6 +312,12 @@
t: remote is newer -> g
updating: t 1/1 files (100.00%)
getting t
+ running hook update.g: echo _ update hooks in `pwd` _ (glob)
+ _ update hooks in $TESTTMP/t/t _ (glob)
+ running hook update.g: echo _ update hooks in `pwd` _ (glob)
+ _ update hooks in $TESTTMP/t _ (glob)
+ running hook update.t: echo . h rt u
+ . h rt u
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg debugsub
@@ -228,6 +330,9 @@
$ echo conflict > t/t
$ hg ci -m10
committing subrepository t
+ _ commit hooks in $TESTTMP/t/t _ (glob)
+ _ commit hooks in $TESTTMP/t _ (glob)
+ . h rt c
$ HGMERGE=internal:merge hg merge --debug 7 # test conflict
searching for copies back to rev 2
resolving manifests
@@ -250,8 +355,14 @@
my t at 20a0db6fbf6c+ other t at 7af322bc1198 ancestor t at 6747d179aa9a
warning: conflicts during merge.
merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
+ running hook update.g: echo _ update hooks in `pwd` _ (glob)
+ _ update hooks in $TESTTMP/t/t _ (glob)
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
+ running hook update.g: echo _ update hooks in `pwd` _ (glob)
+ _ update hooks in $TESTTMP/t _ (glob)
+ running hook update.t: echo . h rt u
+ . h rt u
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
@@ -268,10 +379,21 @@
$ cd ..
$ hg clone t tc
+ _ outgoing hooks in $TESTTMP/t _ (glob)
+ . h rt o
updating to branch default
cloning subrepo s from $TESTTMP/t/s (glob)
+ _ outgoing hooks in $TESTTMP/t/s _ (glob)
+ . h rts o
cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
+ _ outgoing hooks in $TESTTMP/t/s/ss _ (glob)
+ . h rtss o
+ _ update hooks in $TESTTMP/tc/s/ss _ (glob)
+ _ update hooks in $TESTTMP/tc/s _ (glob)
cloning subrepo t from $TESTTMP/t/t (glob)
+ _ outgoing hooks in $TESTTMP/t/t _ (glob)
+ _ update hooks in $TESTTMP/tc/t _ (glob)
+ _ update hooks in $TESTTMP/tc _ (glob)
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd tc
$ hg debugsub
@@ -287,6 +409,8 @@
$ echo bah > t/t
$ hg ci -m11
committing subrepository t
+ _ commit hooks in $TESTTMP/tc/t _ (glob)
+ _ commit hooks in $TESTTMP/tc _ (glob)
$ hg push
pushing to $TESTTMP/t (glob)
pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
@@ -298,20 +422,30 @@
pushing subrepo t to $TESTTMP/t/t (glob)
searching for changes
adding changesets
+ _ outgoing hooks in $TESTTMP/tc/t _ (glob)
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
+ _ changegroup hooks in $TESTTMP/t/t _ (glob)
+ _ incoming hooks in $TESTTMP/t/t _ (glob)
searching for changes
adding changesets
+ _ outgoing hooks in $TESTTMP/tc _ (glob)
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
+ _ changegroup hooks in $TESTTMP/t _ (glob)
+ . h rt
+ _ incoming hooks in $TESTTMP/t _ (glob)
+ . h rt i
push -f
$ echo bah > s/a
$ hg ci -m12
committing subrepository s
+ _ commit hooks in $TESTTMP/tc/s _ (glob)
+ _ commit hooks in $TESTTMP/tc _ (glob)
$ hg push
pushing to $TESTTMP/t (glob)
pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
@@ -330,26 +464,44 @@
pushing subrepo s to $TESTTMP/t/s (glob)
searching for changes
adding changesets
+ _ outgoing hooks in $TESTTMP/tc/s _ (glob)
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
+ _ changegroup hooks in $TESTTMP/t/s _ (glob)
+ . h rts
+ _ incoming hooks in $TESTTMP/t/s _ (glob)
+ . h rts i
pushing subrepo t to $TESTTMP/t/t (glob)
searching for changes
no changes found
searching for changes
adding changesets
+ _ outgoing hooks in $TESTTMP/tc _ (glob)
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
+ _ changegroup hooks in $TESTTMP/t _ (glob)
+ . h rt
+ _ incoming hooks in $TESTTMP/t _ (glob)
+ . h rt i
update
$ cd ../t
$ hg up -C # discard our earlier merge
+ _ update hooks in $TESTTMP/t/s _ (glob)
+ . h rts u
+ _ update hooks in $TESTTMP/t/t _ (glob)
+ _ update hooks in $TESTTMP/t _ (glob)
+ . h rt u
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo blah > t/t
$ hg ci -m13
committing subrepository t
+ _ commit hooks in $TESTTMP/t/t _ (glob)
+ _ commit hooks in $TESTTMP/t _ (glob)
+ . h rt c
pull
@@ -358,9 +510,13 @@
pulling from $TESTTMP/t (glob)
searching for changes
adding changesets
+ _ outgoing hooks in $TESTTMP/t _ (glob)
+ . h rt o
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
+ _ changegroup hooks in $TESTTMP/tc _ (glob)
+ _ incoming hooks in $TESTTMP/tc _ (glob)
(run 'hg update' to get a working copy)
should pull t
@@ -369,9 +525,14 @@
pulling subrepo t from $TESTTMP/t/t (glob)
searching for changes
adding changesets
+ _ outgoing hooks in $TESTTMP/t/t _ (glob)
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
+ _ changegroup hooks in $TESTTMP/tc/t _ (glob)
+ _ incoming hooks in $TESTTMP/tc/t _ (glob)
+ _ update hooks in $TESTTMP/tc/t _ (glob)
+ _ update hooks in $TESTTMP/tc _ (glob)
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cat t/t
blah
@@ -383,6 +544,10 @@
abort: missing ] in subrepo source
[255]
+remove hooks
+ $ cp $HGRCPATH.nohook $HGRCPATH
+ $ rm ../t/.hg/hgrc ../t/s/.hg/hgrc ../t/s/ss/.hg/hgrc
+
Issue1986: merge aborts when trying to merge a subrepo that
shouldn't need merging
@@ -642,7 +807,7 @@
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
More information about the Mercurial-devel
mailing list