Newer
Older
Let commit recurse into subrepos by default to match pre-2.0 behavior:
$ echo "[ui]" >> $HGRCPATH
$ echo "commitsubrepos = Yes" >> $HGRCPATH
$ 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
Issue2232: committing a subrepo without .hgsub
$ hg ci -mbad s
abort: can't commit subrepos without .hgsub
$ hg -R s add s/a
$ hg files -S
.hgsub
a
`hg files` respects ui.relative-paths
BROKEN: shows subrepo paths relative to the subrepo
$ hg files -S --config ui.relative-paths=no
.hgsub
a

Martin von Zweigbergk
committed
s/a
$ hg -R s ci -Ams0
$ hg sum
parent: 0:f7b1eb17ad24 tip
0
branch: default
commit: 1 added, 1 subrepos
update: (current)
phases: 1 draft
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
Subrepopath which overlaps with filepath, does not change warnings in remove()
$ mkdir snot
$ touch snot/file
$ hg remove -S snot/file
not removing snot/file: file is untracked
$ hg cat snot/filenot
snot/filenot: no such file in rev 7cf8cfea66e4
$ rm -r snot
Revert subrepo and test subrepo fileset keyword:
$ hg revert --dry-run "set:subrepo('glob:s*')"
reverting subrepo s
reverting s/a
$ hg revert "set:subrepo('glob:s*')"
Angel Ezquerra
committed
reverting subrepo s
reverting s/a
Angel Ezquerra
committed
$ rm s/a.orig
Angel Ezquerra
committed
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
$ echo b > s/a
$ hg sum
parent: 1:7cf8cfea66e4 tip
1
branch: default
commit: 1 subrepos
update: (current)
phases: 2 draft
$ 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)
phases: 2 draft
commands that require a clean repo should respect subrepos
$ echo b >> s/a
$ hg backout tip
abort: uncommitted changes in subrepository "s"
[255]
$ hg revert -C -R s s/a
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)
phases: 2 draft
committing subrepository s/ss
$ hg sum
parent: 2:df30734270ae tip
2
branch: default
commit: (clean)
update: (current)
phases: 3 draft
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
bump sub rev (and check it is ignored by ui.commitsubrepos)
$ hg --config ui.commitsubrepos=no ci -m3
leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
$ hg --config ui.commitsubrepos=no ci -m4
abort: uncommitted changes in subrepository "s"
(use --subrepos for recursive commit)
$ hg id
f6affe3fbfaa+ tip
$ hg -R s ci -mc
$ hg id
f6affe3fbfaa+ tip
$ echo d > s/a
$ hg ci -m4
committing subrepository s
$ hg tip -R s
changeset: 4:02dcf1d70411
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
Loading
Loading full blame...