##// END OF EJS Templates
pushkey: do not exchange obsole markers if feature is disabled...
pushkey: do not exchange obsole markers if feature is disabled This apply to both push and pull both when client or server.

File last commit:

r16913:f2719b38 default
r17298:59c14bf5 stable
Show More
test-subrepo-recursion.t
494 lines | 12.9 KiB | text/troff | Tads3Lexer
/ tests / test-subrepo-recursion.t
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166 Create test repository:
Martin Geisler
outgoing: recurse into subrepositories with --subrepos/-S flag...
r12272 $ hg init repo
$ cd repo
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166 $ echo x1 > x.txt
$ hg init foo
$ cd foo
$ echo y1 > y.txt
$ hg init bar
$ cd bar
$ echo z1 > z.txt
$ cd ..
$ echo 'bar = bar' > .hgsub
$ cd ..
$ echo 'foo = foo' > .hgsub
Martin Geisler
add: recurse into subrepositories with --subrepos/-S flag
r12270
Add files --- .hgsub files must go first to trigger subrepos:
$ hg add -S .hgsub
$ hg add -S foo/.hgsub
$ hg add -S foo/bar
Mads Kiilerich
tests: add missing '(glob)'s to match '\' in paths in test output on windows
r15520 adding foo/bar/z.txt (glob)
Martin Geisler
add: recurse into subrepositories with --subrepos/-S flag
r12270 $ hg add -S
adding x.txt
Mads Kiilerich
tests: add missing '(glob)'s to match '\' in paths in test output on windows
r15520 adding foo/y.txt (glob)
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166
Martin Geisler
subrepos: handle modified but uncommitted .hgsub
r12175 Test recursive status without committing anything:
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg status -S
Martin Geisler
subrepos: handle modified but uncommitted .hgsub
r12175 A .hgsub
A foo/.hgsub
A foo/bar/z.txt
A foo/y.txt
A x.txt
Test recursive diff without committing anything:
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg diff --nodates -S foo
Martin Geisler
subrepos: handle modified but uncommitted .hgsub
r12175 diff -r 000000000000 foo/.hgsub
--- /dev/null
+++ b/foo/.hgsub
@@ -0,0 +1,1 @@
+bar = bar
diff -r 000000000000 foo/y.txt
--- /dev/null
+++ b/foo/y.txt
@@ -0,0 +1,1 @@
+y1
diff -r 000000000000 foo/bar/z.txt
--- /dev/null
+++ b/foo/bar/z.txt
@@ -0,0 +1,1 @@
+z1
Commits:
Martin Geisler
subrepos: abort commit by default if a subrepo is dirty (BC)...
r15321 $ hg commit -m fails
abort: uncommitted changes in subrepo foo
(use --subrepos for recursive commit)
[255]
The --subrepos flag overwrite the config setting:
$ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166 committing subrepository foo
Mads Kiilerich
tests: add missing '(glob)'s to match '\' in paths in test output on windows
r15520 committing subrepository foo/bar (glob)
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166
$ cd foo
$ echo y2 >> y.txt
$ hg commit -m 0-1-0
$ cd bar
$ echo z2 >> z.txt
$ hg commit -m 0-1-1
$ cd ..
$ hg commit -m 0-2-1
$ cd ..
$ hg commit -m 1-2-1
Change working directory:
$ echo y3 >> foo/y.txt
$ echo z3 >> foo/bar/z.txt
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg status -S
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166 M foo/bar/z.txt
M foo/y.txt
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg diff --nodates -S
Martin Geisler
diff: recurse into subrepositories with --subrepos/-S flag
r12167 diff -r d254738c5f5e foo/y.txt
--- a/foo/y.txt
+++ b/foo/y.txt
@@ -1,2 +1,3 @@
y1
y2
+y3
diff -r 9647f22de499 foo/bar/z.txt
--- a/foo/bar/z.txt
+++ b/foo/bar/z.txt
@@ -1,2 +1,3 @@
z1
z2
+z3
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166
Status call crossing repository boundaries:
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg status -S foo/bar/z.txt
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166 M foo/bar/z.txt
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg status -S -I 'foo/?.txt'
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166 M foo/y.txt
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg status -S -I '**/?.txt'
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166 M foo/bar/z.txt
M foo/y.txt
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg diff --nodates -S -I '**/?.txt'
Martin Geisler
diff: recurse into subrepositories with --subrepos/-S flag
r12167 diff -r d254738c5f5e foo/y.txt
--- a/foo/y.txt
+++ b/foo/y.txt
@@ -1,2 +1,3 @@
y1
y2
+y3
diff -r 9647f22de499 foo/bar/z.txt
--- a/foo/bar/z.txt
+++ b/foo/bar/z.txt
@@ -1,2 +1,3 @@
z1
z2
+z3
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166
Status from within a subdirectory:
$ mkdir dir
$ cd dir
$ echo a1 > a.txt
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg status -S
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166 M foo/bar/z.txt
M foo/y.txt
? dir/a.txt
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg diff --nodates -S
Martin Geisler
diff: recurse into subrepositories with --subrepos/-S flag
r12167 diff -r d254738c5f5e foo/y.txt
--- a/foo/y.txt
+++ b/foo/y.txt
@@ -1,2 +1,3 @@
y1
y2
+y3
diff -r 9647f22de499 foo/bar/z.txt
--- a/foo/bar/z.txt
+++ b/foo/bar/z.txt
@@ -1,2 +1,3 @@
z1
z2
+z3
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166
Status with relative path:
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg status -S ..
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166 M ../foo/bar/z.txt
M ../foo/y.txt
? a.txt
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg diff --nodates -S ..
Martin Geisler
diff: recurse into subrepositories with --subrepos/-S flag
r12167 diff -r d254738c5f5e foo/y.txt
--- a/foo/y.txt
+++ b/foo/y.txt
@@ -1,2 +1,3 @@
y1
y2
+y3
diff -r 9647f22de499 foo/bar/z.txt
--- a/foo/bar/z.txt
+++ b/foo/bar/z.txt
@@ -1,2 +1,3 @@
z1
z2
+z3
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166 $ cd ..
Martin Geisler
diff: recurse into subrepositories with --subrepos/-S flag
r12167 Cleanup and final commit:
$ rm -r dir
Martin Geisler
subrepos: abort commit by default if a subrepo is dirty (BC)...
r15321 $ hg commit --subrepos -m 2-3-2
Martin Geisler
diff: recurse into subrepositories with --subrepos/-S flag
r12167 committing subrepository foo
Mads Kiilerich
tests: add missing '(glob)'s to match '\' in paths in test output on windows
r15520 committing subrepository foo/bar (glob)
Martin Geisler
diff: recurse into subrepositories with --subrepos/-S flag
r12167
David M. Carr
tests: add subrepo recursion tests for add/forget with explicit paths...
r15910 Test explicit path commands within subrepos: add/forget
$ echo z1 > foo/bar/z2.txt
$ hg status -S
? foo/bar/z2.txt
$ hg add foo/bar/z2.txt
$ hg status -S
A foo/bar/z2.txt
$ hg forget foo/bar/z2.txt
$ hg status -S
? foo/bar/z2.txt
FUJIWARA Katsunori
forget: show warning messages for forgetting in subrepo correctly...
r16070 $ hg forget foo/bar/z2.txt
Mads Kiilerich
tests: add missing accept of native pathname separator
r16540 not removing foo/bar/z2.txt: file is already untracked (glob)
FUJIWARA Katsunori
forget: show warning messages for forgetting in subrepo correctly...
r16070 [1]
$ hg status -S
? foo/bar/z2.txt
David M. Carr
tests: add subrepo recursion tests for add/forget with explicit paths...
r15910 $ rm foo/bar/z2.txt
Martin Geisler
diff: recurse into subrepositories with --subrepos/-S flag
r12167 Log with the relationships between repo and its subrepo:
$ hg log --template '{rev}:{node|short} {desc}\n'
2:1326fa26d0c0 2-3-2
1:4b3c9ff4f66b 1-2-1
0:23376cbba0d8 0-0-0
$ hg -R foo log --template '{rev}:{node|short} {desc}\n'
3:65903cebad86 2-3-2
2:d254738c5f5e 0-2-1
1:8629ce7dcc39 0-1-0
0:af048e97ade2 0-0-0
$ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
2:31ecbdafd357 2-3-2
1:9647f22de499 0-1-1
0:4904098473f9 0-0-0
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166 Status between revisions:
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg status -S
$ hg status -S --rev 0:1
Martin Geisler
status: recurse into subrepositories with --subrepos/-S flag
r12166 M .hgsubstate
M foo/.hgsubstate
M foo/bar/z.txt
M foo/y.txt
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg diff --nodates -S -I '**/?.txt' --rev 0:1
Martin Geisler
diff: recurse into subrepositories with --subrepos/-S flag
r12167 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
--- a/foo/y.txt
+++ b/foo/y.txt
@@ -1,1 +1,2 @@
y1
+y2
diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
--- a/foo/bar/z.txt
+++ b/foo/bar/z.txt
@@ -1,1 +1,2 @@
z1
+z2
Martin Geisler
outgoing: recurse into subrepositories with --subrepos/-S flag...
r12272
Martin Geisler
subrepo: add progress bar support to archive
r13144 Enable progress extension for archive tests:
$ cp $HGRCPATH $HGRCPATH.no-progress
$ cat >> $HGRCPATH <<EOF
> [extensions]
> progress =
> [progress]
> assume-tty = 1
> delay = 0
Augie Fackler
progress using tests: disable time estimates to avoid flakiness
r13149 > format = topic bar number
Martin Geisler
subrepo: add progress bar support to archive
r13144 > refresh = 0
> width = 60
> EOF
Test archiving to a directory tree (the doubled lines in the output
only show up in the test output, not in real usage):
Martin Geisler
subrepo: add support for 'hg archive'
r12323
Thomas Arendsen Hein
tests: make tests work if directory contains special characters...
r16350 $ hg archive --subrepos ../archive 2>&1 | "$TESTDIR/filtercr.py"
Martin Geisler
subrepo: add progress bar support to archive
r13144
archiving [ ] 0/3
archiving [ ] 0/3
archiving [=============> ] 1/3
archiving [=============> ] 1/3
archiving [===========================> ] 2/3
archiving [===========================> ] 2/3
archiving [==========================================>] 3/3
archiving [==========================================>] 3/3
archiving (foo) [ ] 0/3
archiving (foo) [ ] 0/3
archiving (foo) [===========> ] 1/3
archiving (foo) [===========> ] 1/3
archiving (foo) [=======================> ] 2/3
archiving (foo) [=======================> ] 2/3
archiving (foo) [====================================>] 3/3
archiving (foo) [====================================>] 3/3
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 archiving (foo/bar) [ ] 0/1 (glob)
archiving (foo/bar) [ ] 0/1 (glob)
archiving (foo/bar) [================================>] 1/1 (glob)
archiving (foo/bar) [================================>] 1/1 (glob)
Martin Geisler
subrepo: add progress bar support to archive
r13144 \r (esc)
Patrick Mezard
test-subrepo-recursion: sort archive output for portability
r12363 $ find ../archive | sort
Martin Geisler
subrepo: add support for 'hg archive'
r12323 ../archive
Patrick Mezard
test-subrepo-recursion: sort archive output for portability
r12363 ../archive/.hg_archival.txt
../archive/.hgsub
../archive/.hgsubstate
Martin Geisler
subrepo: add support for 'hg archive'
r12323 ../archive/foo
Patrick Mezard
test-subrepo-recursion: sort archive output for portability
r12363 ../archive/foo/.hgsub
../archive/foo/.hgsubstate
Martin Geisler
subrepo: add support for 'hg archive'
r12323 ../archive/foo/bar
../archive/foo/bar/z.txt
../archive/foo/y.txt
../archive/x.txt
Matt Mackall
tests: fixup tests using unzip -l
r12339 Test archiving to zip file (unzip output is unstable):
Martin Geisler
subrepo: add support for 'hg archive'
r12323
Thomas Arendsen Hein
tests: make tests work if directory contains special characters...
r16350 $ hg archive --subrepos ../archive.zip 2>&1 | "$TESTDIR/filtercr.py"
Martin Geisler
subrepo: add progress bar support to archive
r13144
archiving [ ] 0/3
archiving [ ] 0/3
archiving [=============> ] 1/3
archiving [=============> ] 1/3
archiving [===========================> ] 2/3
archiving [===========================> ] 2/3
archiving [==========================================>] 3/3
archiving [==========================================>] 3/3
archiving (foo) [ ] 0/3
archiving (foo) [ ] 0/3
archiving (foo) [===========> ] 1/3
archiving (foo) [===========> ] 1/3
archiving (foo) [=======================> ] 2/3
archiving (foo) [=======================> ] 2/3
archiving (foo) [====================================>] 3/3
archiving (foo) [====================================>] 3/3
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 archiving (foo/bar) [ ] 0/1 (glob)
archiving (foo/bar) [ ] 0/1 (glob)
archiving (foo/bar) [================================>] 1/1 (glob)
archiving (foo/bar) [================================>] 1/1 (glob)
Martin Geisler
subrepo: add progress bar support to archive
r13144 \r (esc)
Martin Geisler
subrepo: pull revisions on demand when archiving hg subrepos...
r15286 Test archiving a revision that references a subrepo that is not yet
cloned:
$ hg clone -U . ../empty
$ cd ../empty
Thomas Arendsen Hein
tests: make tests work if directory contains special characters...
r16350 $ hg archive --subrepos -r tip ../archive.tar.gz 2>&1 | "$TESTDIR/filtercr.py"
Martin Geisler
subrepo: pull revisions on demand when archiving hg subrepos...
r15286
archiving [ ] 0/3
archiving [ ] 0/3
archiving [=============> ] 1/3
archiving [=============> ] 1/3
archiving [===========================> ] 2/3
archiving [===========================> ] 2/3
archiving [==========================================>] 3/3
archiving [==========================================>] 3/3
archiving (foo) [ ] 0/3
archiving (foo) [ ] 0/3
archiving (foo) [===========> ] 1/3
archiving (foo) [===========> ] 1/3
archiving (foo) [=======================> ] 2/3
archiving (foo) [=======================> ] 2/3
archiving (foo) [====================================>] 3/3
archiving (foo) [====================================>] 3/3
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 archiving (foo/bar) [ ] 0/1 (glob)
archiving (foo/bar) [ ] 0/1 (glob)
archiving (foo/bar) [================================>] 1/1 (glob)
archiving (foo/bar) [================================>] 1/1 (glob)
Martin Geisler
subrepo: pull revisions on demand when archiving hg subrepos...
r15286
cloning subrepo foo from $TESTTMP/repo/foo
Mads Kiilerich
tests: add missing '(glob)'s to match '\' in paths in test output on windows
r15520 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
Martin Geisler
subrepo: pull revisions on demand when archiving hg subrepos...
r15286
The newly cloned subrepos contain no working copy:
$ hg -R foo summary
parent: -1:000000000000 (no revision checked out)
branch: default
commit: (clean)
update: 4 new changesets (update)
Martin Geisler
subrepo: add progress bar support to archive
r13144 Disable progress extension and cleanup:
$ mv $HGRCPATH.no-progress $HGRCPATH
Martin Geisler
subrepo: add support for 'hg archive'
r12323
Martin Geisler
subrepo: abort in hgsubrepo._get if the destination is obstructed...
r15287 Test archiving when there is a directory in the way for a subrepo
created by archive:
$ hg clone -U . ../almost-empty
$ cd ../almost-empty
$ mkdir foo
$ echo f > foo/f
$ hg archive --subrepos -r tip archive
cloning subrepo foo from $TESTTMP/empty/foo
Mads Kiilerich
tests: add missing '(glob)'s to match '\' in paths in test output on windows
r15520 abort: destination '$TESTTMP/almost-empty/foo' is not empty (glob)
Martin Geisler
subrepo: abort in hgsubrepo._get if the destination is obstructed...
r15287 [255]
Martin Geisler
outgoing: recurse into subrepositories with --subrepos/-S flag...
r12272 Clone and test outgoing:
$ cd ..
$ hg clone repo repo2
updating to branch default
Martin Geisler
subrepo: create subrepos using clone instead of pull...
r14281 cloning subrepo foo from $TESTTMP/repo/foo
Mads Kiilerich
tests: add missing '(glob)'s to match '\' in paths in test output on windows
r15520 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
Martin Geisler
outgoing: recurse into subrepositories with --subrepos/-S flag...
r12272 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd repo2
$ hg outgoing -S
Mads Kiilerich
tests: add missing '(glob)'s to match '\' in paths in test output on windows
r15520 comparing with $TESTTMP/repo (glob)
Martin Geisler
outgoing: recurse into subrepositories with --subrepos/-S flag...
r12272 searching for changes
no changes found
Mads Kiilerich
tests: remove redundant globs...
r12640 comparing with $TESTTMP/repo/foo
Martin Geisler
outgoing: recurse into subrepositories with --subrepos/-S flag...
r12272 searching for changes
no changes found
Mads Kiilerich
tests: remove redundant globs...
r12640 comparing with $TESTTMP/repo/foo/bar
Erik Zielke
incoming/outgoing: Fix recursion on sub repositories...
r12400 searching for changes
no changes found
Matt Mackall
tests: add exit codes to unified tests
r12316 [1]
Martin Geisler
outgoing: recurse into subrepositories with --subrepos/-S flag...
r12272
Make nested change:
$ echo y4 >> foo/y.txt
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg diff --nodates -S
Martin Geisler
outgoing: recurse into subrepositories with --subrepos/-S flag...
r12272 diff -r 65903cebad86 foo/y.txt
--- a/foo/y.txt
+++ b/foo/y.txt
@@ -1,3 +1,4 @@
y1
y2
y3
+y4
Martin Geisler
subrepos: abort commit by default if a subrepo is dirty (BC)...
r15321 $ hg commit --subrepos -m 3-4-2
Martin Geisler
outgoing: recurse into subrepositories with --subrepos/-S flag...
r12272 committing subrepository foo
$ hg outgoing -S
Mads Kiilerich
tests: add missing '(glob)'s to match '\' in paths in test output on windows
r15520 comparing with $TESTTMP/repo (glob)
Martin Geisler
outgoing: recurse into subrepositories with --subrepos/-S flag...
r12272 searching for changes
changeset: 3:2655b8ecc4ee
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 3-4-2
Mads Kiilerich
tests: remove redundant globs...
r12640 comparing with $TESTTMP/repo/foo
Martin Geisler
outgoing: recurse into subrepositories with --subrepos/-S flag...
r12272 searching for changes
changeset: 4:e96193d6cb36
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 3-4-2
Mads Kiilerich
tests: remove redundant globs...
r12640 comparing with $TESTTMP/repo/foo/bar
Erik Zielke
incoming/outgoing: Fix recursion on sub repositories...
r12400 searching for changes
no changes found
Martin Geisler
incoming: recurse into subrepositories with --subrepos/-S flag...
r12274
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588
Martin Geisler
incoming: recurse into subrepositories with --subrepos/-S flag...
r12274 Switch to original repo and setup default path:
$ cd ../repo
$ echo '[paths]' >> .hg/hgrc
$ echo 'default = ../repo2' >> .hg/hgrc
Test incoming:
$ hg incoming -S
Mads Kiilerich
tests: add missing '(glob)'s to match '\' in paths in test output on windows
r15520 comparing with $TESTTMP/repo2 (glob)
Martin Geisler
incoming: recurse into subrepositories with --subrepos/-S flag...
r12274 searching for changes
changeset: 3:2655b8ecc4ee
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 3-4-2
Mads Kiilerich
tests: remove redundant globs...
r12640 comparing with $TESTTMP/repo2/foo
Martin Geisler
incoming: recurse into subrepositories with --subrepos/-S flag...
r12274 searching for changes
changeset: 4:e96193d6cb36
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 3-4-2
Mads Kiilerich
tests: remove redundant globs...
r12640 comparing with $TESTTMP/repo2/foo/bar
Erik Zielke
incoming/outgoing: Fix recursion on sub repositories...
r12400 searching for changes
no changes found
Martin Geisler
incoming: recurse into subrepositories with --subrepos/-S flag...
r12274 $ hg incoming -S --bundle incoming.hg
abort: cannot combine --bundle and --subrepos
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Martin Geisler
incoming: recurse into subrepositories with --subrepos/-S flag...
r12274
Martin Geisler
test-subrepo-recursion: test missing subrepo
r12275 Test missing subrepo:
$ rm -r foo
Erik Zielke
test-subrepo-recursion: deleted default arguments...
r12588 $ hg status -S
Wagner Bruna
subrepo: improve lookup error messages
r12503 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
trbs
subrepo: fix pruning of subrepo filenames in dirstate (issue2619)
r13339
Issue2619: IndexError: list index out of range on hg add with subrepos
The subrepo must sorts after the explicit filename.
$ cd ..
$ hg init test
$ cd test
$ hg init x
$ echo "x = x" >> .hgsub
$ hg add .hgsub
$ touch a x/a
$ hg add a x/a
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913
$ cd ..