test-subrepo.t
1983 lines
| 51.0 KiB
| text/troff
|
Tads3Lexer
/ tests / test-subrepo.t
Martin Geisler
|
r15321 | Let commit recurse into subrepos by default to match pre-2.0 behavior: | ||
$ echo "[ui]" >> $HGRCPATH | ||||
$ echo "commitsubrepos = Yes" >> $HGRCPATH | ||||
Martin Geisler
|
r11912 | $ hg init t | ||
$ cd t | ||||
first revision, no sub | ||||
$ echo a > a | ||||
$ hg ci -Am0 | ||||
adding a | ||||
add first sub | ||||
$ echo s = s > .hgsub | ||||
$ hg add .hgsub | ||||
$ hg init s | ||||
$ echo a > s/a | ||||
Martin Geisler
|
r12399 | Issue2232: committing a subrepo without .hgsub | ||
Martin Geisler
|
r11912 | |||
$ hg ci -mbad s | ||||
abort: can't commit subrepos without .hgsub | ||||
Matt Mackall
|
r12316 | [255] | ||
Martin Geisler
|
r11912 | |||
Matt Harbison
|
r24413 | $ hg -R s add s/a | ||
$ hg files -S | ||||
.hgsub | ||||
a | ||||
Matt Harbison
|
r35394 | s/a | ||
Matt Harbison
|
r24413 | |||
Martin Geisler
|
r11912 | $ hg -R s ci -Ams0 | ||
$ hg sum | ||||
parent: 0:f7b1eb17ad24 tip | ||||
0 | ||||
branch: default | ||||
commit: 1 added, 1 subrepos | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 1 draft | ||
Martin Geisler
|
r11912 | $ hg ci -m1 | ||
FUJIWARA Katsunori
|
r20827 | test handling .hgsubstate "added" explicitly. | ||
$ hg parents --template '{node}\n{files}\n' | ||||
7cf8cfea66e410e8e3336508dfeec07b3192de51 | ||||
.hgsub .hgsubstate | ||||
$ hg rollback -q | ||||
$ hg add .hgsubstate | ||||
$ hg ci -m1 | ||||
$ hg parents --template '{node}\n{files}\n' | ||||
7cf8cfea66e410e8e3336508dfeec07b3192de51 | ||||
.hgsub .hgsubstate | ||||
Hannes Oldenburg
|
r29622 | Subrepopath which overlaps with filepath, does not change warnings in remove() | ||
$ mkdir snot | ||||
$ touch snot/file | ||||
$ hg remove -S snot/file | ||||
Matt Harbison
|
r35394 | not removing snot/file: file is untracked | ||
Hannes Oldenburg
|
r29622 | [1] | ||
Hannes Oldenburg
|
r29633 | $ hg cat snot/filenot | ||
Matt Harbison
|
r35394 | snot/filenot: no such file in rev 7cf8cfea66e4 | ||
Hannes Oldenburg
|
r29633 | [1] | ||
Hannes Oldenburg
|
r29622 | $ rm -r snot | ||
Angel Ezquerra
|
r16454 | Revert subrepo and test subrepo fileset keyword: | ||
Angel Ezquerra
|
r15265 | |||
$ echo b > s/a | ||||
Matt Harbison
|
r24134 | $ hg revert --dry-run "set:subrepo('glob:s*')" | ||
reverting subrepo s | ||||
Matt Harbison
|
r35394 | reverting s/a | ||
Matt Harbison
|
r24134 | $ cat s/a | ||
b | ||||
Angel Ezquerra
|
r16454 | $ hg revert "set:subrepo('glob:s*')" | ||
Angel Ezquerra
|
r16430 | reverting subrepo s | ||
Matt Harbison
|
r35394 | reverting s/a | ||
Matt Harbison
|
r24134 | $ cat s/a | ||
a | ||||
Angel Ezquerra
|
r16430 | $ rm s/a.orig | ||
Angel Ezquerra
|
r15265 | |||
Angel Ezquerra
|
r16430 | 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 | ||||
Angel Ezquerra
|
r15265 | |||
Martin Geisler
|
r12399 | Issue2022: update -C | ||
Martin Geisler
|
r11912 | |||
$ echo b > s/a | ||||
$ hg sum | ||||
parent: 1:7cf8cfea66e4 tip | ||||
1 | ||||
branch: default | ||||
commit: 1 subrepos | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 2 draft | ||
Martin Geisler
|
r11912 | $ hg co -C 1 | ||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg sum | ||||
parent: 1:7cf8cfea66e4 tip | ||||
1 | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 2 draft | ||
Martin Geisler
|
r11912 | |||
Eric Roshan Eisner
|
r15231 | commands that require a clean repo should respect subrepos | ||
$ echo b >> s/a | ||||
$ hg backout tip | ||||
Matt Harbison
|
r33365 | abort: uncommitted changes in subrepository "s" | ||
Eric Roshan Eisner
|
r15231 | [255] | ||
$ hg revert -C -R s s/a | ||||
Martin Geisler
|
r11912 | add sub sub | ||
$ echo ss = ss > s/.hgsub | ||||
$ hg init s/ss | ||||
$ echo a > s/ss/a | ||||
$ hg -R s add s/.hgsub | ||||
$ hg -R s/ss add s/ss/a | ||||
$ hg sum | ||||
parent: 1:7cf8cfea66e4 tip | ||||
1 | ||||
branch: default | ||||
commit: 1 subrepos | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 2 draft | ||
Martin Geisler
|
r11912 | $ hg ci -m2 | ||
committing subrepository s | ||||
Matt Harbison
|
r35394 | committing subrepository s/ss | ||
Martin Geisler
|
r11912 | $ hg sum | ||
parent: 2:df30734270ae tip | ||||
2 | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 3 draft | ||
Martin Geisler
|
r11912 | |||
FUJIWARA Katsunori
|
r20827 | test handling .hgsubstate "modified" explicitly. | ||
$ hg parents --template '{node}\n{files}\n' | ||||
df30734270ae757feb35e643b7018e818e78a9aa | ||||
.hgsubstate | ||||
$ hg rollback -q | ||||
$ hg status -A .hgsubstate | ||||
M .hgsubstate | ||||
$ hg ci -m2 | ||||
$ hg parents --template '{node}\n{files}\n' | ||||
df30734270ae757feb35e643b7018e818e78a9aa | ||||
.hgsubstate | ||||
Patrick Mezard
|
r13411 | bump sub rev (and check it is ignored by ui.commitsubrepos) | ||
Martin Geisler
|
r11912 | |||
$ echo b > s/a | ||||
$ hg -R s ci -ms1 | ||||
Patrick Mezard
|
r13411 | $ hg --config ui.commitsubrepos=no ci -m3 | ||
Martin Geisler
|
r11912 | |||
Patrick Mezard
|
r13411 | leave sub dirty (and check ui.commitsubrepos=no aborts the commit) | ||
Martin Geisler
|
r11912 | |||
$ echo c > s/a | ||||
Patrick Mezard
|
r13411 | $ hg --config ui.commitsubrepos=no ci -m4 | ||
Matt Harbison
|
r33365 | abort: uncommitted changes in subrepository "s" | ||
Martin Geisler
|
r15321 | (use --subrepos for recursive commit) | ||
Patrick Mezard
|
r13411 | [255] | ||
Patrick Mezard
|
r17255 | $ hg id | ||
f6affe3fbfaa+ tip | ||||
$ hg -R s ci -mc | ||||
$ hg id | ||||
f6affe3fbfaa+ tip | ||||
$ echo d > s/a | ||||
Martin Geisler
|
r11912 | $ hg ci -m4 | ||
committing subrepository s | ||||
$ hg tip -R s | ||||
Patrick Mezard
|
r17255 | changeset: 4:02dcf1d70411 | ||
Martin Geisler
|
r11912 | tag: tip | ||
user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: 4 | ||||
check caching | ||||
$ hg co 0 | ||||
0 files updated, 0 files merged, 2 files removed, 0 files unresolved | ||||
$ hg debugsub | ||||
restore | ||||
$ hg co | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
Patrick Mezard
|
r17255 | revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef | ||
Martin Geisler
|
r11912 | |||
new branch for merge tests | ||||
$ hg co 1 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ echo t = t >> .hgsub | ||||
$ hg init t | ||||
$ echo t > t/t | ||||
$ hg -R t add t | ||||
Matt Harbison
|
r35394 | adding t/t | ||
Martin Geisler
|
r11912 | |||
5 | ||||
$ hg ci -m5 # add sub | ||||
committing subrepository t | ||||
created new head | ||||
$ echo t2 > t/t | ||||
6 | ||||
$ hg st -R s | ||||
$ hg ci -m6 # change sub | ||||
committing subrepository t | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 | ||||
path t | ||||
source t | ||||
revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad | ||||
$ echo t3 > t/t | ||||
7 | ||||
$ hg ci -m7 # change sub again for conflict test | ||||
committing subrepository t | ||||
$ hg rm .hgsub | ||||
8 | ||||
$ hg ci -m8 # remove sub | ||||
FUJIWARA Katsunori
|
r20827 | test handling .hgsubstate "removed" explicitly. | ||
$ hg parents --template '{node}\n{files}\n' | ||||
96615c1dad2dc8e3796d7332c77ce69156f7b78e | ||||
.hgsub .hgsubstate | ||||
$ hg rollback -q | ||||
$ hg remove .hgsubstate | ||||
$ hg ci -m8 | ||||
$ hg parents --template '{node}\n{files}\n' | ||||
96615c1dad2dc8e3796d7332c77ce69156f7b78e | ||||
.hgsub .hgsubstate | ||||
Martin Geisler
|
r11912 | merge tests | ||
$ hg co -C 3 | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg merge 5 # test adding | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 | ||||
path t | ||||
source t | ||||
revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382 | ||||
$ hg ci -m9 | ||||
created new head | ||||
$ hg merge 6 --debug # test change | ||||
searching for copies back to rev 2 | ||||
resolving manifests | ||||
Siddharth Agarwal
|
r18605 | branchmerge: True, force: False, partial: False | ||
Martin Geisler
|
r15625 | ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4 | ||
Matt Harbison
|
r28318 | starting 4 threads for background file closing (?) | ||
Siddharth Agarwal
|
r26618 | .hgsubstate: versions differ -> m (premerge) | ||
Martin Geisler
|
r11912 | subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec | ||
subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg | ||||
getting subrepo t | ||||
resolving manifests | ||||
Siddharth Agarwal
|
r18605 | branchmerge: False, force: False, partial: False | ||
Simon Heimberg
|
r17895 | ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a | ||
Martin Geisler
|
r11912 | t: remote is newer -> g | ||
Bryan O'Sullivan
|
r18631 | getting t | ||
Martin Geisler
|
r11912 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
(branch merge, don't forget to commit) | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 | ||||
path t | ||||
source t | ||||
revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad | ||||
$ echo conflict > t/t | ||||
$ hg ci -m10 | ||||
committing subrepository t | ||||
$ HGMERGE=internal:merge hg merge --debug 7 # test conflict | ||||
searching for copies back to rev 2 | ||||
resolving manifests | ||||
Siddharth Agarwal
|
r18605 | branchmerge: True, force: False, partial: False | ||
Martin Geisler
|
r15625 | ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf | ||
Matt Harbison
|
r28318 | starting 4 threads for background file closing (?) | ||
Siddharth Agarwal
|
r26618 | .hgsubstate: versions differ -> m (premerge) | ||
Martin Geisler
|
r11912 | subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4 | ||
Angel Ezquerra
|
r19811 | subrepo t: both sides changed | ||
subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198) | ||||
Simon Farnsworth
|
r30060 | starting 4 threads for background file closing (?) | ||
Simon Farnsworth
|
r30062 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m | ||
Matt Harbison
|
r33365 | merging subrepository "t" | ||
Martin Geisler
|
r11912 | searching for copies back to rev 2 | ||
resolving manifests | ||||
Siddharth Agarwal
|
r18605 | branchmerge: True, force: False, partial: False | ||
Martin Geisler
|
r15625 | ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198 | ||
Mads Kiilerich
|
r21391 | preserving t for resolve of t | ||
Matt Harbison
|
r31772 | starting 4 threads for background file closing (?) | ||
Siddharth Agarwal
|
r26618 | t: versions differ -> m (premerge) | ||
Siddharth Agarwal
|
r27161 | picked tool ':merge' for t (binary False symlink False changedelete False) | ||
Martin Geisler
|
r11912 | merging t | ||
my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a | ||||
Siddharth Agarwal
|
r26618 | t: versions differ -> m (merge) | ||
Siddharth Agarwal
|
r27161 | picked tool ':merge' for t (binary False symlink False changedelete False) | ||
Siddharth Agarwal
|
r26611 | my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a | ||
Siddharth Agarwal
|
r26614 | warning: conflicts while merging t! (edit, then use 'hg resolve --mark') | ||
Martin Geisler
|
r11912 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||
Pulkit Goyal
|
r35722 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | ||
Angel Ezquerra
|
r19811 | subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg | ||
Martin Geisler
|
r11912 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
(branch merge, don't forget to commit) | ||||
should conflict | ||||
$ cat t/t | ||||
Pierre-Yves David
|
r21693 | <<<<<<< local: 20a0db6fbf6c - test: 10 | ||
Martin Geisler
|
r11912 | conflict | ||
======= | ||||
t3 | ||||
Kostia Balytskyi
|
r30460 | >>>>>>> other: 7af322bc1198 - test: 7 | ||
Martin Geisler
|
r11912 | |||
Martin von Zweigbergk
|
r24110 | 11: remove subrepo t | ||
$ hg co -C 5 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg revert -r 4 .hgsub # remove t | ||||
$ hg ci -m11 | ||||
created new head | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 | ||||
local removed, remote changed, keep changed | ||||
$ hg merge 6 | ||||
Simon Farnsworth
|
r31516 | remote [merge rev] changed subrepository t which local [working copy] removed | ||
Martin von Zweigbergk
|
r24110 | use (c)hanged version or (d)elete? c | ||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
BROKEN: should include subrepo t | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 | ||||
$ cat .hgsubstate | ||||
e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | ||||
6747d179aa9a688023c4b0cad32e4c92bb7f34ad t | ||||
$ hg ci -m 'local removed, remote changed, keep changed' | ||||
BROKEN: should include subrepo t | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 | ||||
BROKEN: should include subrepo t | ||||
$ cat .hgsubstate | ||||
e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | ||||
$ cat t/t | ||||
t2 | ||||
local removed, remote changed, keep removed | ||||
$ hg co -C 11 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg merge --config ui.interactive=true 6 <<EOF | ||||
> d | ||||
> EOF | ||||
Simon Farnsworth
|
r31516 | remote [merge rev] changed subrepository t which local [working copy] removed | ||
Martin von Zweigbergk
|
r24110 | use (c)hanged version or (d)elete? d | ||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 | ||||
$ cat .hgsubstate | ||||
e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | ||||
$ hg ci -m 'local removed, remote changed, keep removed' | ||||
created new head | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 | ||||
$ cat .hgsubstate | ||||
e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | ||||
local changed, remote removed, keep changed | ||||
$ hg co -C 6 | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg merge 11 | ||||
Simon Farnsworth
|
r31516 | local [working copy] changed subrepository t which remote [merge rev] removed | ||
Martin von Zweigbergk
|
r24110 | use (c)hanged version or (d)elete? c | ||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
BROKEN: should include subrepo t | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 | ||||
BROKEN: should include subrepo t | ||||
$ cat .hgsubstate | ||||
e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | ||||
$ hg ci -m 'local changed, remote removed, keep changed' | ||||
created new head | ||||
BROKEN: should include subrepo t | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 | ||||
BROKEN: should include subrepo t | ||||
$ cat .hgsubstate | ||||
e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | ||||
$ cat t/t | ||||
t2 | ||||
local changed, remote removed, keep removed | ||||
$ hg co -C 6 | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg merge --config ui.interactive=true 11 <<EOF | ||||
> d | ||||
> EOF | ||||
Simon Farnsworth
|
r31516 | local [working copy] changed subrepository t which remote [merge rev] removed | ||
Martin von Zweigbergk
|
r24110 | use (c)hanged version or (d)elete? d | ||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 | ||||
$ cat .hgsubstate | ||||
e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | ||||
$ hg ci -m 'local changed, remote removed, keep removed' | ||||
created new head | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 | ||||
$ cat .hgsubstate | ||||
e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | ||||
clean up to avoid having to fix up the tests below | ||||
$ hg co -C 10 | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ cat >> $HGRCPATH <<EOF | ||||
> [extensions] | ||||
> strip= | ||||
> EOF | ||||
$ hg strip -r 11:15 | ||||
saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob) | ||||
Martin Geisler
|
r11912 | clone | ||
$ cd .. | ||||
$ hg clone t tc | ||||
updating to branch default | ||||
Simon Heimberg
|
r18720 | cloning subrepo s from $TESTTMP/t/s | ||
Matt Harbison
|
r35394 | cloning subrepo s/ss from $TESTTMP/t/s/ss | ||
Simon Heimberg
|
r18720 | cloning subrepo t from $TESTTMP/t/t | ||
Martin Geisler
|
r11912 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ cd tc | ||||
$ hg debugsub | ||||
path s | ||||
source s | ||||
revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 | ||||
path t | ||||
source t | ||||
revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e | ||||
Yuya Nishihara
|
r34986 | $ cd .. | ||
clone with subrepo disabled (update should fail) | ||||
Gregory Szorc
|
r34990 | $ hg clone t -U tc2 --config subrepos.allowed=false | ||
$ hg update -R tc2 --config subrepos.allowed=false | ||||
abort: subrepos not enabled | ||||
Yuya Nishihara
|
r34986 | (see 'hg help config.subrepos' for details) | ||
[255] | ||||
$ ls tc2 | ||||
a | ||||
Gregory Szorc
|
r34990 | $ hg clone t tc3 --config subrepos.allowed=false | ||
Yuya Nishihara
|
r34986 | updating to branch default | ||
Gregory Szorc
|
r34990 | abort: subrepos not enabled | ||
Yuya Nishihara
|
r34986 | (see 'hg help config.subrepos' for details) | ||
[255] | ||||
$ ls tc3 | ||||
a | ||||
Martin Geisler
|
r11912 | |||
Gregory Szorc
|
r34990 | And again with just the hg type disabled | ||
$ hg clone t -U tc4 --config subrepos.hg:allowed=false | ||||
$ hg update -R tc4 --config subrepos.hg:allowed=false | ||||
abort: hg subrepos not allowed | ||||
Yuya Nishihara
|
r34987 | (see 'hg help config.subrepos' for details) | ||
[255] | ||||
$ ls tc4 | ||||
a | ||||
Gregory Szorc
|
r34990 | $ hg clone t tc5 --config subrepos.hg:allowed=false | ||
updating to branch default | ||||
abort: hg subrepos not allowed | ||||
(see 'hg help config.subrepos' for details) | ||||
[255] | ||||
$ ls tc5 | ||||
a | ||||
Martin Geisler
|
r11912 | push | ||
Yuya Nishihara
|
r34986 | $ cd tc | ||
Martin Geisler
|
r11912 | $ echo bah > t/t | ||
$ hg ci -m11 | ||||
committing subrepository t | ||||
$ hg push | ||||
Matt Harbison
|
r35394 | pushing to $TESTTMP/t | ||
no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss | ||||
Angel Ezquerra
|
r18941 | no changes made to subrepo s since last push to $TESTTMP/t/s | ||
Simon Heimberg
|
r18720 | pushing subrepo t to $TESTTMP/t/t | ||
Martin Geisler
|
r11912 | searching for changes | ||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
searching for changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
push -f | ||||
$ echo bah > s/a | ||||
$ hg ci -m12 | ||||
committing subrepository s | ||||
$ hg push | ||||
Matt Harbison
|
r35394 | pushing to $TESTTMP/t | ||
no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss | ||||
Simon Heimberg
|
r18720 | pushing subrepo s to $TESTTMP/t/s | ||
Martin Geisler
|
r11912 | searching for changes | ||
Matt Harbison
|
r33365 | abort: push creates new remote head 12a213df6fa9! (in subrepository "s") | ||
timeless
|
r29973 | (merge or see 'hg help push' for details about pushing new heads) | ||
Matt Mackall
|
r12316 | [255] | ||
Martin Geisler
|
r11912 | $ hg push -f | ||
Matt Harbison
|
r35394 | pushing to $TESTTMP/t | ||
pushing subrepo s/ss to $TESTTMP/t/s/ss | ||||
Martin Geisler
|
r11912 | searching for changes | ||
no changes found | ||||
Simon Heimberg
|
r18720 | pushing subrepo s to $TESTTMP/t/s | ||
Martin Geisler
|
r11912 | searching for changes | ||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files (+1 heads) | ||||
Simon Heimberg
|
r18720 | pushing subrepo t to $TESTTMP/t/t | ||
Martin Geisler
|
r11912 | searching for changes | ||
no changes found | ||||
searching for changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
Angel Ezquerra
|
r18941 | check that unmodified subrepos are not pushed | ||
$ hg clone . ../tcc | ||||
updating to branch default | ||||
cloning subrepo s from $TESTTMP/tc/s | ||||
Matt Harbison
|
r35394 | cloning subrepo s/ss from $TESTTMP/tc/s/ss | ||
Angel Ezquerra
|
r18941 | cloning subrepo t from $TESTTMP/tc/t | ||
3 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
the subrepos on the new clone have nothing to push to its source | ||||
$ hg push -R ../tcc . | ||||
pushing to . | ||||
Matt Harbison
|
r35394 | no changes made to subrepo s/ss since last push to s/ss | ||
Angel Ezquerra
|
r18941 | no changes made to subrepo s since last push to s | ||
no changes made to subrepo t since last push to t | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
the subrepos on the source do not have a clean store versus the clone target | ||||
because they were never explicitly pushed to the source | ||||
$ hg push ../tcc | ||||
pushing to ../tcc | ||||
Matt Harbison
|
r35394 | pushing subrepo s/ss to ../tcc/s/ss | ||
Angel Ezquerra
|
r18941 | searching for changes | ||
no changes found | ||||
pushing subrepo s to ../tcc/s | ||||
searching for changes | ||||
no changes found | ||||
pushing subrepo t to ../tcc/t | ||||
searching for changes | ||||
no changes found | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
after push their stores become clean | ||||
$ hg push ../tcc | ||||
pushing to ../tcc | ||||
Matt Harbison
|
r35394 | no changes made to subrepo s/ss since last push to ../tcc/s/ss | ||
Angel Ezquerra
|
r18941 | no changes made to subrepo s since last push to ../tcc/s | ||
no changes made to subrepo t since last push to ../tcc/t | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
updating a subrepo to a different revision or changing | ||||
its working directory does not make its store dirty | ||||
$ hg -R s update '.^' | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg push | ||||
Matt Harbison
|
r35394 | pushing to $TESTTMP/t | ||
no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss | ||||
Angel Ezquerra
|
r18941 | no changes made to subrepo s since last push to $TESTTMP/t/s | ||
no changes made to subrepo t since last push to $TESTTMP/t/t | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
$ echo foo >> s/a | ||||
$ hg push | ||||
Matt Harbison
|
r35394 | pushing to $TESTTMP/t | ||
no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss | ||||
Angel Ezquerra
|
r18941 | no changes made to subrepo s since last push to $TESTTMP/t/s | ||
no changes made to subrepo t since last push to $TESTTMP/t/t | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
$ hg -R s update -C tip | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
committing into a subrepo makes its store (but not its parent's store) dirty | ||||
$ echo foo >> s/ss/a | ||||
$ hg -R s/ss commit -m 'test dirty store detection' | ||||
Matt Harbison
|
r24875 | |||
$ hg out -S -r `hg log -r tip -T "{node|short}"` | ||||
Matt Harbison
|
r35394 | comparing with $TESTTMP/t | ||
Matt Harbison
|
r24875 | searching for changes | ||
no changes found | ||||
comparing with $TESTTMP/t/s | ||||
searching for changes | ||||
no changes found | ||||
comparing with $TESTTMP/t/s/ss | ||||
searching for changes | ||||
changeset: 1:79ea5566a333 | ||||
tag: tip | ||||
user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: test dirty store detection | ||||
comparing with $TESTTMP/t/t | ||||
searching for changes | ||||
no changes found | ||||
Angel Ezquerra
|
r18941 | $ hg push | ||
Matt Harbison
|
r35394 | pushing to $TESTTMP/t | ||
pushing subrepo s/ss to $TESTTMP/t/s/ss | ||||
Angel Ezquerra
|
r18941 | searching for changes | ||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
no changes made to subrepo s since last push to $TESTTMP/t/s | ||||
no changes made to subrepo t since last push to $TESTTMP/t/t | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
a subrepo store may be clean versus one repo but not versus another | ||||
$ hg push | ||||
Matt Harbison
|
r35394 | pushing to $TESTTMP/t | ||
no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss | ||||
Angel Ezquerra
|
r18941 | no changes made to subrepo s since last push to $TESTTMP/t/s | ||
no changes made to subrepo t since last push to $TESTTMP/t/t | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
$ hg push ../tcc | ||||
pushing to ../tcc | ||||
Matt Harbison
|
r35394 | pushing subrepo s/ss to ../tcc/s/ss | ||
Angel Ezquerra
|
r18941 | searching for changes | ||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
no changes made to subrepo s since last push to ../tcc/s | ||||
no changes made to subrepo t since last push to ../tcc/t | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
Martin Geisler
|
r11912 | update | ||
$ cd ../t | ||||
$ hg up -C # discard our earlier merge | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
Pulkit Goyal
|
r32698 | updated to "c373c8102e68: 12" | ||
Pierre-Yves David
|
r28029 | 2 other heads for branch "default" | ||
Martin Geisler
|
r11912 | $ echo blah > t/t | ||
$ hg ci -m13 | ||||
committing subrepository t | ||||
Yuya Nishihara
|
r18943 | backout calls revert internally with minimal opts, which should not raise | ||
KeyError | ||||
Ruslan Sayfutdinov
|
r27890 | $ hg backout ".^" --no-commit | ||
Yuya Nishihara
|
r18943 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
Pierre-Yves David
|
r20276 | changeset c373c8102e68 backed out, don't forget to commit. | ||
Yuya Nishihara
|
r18943 | |||
$ hg up -C # discard changes | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
Pulkit Goyal
|
r32698 | updated to "925c17564ef8: 13" | ||
Pierre-Yves David
|
r28029 | 2 other heads for branch "default" | ||
Yuya Nishihara
|
r18943 | |||
Martin Geisler
|
r11912 | pull | ||
$ cd ../tc | ||||
$ hg pull | ||||
Matt Harbison
|
r35394 | pulling from $TESTTMP/t | ||
Martin Geisler
|
r11912 | searching for changes | ||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
Denis Laxalde
|
r34662 | new changesets 925c17564ef8 | ||
Martin Geisler
|
r11912 | (run 'hg update' to get a working copy) | ||
should pull t | ||||
Matt Harbison
|
r24876 | $ hg incoming -S -r `hg log -r tip -T "{node|short}"` | ||
Matt Harbison
|
r35394 | comparing with $TESTTMP/t | ||
Matt Harbison
|
r24876 | no changes found | ||
comparing with $TESTTMP/t/s | ||||
searching for changes | ||||
no changes found | ||||
comparing with $TESTTMP/t/s/ss | ||||
searching for changes | ||||
no changes found | ||||
comparing with $TESTTMP/t/t | ||||
searching for changes | ||||
changeset: 5:52c0adc0515a | ||||
tag: tip | ||||
user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: 13 | ||||
Martin Geisler
|
r11912 | $ hg up | ||
Simon Heimberg
|
r18720 | pulling subrepo t from $TESTTMP/t/t | ||
Martin Geisler
|
r11912 | searching for changes | ||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
Denis Laxalde
|
r34662 | new changesets 52c0adc0515a | ||
Angel Ezquerra
|
r18941 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
Pulkit Goyal
|
r32698 | updated to "925c17564ef8: 13" | ||
Pierre-Yves David
|
r28029 | 2 other heads for branch "default" | ||
Martin Geisler
|
r11912 | $ cat t/t | ||
blah | ||||
bogus subrepo path aborts | ||||
$ echo 'bogus=[boguspath' >> .hgsub | ||||
$ hg ci -m 'bogus subrepo path' | ||||
Matt Harbison
|
r33365 | abort: missing ] in subrepository source | ||
Matt Mackall
|
r12316 | [255] | ||
Martin Geisler
|
r11912 | |||
Martin Geisler
|
r12399 | Issue1986: merge aborts when trying to merge a subrepo that | ||
shouldn't need merging | ||||
Martin Geisler
|
r11912 | |||
# subrepo layout | ||||
# | ||||
# o 5 br | ||||
# /| | ||||
# o | 4 default | ||||
# | | | ||||
# | o 3 br | ||||
# |/| | ||||
# o | 2 default | ||||
# | | | ||||
# | o 1 br | ||||
# |/ | ||||
# o 0 default | ||||
$ cd .. | ||||
$ rm -rf sub | ||||
$ hg init main | ||||
$ cd main | ||||
$ hg init s | ||||
$ cd s | ||||
$ echo a > a | ||||
$ hg ci -Am1 | ||||
adding a | ||||
$ hg branch br | ||||
marked working directory as branch br | ||||
Matt Mackall
|
r15615 | (branches are permanent and global, did you want a bookmark?) | ||
Martin Geisler
|
r11912 | $ echo a >> a | ||
$ hg ci -m1 | ||||
$ hg up default | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ echo b > b | ||||
$ hg ci -Am1 | ||||
adding b | ||||
$ hg up br | ||||
1 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ hg merge tip | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ hg ci -m1 | ||||
$ hg up 2 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ echo c > c | ||||
$ hg ci -Am1 | ||||
adding c | ||||
$ hg up 3 | ||||
1 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ hg merge 4 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ hg ci -m1 | ||||
# main repo layout: | ||||
# | ||||
# * <-- try to merge default into br again | ||||
# .`| | ||||
# . o 5 br --> substate = 5 | ||||
# . | | ||||
# o | 4 default --> substate = 4 | ||||
# | | | ||||
# | o 3 br --> substate = 2 | ||||
# |/| | ||||
# o | 2 default --> substate = 2 | ||||
# | | | ||||
# | o 1 br --> substate = 3 | ||||
# |/ | ||||
# o 0 default --> substate = 2 | ||||
$ cd .. | ||||
$ echo 's = s' > .hgsub | ||||
$ hg -R s up 2 | ||||
1 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ hg ci -Am1 | ||||
adding .hgsub | ||||
$ hg branch br | ||||
marked working directory as branch br | ||||
Matt Mackall
|
r15615 | (branches are permanent and global, did you want a bookmark?) | ||
Martin Geisler
|
r11912 | $ 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 | ||||
$ hg up default | ||||
1 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ echo c > c | ||||
$ hg ci -Am1 | ||||
adding c | ||||
$ hg up 1 | ||||
2 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ hg merge 2 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ hg ci -m1 | ||||
$ hg up 2 | ||||
1 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ hg -R s up 4 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ echo d > d | ||||
$ hg ci -Am1 | ||||
adding d | ||||
$ hg up 3 | ||||
2 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ hg -R s up 5 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ echo e > e | ||||
$ hg ci -Am1 | ||||
adding e | ||||
$ hg up 5 | ||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg merge 4 # try to merge default into br again | ||||
Angel Ezquerra
|
r19811 | subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88) | ||
Simon Farnsworth
|
r30062 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m | ||
Martin Geisler
|
r11912 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
(branch merge, don't forget to commit) | ||||
$ cd .. | ||||
test subrepo delete from .hgsubstate | ||||
$ hg init testdelete | ||||
$ mkdir testdelete/nested testdelete/nested2 | ||||
$ hg init testdelete/nested | ||||
$ hg init testdelete/nested2 | ||||
$ echo test > testdelete/nested/foo | ||||
$ echo test > testdelete/nested2/foo | ||||
$ hg -R testdelete/nested add | ||||
Matt Harbison
|
r35394 | adding testdelete/nested/foo | ||
Martin Geisler
|
r11912 | $ hg -R testdelete/nested2 add | ||
Matt Harbison
|
r35394 | adding testdelete/nested2/foo | ||
Martin Geisler
|
r11912 | $ 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 | ||||
Matt Harbison
|
r35394 | adding testdelete/.hgsub | ||
Martin Geisler
|
r11912 | $ hg -R testdelete ci -m "nested 1 & 2 added" | ||
$ echo nested = nested > testdelete/.hgsub | ||||
$ hg -R testdelete ci -m "nested 2 deleted" | ||||
$ cat testdelete/.hgsubstate | ||||
bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested | ||||
$ hg -R testdelete remove testdelete/.hgsub | ||||
$ hg -R testdelete ci -m ".hgsub deleted" | ||||
$ cat testdelete/.hgsubstate | ||||
Matt Mackall
|
r14536 | bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested | ||
Martin Geisler
|
r11912 | |||
test repository cloning | ||||
$ mkdir mercurial mercurial2 | ||||
$ hg init nested_absolute | ||||
$ echo test > nested_absolute/foo | ||||
$ hg -R nested_absolute add | ||||
Matt Harbison
|
r35394 | adding nested_absolute/foo | ||
Martin Geisler
|
r11912 | $ hg -R nested_absolute ci -mtest | ||
$ cd mercurial | ||||
$ hg init nested_relative | ||||
$ echo test2 > nested_relative/foo2 | ||||
$ hg -R nested_relative add | ||||
Matt Harbison
|
r35394 | adding nested_relative/foo2 | ||
Martin Geisler
|
r11912 | $ 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 | ||||
Matt Harbison
|
r35394 | adding main/.hgsub | ||
Martin Geisler
|
r11912 | $ hg -R main ci -m "add subrepos" | ||
$ cd .. | ||||
$ hg clone mercurial/main mercurial2/main | ||||
updating to branch default | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ cat mercurial2/main/nested_absolute/.hg/hgrc \ | ||||
> mercurial2/main/nested_relative/.hg/hgrc | ||||
[paths] | ||||
Mads Kiilerich
|
r16912 | default = $TESTTMP/mercurial/nested_absolute | ||
Martin Geisler
|
r11912 | [paths] | ||
Mads Kiilerich
|
r16912 | default = $TESTTMP/mercurial/nested_relative | ||
Martin Geisler
|
r11912 | $ rm -rf mercurial mercurial2 | ||
Martin Geisler
|
r12399 | Issue1977: multirepo push should fail if subrepo push fails | ||
Martin Geisler
|
r11912 | |||
$ hg init repo | ||||
$ hg init repo/s | ||||
$ echo a > repo/s/a | ||||
$ hg -R repo/s ci -Am0 | ||||
adding a | ||||
$ echo s = s > repo/.hgsub | ||||
$ hg -R repo ci -Am1 | ||||
adding .hgsub | ||||
$ hg clone repo repo2 | ||||
updating to branch default | ||||
Simon Heimberg
|
r18720 | cloning subrepo s from $TESTTMP/repo/s | ||
Martin Geisler
|
r11912 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ hg -q -R repo2 pull -u | ||||
$ echo 1 > repo2/s/a | ||||
$ hg -R repo2/s ci -m2 | ||||
$ hg -q -R repo2/s push | ||||
$ hg -R repo2/s up -C 0 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
Simon Heimberg
|
r17895 | $ echo 2 > repo2/s/b | ||
$ hg -R repo2/s ci -m3 -A | ||||
adding b | ||||
Martin Geisler
|
r11912 | created new head | ||
$ hg -R repo2 ci -m3 | ||||
$ hg -q -R repo2 push | ||||
Matt Harbison
|
r33365 | abort: push creates new remote head cc505f09a8b2! (in subrepository "s") | ||
timeless
|
r29973 | (merge or see 'hg help push' for details about pushing new heads) | ||
Matt Mackall
|
r12316 | [255] | ||
Martin Geisler
|
r11912 | $ hg -R repo update | ||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
Simon Heimberg
|
r17895 | |||
test if untracked file is not overwritten | ||||
FUJIWARA Katsunori
|
r25753 | (this also tests that updated .hgsubstate is treated as "modified", | ||
when 'merge.update()' is aborted before 'merge.recordupdates()', even | ||||
if none of mode, size and timestamp of it isn't changed on the | ||||
filesystem (see also issue4583)) | ||||
Simon Heimberg
|
r17895 | $ echo issue3276_ok > repo/s/b | ||
$ hg -R repo2 push -f -q | ||||
FUJIWARA Katsunori
|
r23971 | $ touch -t 200001010000 repo/.hgsubstate | ||
FUJIWARA Katsunori
|
r25753 | |||
$ cat >> repo/.hg/hgrc <<EOF | ||||
> [fakedirstatewritetime] | ||||
> # emulate invoking dirstate.write() via repo.status() | ||||
> # at 2000-01-01 00:00 | ||||
> fakenow = 200001010000 | ||||
> | ||||
> [extensions] | ||||
> fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py | ||||
> EOF | ||||
Simon Heimberg
|
r17895 | $ hg -R repo update | ||
b: untracked file differs | ||||
Matt Harbison
|
r33365 | abort: untracked files in working directory differ from files in requested revision (in subrepository "s") | ||
Simon Heimberg
|
r17895 | [255] | ||
FUJIWARA Katsunori
|
r25753 | $ cat >> repo/.hg/hgrc <<EOF | ||
> [extensions] | ||||
> fakedirstatewritetime = ! | ||||
> EOF | ||||
Simon Heimberg
|
r17895 | |||
$ cat repo/s/b | ||||
issue3276_ok | ||||
$ rm repo/s/b | ||||
FUJIWARA Katsunori
|
r23971 | $ touch -t 200001010000 repo/.hgsubstate | ||
Simon Heimberg
|
r17895 | $ hg -R repo revert --all | ||
Matt Harbison
|
r35394 | reverting repo/.hgsubstate | ||
Simon Heimberg
|
r17895 | reverting subrepo s | ||
$ hg -R repo update | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ cat repo/s/b | ||||
2 | ||||
Martin Geisler
|
r11912 | $ rm -rf repo2 repo | ||
Mads Kiilerich
|
r12753 | |||
Issue1852 subrepos with relative paths always push/pull relative to default | ||||
Prepare a repo with subrepo | ||||
$ hg init issue1852a | ||||
$ cd issue1852a | ||||
$ hg init sub/repo | ||||
$ echo test > sub/repo/foo | ||||
$ hg -R sub/repo add sub/repo/foo | ||||
$ echo sub/repo = sub/repo > .hgsub | ||||
$ hg add .hgsub | ||||
$ hg ci -mtest | ||||
Matt Harbison
|
r35394 | committing subrepository sub/repo | ||
Mads Kiilerich
|
r12753 | $ echo test >> sub/repo/foo | ||
$ hg ci -mtest | ||||
Matt Harbison
|
r35394 | committing subrepository sub/repo | ||
Matt Harbison
|
r21041 | $ hg cat sub/repo/foo | ||
test | ||||
test | ||||
Matt Harbison
|
r32678 | $ hg cat sub/repo/foo -Tjson | sed 's|\\\\|/|g' | ||
Yuya Nishihara
|
r32578 | [ | ||
{ | ||||
"abspath": "foo", | ||||
"data": "test\ntest\n", | ||||
Matt Harbison
|
r32678 | "path": "sub/repo/foo" | ||
Yuya Nishihara
|
r32578 | } | ||
] | ||||
Yuya Nishihara
|
r35166 | |||
non-exact match: | ||||
$ hg cat -T '{path}\n' 'glob:**' | ||||
.hgsub | ||||
.hgsubstate | ||||
Matt Harbison
|
r35394 | sub/repo/foo | ||
Yuya Nishihara
|
r35166 | $ hg cat -T '{path}\n' 're:^sub' | ||
Matt Harbison
|
r35394 | sub/repo/foo | ||
Yuya Nishihara
|
r35166 | |||
missing subrepos in working directory: | ||||
Matt Harbison
|
r21041 | $ mkdir -p tmp/sub/repo | ||
$ hg cat -r 0 --output tmp/%p_p sub/repo/foo | ||||
$ cat tmp/sub/repo/foo_p | ||||
test | ||||
$ mv sub/repo sub_ | ||||
$ hg cat sub/repo/baz | ||||
skipping missing subrepository: sub/repo | ||||
[1] | ||||
$ rm -rf sub/repo | ||||
$ mv sub_ sub/repo | ||||
Mads Kiilerich
|
r12753 | $ cd .. | ||
Create repo without default path, pull top repo, and see what happens on update | ||||
$ hg init issue1852b | ||||
$ hg -R issue1852b pull issue1852a | ||||
pulling from issue1852a | ||||
requesting all changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 2 changesets with 3 changes to 2 files | ||||
Denis Laxalde
|
r34662 | new changesets 19487b456929:be5eb94e7215 | ||
Mads Kiilerich
|
r12753 | (run 'hg update' to get a working copy) | ||
$ hg -R issue1852b update | ||||
Matt Harbison
|
r35394 | abort: default path for subrepository not found (in subrepository "sub/repo") | ||
Mads Kiilerich
|
r12753 | [255] | ||
Matt Harbison
|
r18965 | Ensure a full traceback, not just the SubrepoAbort part | ||
Pierre-Yves David
|
r26587 | $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort' | ||
raise error.Abort(_("default path for subrepository not found")) | ||||
Matt Harbison
|
r18965 | |||
Mads Kiilerich
|
r12753 | Pull -u now doesn't help | ||
$ hg -R issue1852b pull -u issue1852a | ||||
pulling from issue1852a | ||||
searching for changes | ||||
no changes found | ||||
Try the same, but with pull -u | ||||
$ hg init issue1852c | ||||
$ hg -R issue1852c pull -r0 -u issue1852a | ||||
pulling from issue1852a | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 2 changes to 2 files | ||||
Denis Laxalde
|
r34662 | new changesets 19487b456929 | ||
Matt Harbison
|
r35394 | cloning subrepo sub/repo from issue1852a/sub/repo | ||
Mads Kiilerich
|
r12852 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
Mads Kiilerich
|
r12753 | |||
Try to push from the other side | ||||
Mads Kiilerich
|
r12852 | $ hg -R issue1852a push `pwd`/issue1852c | ||
Matt Harbison
|
r35394 | pushing to $TESTTMP/issue1852c | ||
pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo | ||||
Mads Kiilerich
|
r12852 | searching for changes | ||
no changes found | ||||
searching for changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
Oleg Stepanov
|
r13233 | |||
Martin Geisler
|
r14360 | Incoming and outgoing should not use the default path: | ||
$ hg clone -q issue1852a issue1852d | ||||
$ hg -R issue1852d outgoing --subrepos issue1852c | ||||
comparing with issue1852c | ||||
searching for changes | ||||
no changes found | ||||
comparing with issue1852c/sub/repo | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
$ hg -R issue1852d incoming --subrepos issue1852c | ||||
comparing with issue1852c | ||||
searching for changes | ||||
no changes found | ||||
comparing with issue1852c/sub/repo | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
Matt Harbison
|
r24858 | Check that merge of a new subrepo doesn't write the uncommitted state to | ||
.hgsubstate (issue4622) | ||||
$ hg init issue1852a/addedsub | ||||
$ echo zzz > issue1852a/addedsub/zz.txt | ||||
$ hg -R issue1852a/addedsub ci -Aqm "initial ZZ" | ||||
$ hg clone issue1852a/addedsub issue1852d/addedsub | ||||
updating to branch default | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ echo def > issue1852a/sub/repo/foo | ||||
$ hg -R issue1852a ci -SAm 'tweaked subrepo' | ||||
adding tmp/sub/repo/foo_p | ||||
Matt Harbison
|
r35394 | committing subrepository sub/repo | ||
Matt Harbison
|
r24858 | |||
$ echo 'addedsub = addedsub' >> issue1852d/.hgsub | ||||
$ echo xyz > issue1852d/sub/repo/foo | ||||
$ hg -R issue1852d pull -u | ||||
Matt Harbison
|
r35394 | pulling from $TESTTMP/issue1852a | ||
Matt Harbison
|
r24858 | searching for changes | ||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 2 changes to 2 files | ||||
Denis Laxalde
|
r34662 | new changesets c82b79fdcc5b | ||
Matt Harbison
|
r24858 | subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c) | ||
Simon Farnsworth
|
r30060 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | ||
Matt Harbison
|
r35394 | pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo | ||
Matt Harbison
|
r24858 | searching for changes | ||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
Denis Laxalde
|
r34662 | new changesets 46cd4aac504c | ||
Matt Harbison
|
r35394 | subrepository sources for sub/repo differ | ||
Matt Harbison
|
r24858 | use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l | ||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ cat issue1852d/.hgsubstate | ||||
f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo | ||||
Oleg Stepanov
|
r13233 | Check status of files when none of them belong to the first | ||
subrepository: | ||||
$ hg init subrepo-status | ||||
$ cd subrepo-status | ||||
$ hg init subrepo-1 | ||||
$ hg init subrepo-2 | ||||
$ cd subrepo-2 | ||||
$ touch file | ||||
$ hg add file | ||||
$ cd .. | ||||
$ echo subrepo-1 = subrepo-1 > .hgsub | ||||
$ echo subrepo-2 = subrepo-2 >> .hgsub | ||||
$ hg add .hgsub | ||||
$ hg ci -m 'Added subrepos' | ||||
committing subrepository subrepo-2 | ||||
$ hg st subrepo-2/file | ||||
Erik Zielke
|
r13322 | |||
simon@laptop-tosh
|
r17938 | Check that share works with subrepo | ||
$ hg --config extensions.share= share . ../shared | ||||
updating working directory | ||||
Matt Harbison
|
r34816 | sharing subrepo subrepo-1 from $TESTTMP/subrepo-status/subrepo-1 | ||
sharing subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2 | ||||
simon@laptop-tosh
|
r17938 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
Matt Harbison
|
r34816 | $ find ../shared/* | sort | ||
../shared/subrepo-1 | ||||
../shared/subrepo-1/.hg | ||||
../shared/subrepo-1/.hg/cache | ||||
../shared/subrepo-1/.hg/cache/storehash | ||||
../shared/subrepo-1/.hg/cache/storehash/* (glob) | ||||
../shared/subrepo-1/.hg/hgrc | ||||
../shared/subrepo-1/.hg/requires | ||||
../shared/subrepo-1/.hg/sharedpath | ||||
../shared/subrepo-2 | ||||
../shared/subrepo-2/.hg | ||||
../shared/subrepo-2/.hg/branch | ||||
../shared/subrepo-2/.hg/cache | ||||
../shared/subrepo-2/.hg/cache/checkisexec (execbit !) | ||||
../shared/subrepo-2/.hg/cache/checklink (symlink !) | ||||
../shared/subrepo-2/.hg/cache/checklink-target (symlink !) | ||||
../shared/subrepo-2/.hg/cache/storehash | ||||
../shared/subrepo-2/.hg/cache/storehash/* (glob) | ||||
../shared/subrepo-2/.hg/dirstate | ||||
../shared/subrepo-2/.hg/hgrc | ||||
../shared/subrepo-2/.hg/requires | ||||
../shared/subrepo-2/.hg/sharedpath | ||||
../shared/subrepo-2/file | ||||
Matt Harbison
|
r18510 | $ hg -R ../shared in | ||
Matt Harbison
|
r18511 | abort: repository default not found! | ||
[255] | ||||
Matt Harbison
|
r18510 | $ hg -R ../shared/subrepo-2 showconfig paths | ||
paths.default=$TESTTMP/subrepo-status/subrepo-2 | ||||
$ hg -R ../shared/subrepo-1 sum --remote | ||||
parent: -1:000000000000 tip (empty repository) | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
remote: (synced) | ||||
simon@laptop-tosh
|
r17938 | |||
Erik Zielke
|
r13322 | Check hg update --clean | ||
Mads Kiilerich
|
r16912 | $ cd $TESTTMP/t | ||
Erik Zielke
|
r13322 | $ rm -r t/t.orig | ||
$ hg status -S --all | ||||
C .hgsub | ||||
C .hgsubstate | ||||
C a | ||||
C s/.hgsub | ||||
C s/.hgsubstate | ||||
C s/a | ||||
C s/ss/a | ||||
C t/t | ||||
$ echo c1 > s/a | ||||
$ cd s | ||||
$ echo c1 > b | ||||
$ echo c1 > c | ||||
$ hg add b | ||||
$ cd .. | ||||
$ hg status -S | ||||
M s/a | ||||
A s/b | ||||
? s/c | ||||
$ hg update -C | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
Pulkit Goyal
|
r32698 | updated to "925c17564ef8: 13" | ||
Pierre-Yves David
|
r28029 | 2 other heads for branch "default" | ||
Erik Zielke
|
r13322 | $ hg status -S | ||
? s/b | ||||
? s/c | ||||
Erik Zielke
|
r13417 | |||
Sticky subrepositories, no changes | ||||
Mads Kiilerich
|
r16912 | $ cd $TESTTMP/t | ||
Erik Zielke
|
r13417 | $ hg id | ||
925c17564ef8 tip | ||||
$ hg -R s id | ||||
12a213df6fa9 tip | ||||
Mads Kiilerich
|
r17345 | $ hg -R t id | ||
Erik Zielke
|
r13417 | 52c0adc0515a tip | ||
$ hg update 11 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg id | ||||
365661e5936a | ||||
$ hg -R s id | ||||
fc627a69481f | ||||
Mads Kiilerich
|
r17345 | $ hg -R t id | ||
Erik Zielke
|
r13417 | e95bcfa18a35 | ||
Mads Kiilerich
|
r21024 | Sticky subrepositories, file changes | ||
Erik Zielke
|
r13417 | $ touch s/f1 | ||
$ touch t/f1 | ||||
$ hg add -S s/f1 | ||||
$ hg add -S t/f1 | ||||
$ hg id | ||||
Patrick Mezard
|
r17255 | 365661e5936a+ | ||
Erik Zielke
|
r13417 | $ hg -R s id | ||
fc627a69481f+ | ||||
Mads Kiilerich
|
r17345 | $ hg -R t id | ||
Erik Zielke
|
r13417 | e95bcfa18a35+ | ||
$ hg update tip | ||||
Angel Ezquerra
|
r19811 | subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9) | ||
Simon Farnsworth
|
r30060 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | ||
Erik Zielke
|
r13417 | subrepository sources for s differ | ||
Mads Kiilerich
|
r22590 | use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l | ||
Angel Ezquerra
|
r19811 | subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a) | ||
Simon Farnsworth
|
r30060 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | ||
Erik Zielke
|
r13417 | subrepository sources for t differ | ||
Mads Kiilerich
|
r22590 | use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l | ||
Erik Zielke
|
r13417 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ hg id | ||||
925c17564ef8+ tip | ||||
$ hg -R s id | ||||
fc627a69481f+ | ||||
Mads Kiilerich
|
r17345 | $ hg -R t id | ||
Erik Zielke
|
r13417 | e95bcfa18a35+ | ||
$ hg update --clean tip | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
Sticky subrepository, revision updates | ||||
$ hg id | ||||
925c17564ef8 tip | ||||
$ hg -R s id | ||||
12a213df6fa9 tip | ||||
Mads Kiilerich
|
r17345 | $ hg -R t id | ||
Erik Zielke
|
r13417 | 52c0adc0515a tip | ||
$ cd s | ||||
$ hg update -r -2 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ cd ../t | ||||
$ hg update -r 2 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ cd .. | ||||
$ hg update 10 | ||||
Angel Ezquerra
|
r19811 | subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f) | ||
Simon Farnsworth
|
r30060 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | ||
Angel Ezquerra
|
r19811 | subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c) | ||
Simon Farnsworth
|
r30060 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | ||
Erik Zielke
|
r13417 | subrepository sources for t differ (in checked out version) | ||
Mads Kiilerich
|
r22590 | use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l | ||
Erik Zielke
|
r13417 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ hg id | ||||
e45c8b14af55+ | ||||
$ hg -R s id | ||||
Patrick Mezard
|
r17255 | 02dcf1d70411 | ||
Mads Kiilerich
|
r17345 | $ hg -R t id | ||
Erik Zielke
|
r13417 | 7af322bc1198 | ||
Sticky subrepository, file changes and revision updates | ||||
$ touch s/f1 | ||||
$ touch t/f1 | ||||
$ hg add -S s/f1 | ||||
$ hg add -S t/f1 | ||||
$ hg id | ||||
e45c8b14af55+ | ||||
$ hg -R s id | ||||
Patrick Mezard
|
r17255 | 02dcf1d70411+ | ||
Mads Kiilerich
|
r17345 | $ hg -R t id | ||
Erik Zielke
|
r13417 | 7af322bc1198+ | ||
$ hg update tip | ||||
Angel Ezquerra
|
r19811 | subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9) | ||
Simon Farnsworth
|
r30060 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | ||
Erik Zielke
|
r13417 | subrepository sources for s differ | ||
Mads Kiilerich
|
r22590 | use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l | ||
Angel Ezquerra
|
r19811 | subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a) | ||
Simon Farnsworth
|
r30060 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | ||
Erik Zielke
|
r13417 | subrepository sources for t differ | ||
Mads Kiilerich
|
r22590 | use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l | ||
Erik Zielke
|
r13417 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ hg id | ||||
Patrick Mezard
|
r17255 | 925c17564ef8+ tip | ||
Erik Zielke
|
r13417 | $ hg -R s id | ||
Patrick Mezard
|
r17255 | 02dcf1d70411+ | ||
Mads Kiilerich
|
r17345 | $ hg -R t id | ||
Erik Zielke
|
r13417 | 7af322bc1198+ | ||
Sticky repository, update --clean | ||||
$ hg update --clean tip | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg id | ||||
925c17564ef8 tip | ||||
$ hg -R s id | ||||
12a213df6fa9 tip | ||||
Mads Kiilerich
|
r17345 | $ hg -R t id | ||
Erik Zielke
|
r13417 | 52c0adc0515a tip | ||
Test subrepo already at intended revision: | ||||
$ cd s | ||||
$ hg update fc627a69481f | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ cd .. | ||||
$ hg update 11 | ||||
Angel Ezquerra
|
r19811 | subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f) | ||
Simon Farnsworth
|
r30060 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | ||
Erik Zielke
|
r13417 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg id -n | ||||
11+ | ||||
$ hg -R s id | ||||
fc627a69481f | ||||
Mads Kiilerich
|
r17345 | $ hg -R t id | ||
Erik Zielke
|
r13417 | e95bcfa18a35 | ||
Matt Mackall
|
r14536 | |||
Test that removing .hgsubstate doesn't break anything: | ||||
$ hg rm -f .hgsubstate | ||||
$ hg ci -mrm | ||||
Matt Mackall
|
r16073 | nothing changed | ||
[1] | ||||
Matt Mackall
|
r14536 | $ hg log -vr tip | ||
Matt Mackall
|
r16073 | changeset: 13:925c17564ef8 | ||
Matt Mackall
|
r14536 | tag: tip | ||
user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
Matt Mackall
|
r16073 | files: .hgsubstate | ||
Matt Mackall
|
r14536 | description: | ||
Matt Mackall
|
r16073 | 13 | ||
Matt Mackall
|
r14536 | |||
Test that removing .hgsub removes .hgsubstate: | ||||
$ hg rm .hgsub | ||||
$ hg ci -mrm2 | ||||
Matt Mackall
|
r16073 | created new head | ||
Matt Mackall
|
r14536 | $ hg log -vr tip | ||
Matt Mackall
|
r16073 | changeset: 14:2400bccd50af | ||
Matt Mackall
|
r14536 | tag: tip | ||
Matt Mackall
|
r16073 | parent: 11:365661e5936a | ||
Matt Mackall
|
r14536 | user: test | ||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
files: .hgsub .hgsubstate | ||||
description: | ||||
rm2 | ||||
Martin Geisler
|
r15635 | Test issue3153: diff -S with deleted subrepos | ||
$ hg diff --nodates -S -c . | ||||
Matt Mackall
|
r16073 | diff -r 365661e5936a -r 2400bccd50af .hgsub | ||
Martin Geisler
|
r15635 | --- a/.hgsub | ||
+++ /dev/null | ||||
@@ -1,2 +0,0 @@ | ||||
-s = s | ||||
-t = t | ||||
Matt Mackall
|
r16073 | diff -r 365661e5936a -r 2400bccd50af .hgsubstate | ||
Martin Geisler
|
r15635 | --- a/.hgsubstate | ||
+++ /dev/null | ||||
@@ -1,2 +0,0 @@ | ||||
-fc627a69481fcbe5f1135069e8a3881c023e4cf5 s | ||||
-e95bcfa18a358dc4936da981ebf4147b4cad1362 t | ||||
Martin Geisler
|
r15636 | |||
David M. Carr
|
r15409 | Test behavior of add for explicit path in subrepo: | ||
$ cd .. | ||||
David M. Carr
|
r15473 | $ hg init explicit | ||
$ cd explicit | ||||
David M. Carr
|
r15409 | $ echo s = s > .hgsub | ||
$ hg add .hgsub | ||||
$ hg init s | ||||
$ hg ci -m0 | ||||
David M. Carr
|
r15410 | Adding with an explicit path in a subrepo adds the file | ||
David M. Carr
|
r15409 | $ echo c1 > f1 | ||
$ echo c2 > s/f2 | ||||
$ hg st -S | ||||
? f1 | ||||
? s/f2 | ||||
$ hg add s/f2 | ||||
$ hg st -S | ||||
David M. Carr
|
r15410 | A s/f2 | ||
David M. Carr
|
r15409 | ? f1 | ||
David M. Carr
|
r15410 | $ hg ci -R s -m0 | ||
David M. Carr
|
r15409 | $ hg ci -Am1 | ||
adding f1 | ||||
David M. Carr
|
r15410 | Adding with an explicit path in a subrepo with -S has the same behavior | ||
David M. Carr
|
r15409 | $ 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 | ||||
Matt Harbison
|
r35394 | adding s/f10 | ||
adding s/f9 | ||||
David M. Carr
|
r15409 | $ 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 | ||||
Matt Harbison
|
r35394 | adding s/fm17 | ||
David M. Carr
|
r15409 | $ hg st -S | ||
A fm15 | ||||
A s/fm17 | ||||
? fn16 | ||||
? s/fn18 | ||||
$ hg ci -R s -Am5 | ||||
adding fn18 | ||||
$ hg ci -Am6 | ||||
adding fn16 | ||||
David M. Carr
|
r15473 | |||
Test behavior of forget for explicit path in subrepo: | ||||
David M. Carr
|
r15474 | Forgetting an explicit path in a subrepo untracks the file | ||
David M. Carr
|
r15473 | $ echo c19 > s/f19 | ||
$ hg add s/f19 | ||||
$ hg st -S | ||||
A s/f19 | ||||
$ hg forget s/f19 | ||||
David M. Carr
|
r15474 | $ hg st -S | ||
? s/f19 | ||||
David M. Carr
|
r15473 | $ rm s/f19 | ||
Mads Kiilerich
|
r16912 | $ cd .. | ||
Pierre-Yves David
|
r18520 | |||
Courtesy phases synchronisation to publishing server does not block the push | ||||
(issue3781) | ||||
Jun Wu
|
r30556 | $ cp -R main issue3781 | ||
$ cp -R main issue3781-dest | ||||
Pierre-Yves David
|
r18520 | $ cd issue3781-dest/s | ||
$ hg phase tip # show we have draft changeset | ||||
5: draft | ||||
$ chmod a-w .hg/store/phaseroots # prevent phase push | ||||
$ cd ../../issue3781 | ||||
$ cat >> .hg/hgrc << EOF | ||||
> [paths] | ||||
> default=../issue3781-dest/ | ||||
> EOF | ||||
Pierre-Yves David
|
r29687 | $ hg push --config devel.legacy.exchange=bundle1 | ||
Matt Harbison
|
r35394 | pushing to $TESTTMP/issue3781-dest | ||
Pierre-Yves David
|
r25337 | pushing subrepo s to $TESTTMP/issue3781-dest/s | ||
searching for changes | ||||
no changes found | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
# clean the push cache | ||||
$ rm s/.hg/cache/storehash/* | ||||
Pierre-Yves David
|
r29688 | $ hg push # bundle2+ | ||
Matt Harbison
|
r35394 | pushing to $TESTTMP/issue3781-dest | ||
Pierre-Yves David
|
r18520 | pushing subrepo s to $TESTTMP/issue3781-dest/s | ||
searching for changes | ||||
no changes found | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
FUJIWARA Katsunori
|
r20176 | $ cd .. | ||
Pierre-Yves David
|
r18520 | |||
FUJIWARA Katsunori
|
r20176 | Test phase choice for newly created commit with "phases.subrepochecks" | ||
configuration | ||||
$ cd t | ||||
$ hg update -q -r 12 | ||||
$ cat >> s/ss/.hg/hgrc <<EOF | ||||
> [phases] | ||||
> new-commit = secret | ||||
> EOF | ||||
$ cat >> s/.hg/hgrc <<EOF | ||||
> [phases] | ||||
> new-commit = draft | ||||
> EOF | ||||
$ echo phasecheck1 >> s/ss/a | ||||
$ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1 | ||||
committing subrepository ss | ||||
transaction abort! | ||||
rollback completed | ||||
abort: can't commit in draft phase conflicting secret from subrepository ss | ||||
[255] | ||||
$ echo phasecheck2 >> s/ss/a | ||||
$ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2 | ||||
committing subrepository ss | ||||
$ hg -R s/ss phase tip | ||||
3: secret | ||||
$ hg -R s phase tip | ||||
6: draft | ||||
$ echo phasecheck3 >> s/ss/a | ||||
$ hg -R s commit -S -m phasecheck3 | ||||
committing subrepository ss | ||||
warning: changes are committed in secret phase from subrepository ss | ||||
$ hg -R s/ss phase tip | ||||
4: secret | ||||
$ hg -R s phase tip | ||||
7: secret | ||||
$ cat >> t/.hg/hgrc <<EOF | ||||
> [phases] | ||||
> new-commit = draft | ||||
> EOF | ||||
$ cat >> .hg/hgrc <<EOF | ||||
> [phases] | ||||
> new-commit = public | ||||
> EOF | ||||
$ echo phasecheck4 >> s/ss/a | ||||
$ echo phasecheck4 >> t/t | ||||
$ hg commit -S -m phasecheck4 | ||||
committing subrepository s | ||||
Matt Harbison
|
r35394 | committing subrepository s/ss | ||
FUJIWARA Katsunori
|
r20176 | warning: changes are committed in secret phase from subrepository ss | ||
committing subrepository t | ||||
warning: changes are committed in secret phase from subrepository s | ||||
created new head | ||||
$ hg -R s/ss phase tip | ||||
5: secret | ||||
$ hg -R s phase tip | ||||
8: secret | ||||
$ hg -R t phase tip | ||||
6: draft | ||||
$ hg phase tip | ||||
15: secret | ||||
$ cd .. | ||||
Jordi Gutiérrez Hermoso
|
r20772 | |||
Mads Kiilerich
|
r21024 | Test that commit --secret works on both repo and subrepo (issue4182) | ||
Jordi Gutiérrez Hermoso
|
r20772 | |||
$ cd main | ||||
$ echo secret >> b | ||||
$ echo secret >> s/b | ||||
$ hg commit --secret --subrepo -m "secret" | ||||
committing subrepository s | ||||
$ hg phase -r . | ||||
6: secret | ||||
$ cd s | ||||
$ hg phase -r . | ||||
6: secret | ||||
$ cd ../../ | ||||
FUJIWARA Katsunori
|
r21890 | |||
FUJIWARA Katsunori
|
r21897 | Test "subrepos" template keyword | ||
$ cd t | ||||
$ hg update -q 15 | ||||
$ cat > .hgsub <<EOF | ||||
> s = s | ||||
> EOF | ||||
$ hg commit -m "16" | ||||
warning: changes are committed in secret phase from subrepository s | ||||
(addition of ".hgsub" itself) | ||||
$ hg diff --nodates -c 1 .hgsubstate | ||||
diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate | ||||
--- /dev/null | ||||
+++ b/.hgsubstate | ||||
@@ -0,0 +1,1 @@ | ||||
+e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | ||||
$ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" | ||||
f7b1eb17ad24 000000000000 | ||||
s | ||||
(modification of existing entry) | ||||
$ hg diff --nodates -c 2 .hgsubstate | ||||
diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate | ||||
--- a/.hgsubstate | ||||
+++ b/.hgsubstate | ||||
@@ -1,1 +1,1 @@ | ||||
-e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | ||||
+dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s | ||||
$ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" | ||||
7cf8cfea66e4 000000000000 | ||||
s | ||||
(addition of entry) | ||||
$ hg diff --nodates -c 5 .hgsubstate | ||||
diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate | ||||
--- a/.hgsubstate | ||||
+++ b/.hgsubstate | ||||
@@ -1,1 +1,2 @@ | ||||
e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | ||||
+60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t | ||||
$ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" | ||||
7cf8cfea66e4 000000000000 | ||||
t | ||||
(removal of existing entry) | ||||
$ hg diff --nodates -c 16 .hgsubstate | ||||
diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate | ||||
--- a/.hgsubstate | ||||
+++ b/.hgsubstate | ||||
@@ -1,2 +1,1 @@ | ||||
0731af8ca9423976d3743119d0865097c07bdc1b s | ||||
-e202dc79b04c88a636ea8913d9182a1346d9b3dc t | ||||
$ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" | ||||
8bec38d2bd0b 000000000000 | ||||
t | ||||
(merging) | ||||
$ hg diff --nodates -c 9 .hgsubstate | ||||
diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate | ||||
--- a/.hgsubstate | ||||
+++ b/.hgsubstate | ||||
@@ -1,1 +1,2 @@ | ||||
fc627a69481fcbe5f1135069e8a3881c023e4cf5 s | ||||
+60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t | ||||
$ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" | ||||
f6affe3fbfaa 1f14a2e2d3ec | ||||
t | ||||
(removal of ".hgsub" itself) | ||||
$ hg diff --nodates -c 8 .hgsubstate | ||||
diff -r f94576341bcf -r 96615c1dad2d .hgsubstate | ||||
--- a/.hgsubstate | ||||
+++ /dev/null | ||||
@@ -1,2 +0,0 @@ | ||||
-e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | ||||
-7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t | ||||
$ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" | ||||
f94576341bcf 000000000000 | ||||
FUJIWARA Katsunori
|
r21890 | Test that '[paths]' is configured correctly at subrepo creation | ||
$ cd $TESTTMP/tc | ||||
$ cat > .hgsub <<EOF | ||||
> # to clear bogus subrepo path 'bogus=[boguspath' | ||||
> s = s | ||||
> t = t | ||||
> EOF | ||||
$ hg update -q --clean null | ||||
$ rm -rf s t | ||||
$ cat >> .hg/hgrc <<EOF | ||||
> [paths] | ||||
> default-push = /foo/bar | ||||
> EOF | ||||
$ hg update -q | ||||
$ cat s/.hg/hgrc | ||||
[paths] | ||||
default = $TESTTMP/t/s | ||||
default-push = /foo/bar/s | ||||
$ cat s/ss/.hg/hgrc | ||||
[paths] | ||||
default = $TESTTMP/t/s/ss | ||||
default-push = /foo/bar/s/ss | ||||
$ cat t/.hg/hgrc | ||||
[paths] | ||||
default = $TESTTMP/t/t | ||||
default-push = /foo/bar/t | ||||
Matt Harbison
|
r25418 | |||
$ cd $TESTTMP/t | ||||
$ hg up -qC 0 | ||||
$ echo 'bar' > bar.txt | ||||
$ hg ci -Am 'branch before subrepo add' | ||||
adding bar.txt | ||||
created new head | ||||
$ hg merge -r "first(subrepo('s'))" | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ hg status -S -X '.hgsub*' | ||||
A s/a | ||||
? s/b | ||||
? s/c | ||||
? s/f1 | ||||
$ hg status -S --rev 'p2()' | ||||
A bar.txt | ||||
? s/b | ||||
? s/c | ||||
? s/f1 | ||||
$ hg diff -S -X '.hgsub*' --nodates | ||||
diff -r 000000000000 s/a | ||||
--- /dev/null | ||||
+++ b/s/a | ||||
@@ -0,0 +1,1 @@ | ||||
+a | ||||
$ hg diff -S --rev 'p2()' --nodates | ||||
diff -r 7cf8cfea66e4 bar.txt | ||||
--- /dev/null | ||||
+++ b/bar.txt | ||||
@@ -0,0 +1,1 @@ | ||||
+bar | ||||
FUJIWARA Katsunori
|
r21890 | $ cd .. | ||
Sean Farley
|
r33729 | |||
test for ssh exploit 2017-07-25 | ||||
Yuya Nishihara
|
r33733 | $ cat >> $HGRCPATH << EOF | ||
> [ui] | ||||
> ssh = sh -c "read l; read l; read l" | ||||
> EOF | ||||
Sean Farley
|
r33729 | $ hg init malicious-proxycommand | ||
$ cd malicious-proxycommand | ||||
$ echo 's = [hg]ssh://-oProxyCommand=touch${IFS}owned/path' > .hgsub | ||||
$ hg init s | ||||
$ cd s | ||||
$ echo init > init | ||||
$ hg add | ||||
adding init | ||||
$ hg commit -m init | ||||
$ cd .. | ||||
$ hg add .hgsub | ||||
$ hg ci -m 'add subrepo' | ||||
$ cd .. | ||||
$ hg clone malicious-proxycommand malicious-proxycommand-clone | ||||
updating to branch default | ||||
abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s") | ||||
[255] | ||||
also check that a percent encoded '-' (%2D) doesn't work | ||||
$ cd malicious-proxycommand | ||||
$ echo 's = [hg]ssh://%2DoProxyCommand=touch${IFS}owned/path' > .hgsub | ||||
$ hg ci -m 'change url to percent encoded' | ||||
$ cd .. | ||||
$ rm -r malicious-proxycommand-clone | ||||
$ hg clone malicious-proxycommand malicious-proxycommand-clone | ||||
updating to branch default | ||||
abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s") | ||||
[255] | ||||
also check for a pipe | ||||
$ cd malicious-proxycommand | ||||
Yuya Nishihara
|
r33733 | $ echo 's = [hg]ssh://fakehost|touch${IFS}owned/path' > .hgsub | ||
Sean Farley
|
r33729 | $ hg ci -m 'change url to pipe' | ||
$ cd .. | ||||
$ rm -r malicious-proxycommand-clone | ||||
$ hg clone malicious-proxycommand malicious-proxycommand-clone | ||||
updating to branch default | ||||
Yuya Nishihara
|
r33733 | abort: no suitable response from remote hg! | ||
Sean Farley
|
r33729 | [255] | ||
Yuya Nishihara
|
r33733 | $ [ ! -f owned ] || echo 'you got owned' | ||
Sean Farley
|
r33729 | |||
also check that a percent encoded '|' (%7C) doesn't work | ||||
$ cd malicious-proxycommand | ||||
Yuya Nishihara
|
r33733 | $ echo 's = [hg]ssh://fakehost%7Ctouch%20owned/path' > .hgsub | ||
Sean Farley
|
r33729 | $ hg ci -m 'change url to percent encoded pipe' | ||
$ cd .. | ||||
$ rm -r malicious-proxycommand-clone | ||||
$ hg clone malicious-proxycommand malicious-proxycommand-clone | ||||
updating to branch default | ||||
Yuya Nishihara
|
r33733 | abort: no suitable response from remote hg! | ||
Sean Farley
|
r33729 | [255] | ||
Yuya Nishihara
|
r33733 | $ [ ! -f owned ] || echo 'you got owned' | ||
Sean Farley
|
r33729 | |||
and bad usernames: | ||||
$ cd malicious-proxycommand | ||||
$ echo 's = [hg]ssh://-oProxyCommand=touch owned@example.com/path' > .hgsub | ||||
$ hg ci -m 'owned username' | ||||
$ cd .. | ||||
$ rm -r malicious-proxycommand-clone | ||||
$ hg clone malicious-proxycommand malicious-proxycommand-clone | ||||
updating to branch default | ||||
abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned@example.com/path' (in subrepository "s") | ||||
[255] | ||||
Yuya Nishihara
|
r38444 | |||
Test convert subrepositories including merge (issue5526): | ||||
$ hg init tconv | ||||
$ hg convert --config extensions.convert= -q t/s tconv/s | ||||
$ hg convert --config extensions.convert= -q t/s/ss tconv/s/ss | ||||
$ hg convert --config extensions.convert= -q t/t tconv/t | ||||
convert shouldn't fail because of pseudo filenode: | ||||
$ hg convert --config extensions.convert= t tconv | ||||
scanning source... | ||||
sorting... | ||||
converting... | ||||
17 0 | ||||
16 1 | ||||
15 2 | ||||
14 3 | ||||
13 4 | ||||
12 5 | ||||
11 6 | ||||
10 7 | ||||
9 8 | ||||
8 9 | ||||
7 10 | ||||
6 11 | ||||
5 12 | ||||
4 13 | ||||
3 rm2 | ||||
2 phasecheck4 | ||||
1 16 | ||||
0 branch before subrepo add | ||||
converted .hgsubstate should point to valid nodes: | ||||
$ hg up -R tconv 9 | ||||
3 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ cat tconv/.hgsubstate | ||||
fc627a69481fcbe5f1135069e8a3881c023e4cf5 s | ||||
60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t | ||||