##// END OF EJS Templates
templatekw: add verbosity keyword to select template by -q/-v/--debug flag...
templatekw: add verbosity keyword to select template by -q/-v/--debug flag This can be used in conjunction with the ifeq() function.

File last commit:

r34990:1a314176 stable
r34994:625d5ebc default
Show More
test-subrepo-git.t
1216 lines | 27.5 KiB | text/troff | Tads3Lexer
/ tests / test-subrepo-git.t
Matt Mackall
tests: replace exit 80 with #require
r22046 #require git
Eric Eisner
subrepo: support for adding a git subrepo...
r12992
make git commits repeatable
Boris Feld
test: prepare tests for removing date aliases...
r32413 $ cat >> $HGRCPATH <<EOF
> [defaults]
> commit = -d "0 0"
> EOF
Eduard-Cristian Stefan
test-subrepo-git.t: adapt for Windows...
r17022 $ echo "[core]" >> $HOME/.gitconfig
$ echo "autocrlf = false" >> $HOME/.gitconfig
Eric Eisner
subrepo: support for adding a git subrepo...
r12992 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
$ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
$ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE
$ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
$ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
$ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
Matt Mackall
test-subrepo-git: ignore global git config...
r23693 $ GIT_CONFIG_NOSYSTEM=1; export GIT_CONFIG_NOSYSTEM
Eric Eisner
subrepo: support for adding a git subrepo...
r12992
root hg repo
$ hg init t
$ cd t
$ echo a > a
$ hg add a
$ hg commit -m a
$ cd ..
new external git repo
$ mkdir gitroot
$ cd gitroot
$ git init -q
$ echo g > g
$ git add g
$ git commit -q -m g
add subrepo clone
$ cd ../t
$ echo 's = [git]../gitroot' > .hgsub
$ git clone -q ../gitroot s
$ hg add .hgsub
$ hg commit -m 'new git subrepo'
$ hg debugsub
path s
source ../gitroot
revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
Eric Eisner
subrepo: update and merge works with any git branch
r12995 record a new commit from upstream from a different branch
Eric Eisner
subrepo: support for adding a git subrepo...
r12992
$ cd ../gitroot
Eric Eisner
test-subrepo-git.t: silence git output...
r13091 $ git checkout -q -b testing
Eric Eisner
subrepo: support for adding a git subrepo...
r12992 $ echo gg >> g
$ git commit -q -a -m gg
$ cd ../t/s
Eric Eisner
test-subrepo-git.t: silence git output...
r13091 $ git pull -q >/dev/null 2>/dev/null
$ git checkout -q -b testing origin/testing >/dev/null
Eric Eisner
subrepo: support for adding a git subrepo...
r12992
$ cd ..
Eric Eisner
subrepo: basic support for status of git subrepos
r13182 $ hg status --subrepos
M s/g
Eric Eisner
subrepo: support for adding a git subrepo...
r12992 $ hg commit -m 'update git subrepo'
$ hg debugsub
path s
source ../gitroot
revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
Eric Eisner
subrepo: cloning and updating of git subrepos...
r12993
Eric Eisner
test-subrepo-git.t: make gitroot pushable earlier...
r13092 make $GITROOT pushable, by replacing it with a clone with nothing checked out
$ cd ..
$ git clone gitroot gitrootbare --bare -q
$ rm -rf gitroot
$ mv gitrootbare gitroot
Eric Eisner
subrepo: cloning and updating of git subrepos...
r12993 clone root
Eric Eisner
test-subrepo-git.t: make gitroot pushable earlier...
r13092 $ cd t
Mads Kiilerich
tests: deal with new gits sending status messages to stderr...
r20105 $ hg clone . ../tc 2> /dev/null
Eric Eisner
subrepo: cloning and updating of git subrepos...
r12993 updating to branch default
Eric Eisner
subrepo: show the source that git clones
r13525 cloning subrepo s from $TESTTMP/gitroot
Eric Eisner
subrepo: cloning and updating of git subrepos...
r12993 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd ../tc
$ hg debugsub
path s
source ../gitroot
revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
update to previous substate
Eric Eisner
subrepo: silence git output when ui.quiet is set
r13111 $ hg update 1 -q
Eric Eisner
subrepo: cloning and updating of git subrepos...
r12993 $ cat s/g
g
$ hg debugsub
path s
source ../gitroot
revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994
clone root, make local change
Eric Eisner
test-subrepo-git.t: make gitroot pushable earlier...
r13092 $ cd ../t
Mads Kiilerich
tests: deal with new gits sending status messages to stderr...
r20105 $ hg clone . ../ta 2> /dev/null
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 updating to branch default
Eric Eisner
subrepo: show the source that git clones
r13525 cloning subrepo s from $TESTTMP/gitroot
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd ../ta
$ echo ggg >> s/g
Eric Eisner
subrepo: basic support for status of git subrepos
r13182 $ hg status --subrepos
M s/g
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523 $ hg diff --subrepos
diff --git a/s/g b/s/g
index 089258f..85341ee 100644
--- a/s/g
+++ b/s/g
@@ -1,2 +1,3 @@
g
gg
Mathias De Maré
subrepo: correctly add newline for git subrepo diffs...
r23938 +ggg
Martin Geisler
subrepos: abort commit by default if a subrepo is dirty (BC)...
r15321 $ hg commit --subrepos -m ggg
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181 committing subrepository s
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 $ hg debugsub
path s
source ../gitroot
revision 79695940086840c99328513acbe35f90fcd55e57
clone root separately, make different local change
$ cd ../t
Mads Kiilerich
tests: deal with new gits sending status messages to stderr...
r20105 $ hg clone . ../tb 2> /dev/null
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 updating to branch default
Eric Eisner
subrepo: show the source that git clones
r13525 cloning subrepo s from $TESTTMP/gitroot
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd ../tb/s
Mathias De Maré
subrepo: add status support for ignored files in git subrepos...
r23411 $ hg status --subrepos
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 $ echo f > f
Mathias De Maré
subrepo: add status support for ignored files in git subrepos...
r23411 $ hg status --subrepos
? s/f
Matt Harbison
subrepo: don't abort in add when non-hg subrepos are present (issue4513)...
r23963 $ hg add .
Mathias De Maré
subrepos: support adding files in git subrepos...
r24174 adding f
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 $ git add f
$ cd ..
Eric Eisner
subrepo: basic support for status of git subrepos
r13182 $ hg status --subrepos
A s/f
Martin Geisler
subrepos: abort commit by default if a subrepo is dirty (BC)...
r15321 $ hg commit --subrepos -m f
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181 committing subrepository s
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 $ hg debugsub
path s
source ../gitroot
revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
user b push changes
Eric Eisner
test-subrepo-git.t: silence git output...
r13091 $ hg push 2>/dev/null
Eduard-Cristian Stefan
test-subrepo-git.t: adapt for Windows...
r17022 pushing to $TESTTMP/t (glob)
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 pushing branch testing of subrepository "s"
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
user a pulls, merges, commits
$ cd ../ta
$ hg pull
Eduard-Cristian Stefan
test-subrepo-git.t: adapt for Windows...
r17022 pulling from $TESTTMP/t (glob)
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 089416c11d73
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 (run 'hg heads' to see heads, 'hg merge' to merge)
Eric Eisner
test-subrepo-git.t: silence git output...
r13091 $ hg merge 2>/dev/null
Angel Ezquerra
subrepo: use subrepo shortid method to generate subrepo diverged promptchoice...
r21401 subrepository s diverged (local revision: 7969594, remote revision: aa84837)
Simon Farnsworth
merge: add conflict labels to merge command...
r30062 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
Eric Eisner
subrepo: show the source that git pulls
r13569 pulling subrepo s from $TESTTMP/gitroot
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
Mathias De Maré
subrepo: add status support for ignored and clean files in git subrepos
r24256 $ hg st --subrepos s
A s/f
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 $ cat s/f
f
$ cat s/g
g
gg
ggg
Martin Geisler
subrepos: abort commit by default if a subrepo is dirty (BC)...
r15321 $ hg commit --subrepos -m 'merge'
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181 committing subrepository s
Eric Eisner
subrepo: basic support for status of git subrepos
r13182 $ hg status --subrepos --rev 1:5
M .hgsubstate
M s/g
A s/f
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 $ hg debugsub
path s
source ../gitroot
revision f47b465e1bce645dbf37232a00574aa1546ca8d3
Eric Eisner
test-subrepo-git.t: silence git output...
r13091 $ hg push 2>/dev/null
Eduard-Cristian Stefan
test-subrepo-git.t: adapt for Windows...
r17022 pushing to $TESTTMP/t (glob)
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 pushing branch testing of subrepository "s"
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files
Eric Eisner
subrepo: removing (and restoring) git subrepo state
r12996
Eric Eisner
subrepo: lazier git push logic...
r13029 make upstream git changes
$ cd ..
$ git clone -q gitroot gitclone
$ cd gitclone
$ echo ff >> f
$ git commit -q -a -m ff
$ echo fff >> f
$ git commit -q -a -m fff
Eric Eisner
test-subrepo-git.t: silence git output...
r13091 $ git push origin testing 2>/dev/null
Eric Eisner
subrepo: lazier git push logic...
r13029
make and push changes to hg without updating the subrepo
$ cd ../t
Mads Kiilerich
tests: deal with new gits sending status messages to stderr...
r20105 $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.'
Eric Eisner
subrepo: lazier git push logic...
r13029 updating to branch default
Eric Eisner
subrepo: show the source that git clones
r13525 cloning subrepo s from $TESTTMP/gitroot
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 checking out detached HEAD in subrepository "s"
Eric Eisner
subrepo: lazier git push logic...
r13029 check out a git branch if you intend to make changes
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd ../td
$ echo aa >> a
$ hg commit -m aa
$ hg push
Eduard-Cristian Stefan
test-subrepo-git.t: adapt for Windows...
r17022 pushing to $TESTTMP/t (glob)
Eric Eisner
subrepo: lazier git push logic...
r13029 searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
Eric Eisner
subrepo: lazily update git's local tracking branches...
r13087 sync to upstream git, distribute changes
$ cd ../ta
$ hg pull -u -q
$ cd s
Eric Eisner
test-subrepo-git.t: silence git output...
r13091 $ git pull -q >/dev/null 2>/dev/null
Eric Eisner
subrepo: lazily update git's local tracking branches...
r13087 $ cd ..
$ hg commit -m 'git upstream sync'
$ hg debugsub
path s
source ../gitroot
revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
$ hg push -q
$ cd ../tb
$ hg pull -q
Eric Eisner
test-subrepo-git.t: silence git output...
r13091 $ hg update 2>/dev/null
Eric Eisner
subrepo: show the source that git pulls
r13569 pulling subrepo s from $TESTTMP/gitroot
Eric Eisner
subrepo: lazily update git's local tracking branches...
r13087 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg debugsub
path s
source ../gitroot
revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
Kevin Bullock
subrepo: add regression test for issue3870
r19013 create a new git branch
$ cd s
$ git checkout -b b2
Switched to a new branch 'b2'
$ echo a>a
$ git add a
$ git commit -qm 'add a'
$ cd ..
$ hg commit -m 'add branch in s'
pulling new git branch should not create tracking branch named 'origin/b2'
(issue3870)
$ cd ../td/s
$ git remote set-url origin $TESTTMP/tb/s
Kevin Bullock
subrepo: fix test breakage introduced in 2b34d004e644...
r19049 $ git branch --no-track oldtesting
Kevin Bullock
subrepo: add regression test for issue3870
r19013 $ cd ..
$ hg pull -q ../tb
$ hg up
From $TESTTMP/tb/s
* [new branch] b2 -> origin/b2
Previous HEAD position was f47b465... merge
Switched to a new branch 'b2'
pulling subrepo s from $TESTTMP/tb/s
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Eric Eisner
subrepo: removing (and restoring) git subrepo state
r12996 update to a revision without the subrepo, keeping the local git repository
$ cd ../t
$ hg up 0
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
Dan Villiom Podlaski Christiansen
test-subrepo-git.t: portability fix....
r13010 $ ls -a s
Eric Eisner
subrepo: removing (and restoring) git subrepo state
r12996 .
..
.git
$ hg up 2
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Dan Villiom Podlaski Christiansen
test-subrepo-git.t: portability fix....
r13010 $ ls -a s
Eric Eisner
subrepo: removing (and restoring) git subrepo state
r12996 .
..
.git
g
Eric Eisner
subrepo: archive git subrepos
r13027
archive subrepos
Eric Eisner
test-subrepo-git.t: silence git output...
r13091 $ cd ../tc
$ hg pull -q
$ hg archive --subrepos -r 5 ../archive 2>/dev/null
Eric Eisner
subrepo: show the source that git pulls
r13569 pulling subrepo s from $TESTTMP/gitroot
Eric Eisner
subrepo: archive git subrepos
r13027 $ cd ../archive
$ cat s/f
f
$ cat s/g
g
gg
ggg
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181
Matt Harbison
subrepo: propagate matcher to subrepos when archiving...
r17108 $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null
Mads Kiilerich
tests: ignore pax_global_header in test-subrepo-git.t...
r17114 $ find ../archive_x | sort | grep -v pax_global_header
Matt Harbison
subrepo: propagate matcher to subrepos when archiving...
r17108 ../archive_x
../archive_x/.hg_archival.txt
../archive_x/.hgsub
../archive_x/.hgsubstate
../archive_x/a
../archive_x/s
../archive_x/s/g
Matt Harbison
archive: drop the leading '.' path component from the prefix (issue4634)...
r24953 $ hg -R ../tc archive -S ../archive.tgz --prefix '.' 2>/dev/null
Pierre-Yves David
test-subrepo-git: ignore pax_global_header when listing archive...
r24964 $ tar -tzf ../archive.tgz | sort | grep -v pax_global_header
Matt Harbison
archive: drop the leading '.' path component from the prefix (issue4634)...
r24953 .hg_archival.txt
.hgsub
.hgsubstate
a
s/g
Matt Harbison
archive: always use portable path component separators with subrepos...
r24924
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181 create nested repo
$ cd ..
$ hg init outer
$ cd outer
$ echo b>b
$ hg add b
$ hg commit -m b
Mads Kiilerich
tests: deal with new gits sending status messages to stderr...
r20105 $ hg clone ../t inner 2> /dev/null
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181 updating to branch default
Eric Eisner
subrepo: show the source that git clones
r13525 cloning subrepo s from $TESTTMP/gitroot
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo inner = inner > .hgsub
$ hg add .hgsub
$ hg commit -m 'nested sub'
nested commit
$ echo ffff >> inner/s/f
Eric Eisner
subrepo: basic support for status of git subrepos
r13182 $ hg status --subrepos
M inner/s/f
Martin Geisler
subrepos: abort commit by default if a subrepo is dirty (BC)...
r15321 $ hg commit --subrepos -m nested
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181 committing subrepository inner
Eduard-Cristian Stefan
test-subrepo-git.t: adapt for Windows...
r17022 committing subrepository inner/s (glob)
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181
nested archive
$ hg archive --subrepos ../narchive
Lee Cantey
Ignore pax_global_header that some tar versions write as a file.
r13296 $ ls ../narchive/inner/s | grep -v pax_global_header
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181 f
g
Erik Zielke
subrepo: make update -C clean the working directory for git subrepos...
r13324
Eric Eisner
subrepo: expand relative sources for git subrepos
r13460 relative source expansion
$ cd ..
$ mkdir d
Mads Kiilerich
tests: deal with new gits sending status messages to stderr...
r20105 $ hg clone t d/t 2> /dev/null
Eric Eisner
subrepo: expand relative sources for git subrepos
r13460 updating to branch default
Eric Eisner
subrepo: show the source that git clones
r13525 cloning subrepo s from $TESTTMP/gitroot
Eric Eisner
subrepo: expand relative sources for git subrepos
r13460 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
Eric Eisner
subrepo: don't crash when git repo is missing
r13553 Don't crash if the subrepo is missing
$ hg clone t missing -q
$ cd missing
$ rm -rf s
$ hg status -S
$ hg sum | grep commit
commit: 1 subrepos
$ hg push -q
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 abort: subrepo s is missing (in subrepository "s")
Eric Eisner
subrepo: don't crash when git repo is missing
r13553 [255]
Martin Geisler
subrepos: abort commit by default if a subrepo is dirty (BC)...
r15321 $ hg commit --subrepos -qm missing
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 abort: subrepo s is missing (in subrepository "s")
Eric Eisner
subrepo: don't crash when git repo is missing
r13553 [255]
Siddharth Agarwal
util.checkcase: don't abort on broken symlinks...
r24902
#if symlink
Don't crash if subrepo is a broken symlink
$ ln -s broken s
$ hg status -S
$ hg push -q
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 abort: subrepo s is missing (in subrepository "s")
Siddharth Agarwal
util.checkcase: don't abort on broken symlinks...
r24902 [255]
$ hg commit --subrepos -qm missing
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 abort: subrepo s is missing (in subrepository "s")
Siddharth Agarwal
util.checkcase: don't abort on broken symlinks...
r24902 [255]
$ rm s
#endif
Mads Kiilerich
tests: deal with new gits sending status messages to stderr...
r20105 $ hg update -C 2> /dev/null
Patrick Mezard
merge with stable
r13560 cloning subrepo s from $TESTTMP/gitroot
Eric Eisner
subrepo: don't crash when git repo is missing
r13553 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg sum | grep commit
commit: (clean)
Eric Eisner
subrepo: don't crash when git .hgsubstate is empty (issue2716)
r14469 Don't crash if the .hgsubstate entry is missing
$ hg update 1 -q
$ hg rm .hgsubstate
$ hg commit .hgsubstate -m 'no substate'
Matt Mackall
subrepo: rewrite handling of subrepo state at commit (issue2403)...
r16073 nothing changed
[1]
Eric Eisner
subrepo: don't crash when git .hgsubstate is empty (issue2716)
r14469 $ hg tag -l nosubstate
$ hg manifest
.hgsub
Matt Mackall
subrepo: rewrite handling of subrepo state at commit (issue2403)...
r16073 .hgsubstate
Eric Eisner
subrepo: don't crash when git .hgsubstate is empty (issue2716)
r14469 a
$ hg status -S
Matt Mackall
subrepo: rewrite handling of subrepo state at commit (issue2403)...
r16073 R .hgsubstate
Eric Eisner
subrepo: don't crash when git .hgsubstate is empty (issue2716)
r14469 $ hg sum | grep commit
Matt Mackall
subrepo: rewrite handling of subrepo state at commit (issue2403)...
r16073 commit: 1 removed, 1 subrepos (new branch head)
Eric Eisner
subrepo: don't crash when git .hgsubstate is empty (issue2716)
r14469
$ hg commit -m 'restore substate'
Matt Mackall
subrepo: rewrite handling of subrepo state at commit (issue2403)...
r16073 nothing changed
[1]
Eric Eisner
subrepo: don't crash when git .hgsubstate is empty (issue2716)
r14469 $ hg manifest
.hgsub
.hgsubstate
a
$ hg sum | grep commit
Matt Mackall
subrepo: rewrite handling of subrepo state at commit (issue2403)...
r16073 commit: 1 removed, 1 subrepos (new branch head)
Eric Eisner
subrepo: don't crash when git .hgsubstate is empty (issue2716)
r14469
$ hg update -qC nosubstate
$ ls s
Matt Mackall
subrepo: rewrite handling of subrepo state at commit (issue2403)...
r16073 g
Eric Eisner
subrepo: don't crash when git .hgsubstate is empty (issue2716)
r14469
Eric Roshan Eisner
subrepo: fix git status false positive (issue3109)...
r15531 issue3109: false positives in git diff-index
$ hg update -q
$ touch -t 200001010000 s/g
$ hg status --subrepos
$ touch -t 200001010000 s/g
$ hg sum | grep commit
commit: (clean)
Erik Zielke
subrepo: make update -C clean the working directory for git subrepos...
r13324 Check hg update --clean
Eric Eisner
test-subrepo-git.t: make compatible with old git
r13331 $ cd $TESTTMP/ta
Erik Zielke
subrepo: make update -C clean the working directory for git subrepos...
r13324 $ echo > s/g
$ cd s
$ echo c1 > f1
$ echo c1 > f2
$ git add f1
$ cd ..
Eric Eisner
test-subrepo-git.t: make compatible with old git
r13331 $ hg status -S
M s/g
A s/f1
Mathias De Maré
subrepo: add status support for ignored files in git subrepos...
r23411 ? s/f2
Eric Eisner
test-subrepo-git.t: make compatible with old git
r13331 $ ls s
f
f1
f2
g
$ hg update --clean
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg status -S
Mathias De Maré
subrepo: add status support for ignored files in git subrepos...
r23411 ? s/f1
? s/f2
Eric Eisner
test-subrepo-git.t: make compatible with old git
r13331 $ ls s
f
f1
f2
g
Erik Zielke
subrepos: prompt on conflicts on update with dirty subrepos...
r13417
Sticky subrepositories, no changes
$ cd $TESTTMP/ta
$ hg id -n
7
$ cd s
$ git rev-parse HEAD
32a343883b74769118bb1d3b4b1fbf9156f4dddc
$ cd ..
$ hg update 1 > /dev/null 2>&1
$ hg id -n
1
$ cd s
$ git rev-parse HEAD
da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
$ cd ..
Mads Kiilerich
spelling: fixes from spell checker
r21024 Sticky subrepositories, file changes
Erik Zielke
subrepos: prompt on conflicts on update with dirty subrepos...
r13417 $ touch s/f1
$ cd s
$ git add f1
$ cd ..
$ hg id -n
Patrick Mezard
identity: show trailing '+' for dirty subrepos (issue2839)
r17255 1+
Erik Zielke
subrepos: prompt on conflicts on update with dirty subrepos...
r13417 $ cd s
$ git rev-parse HEAD
da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
$ cd ..
$ hg update 4
Angel Ezquerra
subrepo: use subrepo shortid method to generate subrepo diverged promptchoice...
r21401 subrepository s diverged (local revision: da5f5b1, remote revision: aa84837)
Simon Farnsworth
merge: use labels in subrepo merge...
r30060 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
Erik Zielke
subrepos: prompt on conflicts on update with dirty subrepos...
r13417 subrepository sources for s differ
Mads Kiilerich
subrepo: remove superfluous newline from subrepo prompt
r22590 use (l)ocal source (da5f5b1) or (r)emote source (aa84837)? l
Erik Zielke
subrepos: prompt on conflicts on update with dirty subrepos...
r13417 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg id -n
4+
$ cd s
$ git rev-parse HEAD
da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
$ cd ..
Mads Kiilerich
check-code: fix check for trailing whitespace on sh command lines...
r17345 $ hg update --clean tip > /dev/null 2>&1
Erik Zielke
subrepos: prompt on conflicts on update with dirty subrepos...
r13417
Sticky subrepository, revision updates
$ hg id -n
7
$ cd s
$ git rev-parse HEAD
32a343883b74769118bb1d3b4b1fbf9156f4dddc
$ cd ..
$ cd s
$ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
Previous HEAD position was 32a3438... fff
HEAD is now at aa84837... f
$ cd ..
$ hg update 1
Angel Ezquerra
subrepo: use subrepo shortid method to generate subrepo diverged promptchoice...
r21401 subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1)
Simon Farnsworth
merge: use labels in subrepo merge...
r30060 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
Erik Zielke
subrepos: prompt on conflicts on update with dirty subrepos...
r13417 subrepository sources for s differ (in checked out version)
Mads Kiilerich
subrepo: remove superfluous newline from subrepo prompt
r22590 use (l)ocal source (32a3438) or (r)emote source (da5f5b1)? l
Erik Zielke
subrepos: prompt on conflicts on update with dirty subrepos...
r13417 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg id -n
1+
$ cd s
$ git rev-parse HEAD
aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
$ cd ..
Sticky subrepository, file changes and revision updates
$ touch s/f1
$ cd s
$ git add f1
$ git rev-parse HEAD
aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
$ cd ..
$ hg id -n
1+
$ hg update 7
Angel Ezquerra
subrepo: use subrepo shortid method to generate subrepo diverged promptchoice...
r21401 subrepository s diverged (local revision: 32a3438, remote revision: 32a3438)
Simon Farnsworth
merge: use labels in subrepo merge...
r30060 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
Erik Zielke
subrepos: prompt on conflicts on update with dirty subrepos...
r13417 subrepository sources for s differ
Mads Kiilerich
subrepo: remove superfluous newline from subrepo prompt
r22590 use (l)ocal source (32a3438) or (r)emote source (32a3438)? l
Erik Zielke
subrepos: prompt on conflicts on update with dirty subrepos...
r13417 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg id -n
Patrick Mezard
identity: show trailing '+' for dirty subrepos (issue2839)
r17255 7+
Erik Zielke
subrepos: prompt on conflicts on update with dirty subrepos...
r13417 $ cd s
$ git rev-parse HEAD
aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
$ cd ..
Sticky repository, update --clean
Javi Merino
tests: ignore git's output in test-subrepo-git.t...
r16264 $ hg update --clean tip 2>/dev/null
Erik Zielke
subrepos: prompt on conflicts on update with dirty subrepos...
r13417 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg id -n
7
$ cd s
$ git rev-parse HEAD
32a343883b74769118bb1d3b4b1fbf9156f4dddc
$ cd ..
Test subrepo already at intended revision:
$ cd s
$ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc
HEAD is now at 32a3438... fff
$ cd ..
$ hg update 1
Previous HEAD position was 32a3438... fff
HEAD is now at da5f5b1... g
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg id -n
1
$ cd s
$ git rev-parse HEAD
da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
$ cd ..
Patrick Mezard
subrepo: fix default implementation of forget() (issue3404)
r16527 Test forgetting files, not implemented in git subrepo, used to
traceback
Eduard-Cristian Stefan
test-subrepo-git.t: adapt for Windows...
r17022 #if no-windows
Patrick Mezard
subrepo: fix default implementation of forget() (issue3404)
r16527 $ hg forget 'notafile*'
notafile*: No such file or directory
[1]
Eduard-Cristian Stefan
test-subrepo-git.t: adapt for Windows...
r17022 #else
$ hg forget 'notafile'
notafile: * (glob)
[1]
#endif
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913
$ cd ..
FUJIWARA Katsunori
subrepo: make "_sanitize()" work...
r21564
Test sanitizing ".hg/hgrc" in subrepo
$ cd t
$ hg tip -q
7:af6d2edbb0d3
$ hg update -q -C af6d2edbb0d3
$ cd s
$ git checkout -q -b sanitize-test
$ mkdir .hg
$ echo '.hg/hgrc in git repo' > .hg/hgrc
$ mkdir -p sub/.hg
$ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc
$ git add .hg sub
$ git commit -qm 'add .hg/hgrc to be sanitized at hg update'
$ git push -q origin sanitize-test
$ cd ..
$ grep ' s$' .hgsubstate
32a343883b74769118bb1d3b4b1fbf9156f4dddc s
$ hg commit -qm 'commit with git revision including .hg/hgrc'
$ hg parents -q
8:3473d20bddcf
$ grep ' s$' .hgsubstate
c4069473b459cf27fd4d7c2f50c4346b4e936599 s
$ cd ..
FUJIWARA Katsunori
subrepo: make "_sanitize()" take absolute path to the root of subrepo...
r21566 $ hg -R tc pull -q
$ hg -R tc update -q -C 3473d20bddcf 2>&1 | sort
warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
FUJIWARA Katsunori
subrepo: make "_sanitize()" work...
r21564 $ cd tc
$ hg parents -q
8:3473d20bddcf
$ grep ' s$' .hgsubstate
c4069473b459cf27fd4d7c2f50c4346b4e936599 s
Danek Duvall
tests: cat error messages are different on Solaris
r21748 $ test -f s/.hg/hgrc
FUJIWARA Katsunori
subrepo: make "_sanitize()" work...
r21564 [1]
Danek Duvall
tests: cat error messages are different on Solaris
r21748 $ test -f s/sub/.hg/hgrc
FUJIWARA Katsunori
subrepo: make "_sanitize()" work...
r21564 [1]
$ cd ..
FUJIWARA Katsunori
subrepo: invoke "_sanitize()" also after "git merge --ff"...
r21565
additional test for "git merge --ff" route:
$ cd t
$ hg tip -q
8:3473d20bddcf
$ hg update -q -C af6d2edbb0d3
$ cd s
$ git checkout -q testing
$ mkdir .hg
$ echo '.hg/hgrc in git repo' > .hg/hgrc
$ mkdir -p sub/.hg
$ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc
$ git add .hg sub
$ git commit -qm 'add .hg/hgrc to be sanitized at hg update (git merge --ff)'
$ git push -q origin testing
$ cd ..
$ grep ' s$' .hgsubstate
32a343883b74769118bb1d3b4b1fbf9156f4dddc s
$ hg commit -qm 'commit with git revision including .hg/hgrc'
$ hg parents -q
9:ed23f7fe024e
$ grep ' s$' .hgsubstate
f262643c1077219fbd3858d54e78ef050ef84fbf s
$ cd ..
$ cd tc
$ hg update -q -C af6d2edbb0d3
Danek Duvall
tests: cat error messages are different on Solaris
r21748 $ test -f s/.hg/hgrc
FUJIWARA Katsunori
subrepo: invoke "_sanitize()" also after "git merge --ff"...
r21565 [1]
Danek Duvall
tests: cat error messages are different on Solaris
r21748 $ test -f s/sub/.hg/hgrc
FUJIWARA Katsunori
subrepo: invoke "_sanitize()" also after "git merge --ff"...
r21565 [1]
FUJIWARA Katsunori
subrepo: make "_sanitize()" take absolute path to the root of subrepo...
r21566 $ cd ..
$ hg -R tc pull -q
$ hg -R tc update -q -C ed23f7fe024e 2>&1 | sort
warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
$ cd tc
FUJIWARA Katsunori
subrepo: invoke "_sanitize()" also after "git merge --ff"...
r21565 $ hg parents -q
9:ed23f7fe024e
$ grep ' s$' .hgsubstate
f262643c1077219fbd3858d54e78ef050ef84fbf s
Danek Duvall
tests: cat error messages are different on Solaris
r21748 $ test -f s/.hg/hgrc
FUJIWARA Katsunori
subrepo: invoke "_sanitize()" also after "git merge --ff"...
r21565 [1]
Danek Duvall
tests: cat error messages are different on Solaris
r21748 $ test -f s/sub/.hg/hgrc
FUJIWARA Katsunori
subrepo: invoke "_sanitize()" also after "git merge --ff"...
r21565 [1]
FUJIWARA Katsunori
subrepo: avoid sanitizing ".hg/hgrc" in meta data area for non-hg subrepos...
r21567
Test that sanitizing is omitted in meta data area:
$ mkdir s/.git/.hg
$ echo '.hg/hgrc in git metadata area' > s/.git/.hg/hgrc
$ hg update -q -C af6d2edbb0d3
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 checking out detached HEAD in subrepository "s"
FUJIWARA Katsunori
subrepo: avoid sanitizing ".hg/hgrc" in meta data area for non-hg subrepos...
r21567 check out a git branch if you intend to make changes
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523 check differences made by most recent change
$ cd s
$ cat > foobar << EOF
> woopwoop
>
> foo
> bar
> EOF
$ git add foobar
FUJIWARA Katsunori
subrepo: invoke "_sanitize()" also after "git merge --ff"...
r21565 $ cd ..
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523
$ hg diff --subrepos
diff --git a/s/foobar b/s/foobar
new file mode 100644
index 0000000..8a5a5e2
--- /dev/null
+++ b/s/foobar
@@ -0,0 +1,4 @@
+woopwoop
+
+foo
Mathias De Maré
subrepo: correctly add newline for git subrepo diffs...
r23938 +bar
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523
$ hg commit --subrepos -m "Added foobar"
committing subrepository s
created new head
$ hg diff -c . --subrepos --nodates
diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate
--- a/.hgsubstate
+++ b/.hgsubstate
@@ -1,1 +1,1 @@
-32a343883b74769118bb1d3b4b1fbf9156f4dddc s
+fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s
diff --git a/s/foobar b/s/foobar
new file mode 100644
index 0000000..8a5a5e2
--- /dev/null
+++ b/s/foobar
@@ -0,0 +1,4 @@
+woopwoop
+
+foo
Mathias De Maré
subrepo: correctly add newline for git subrepo diffs...
r23938 +bar
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523
check output when only diffing the subrepository
$ hg diff -c . --subrepos s
diff --git a/s/foobar b/s/foobar
new file mode 100644
index 0000000..8a5a5e2
--- /dev/null
+++ b/s/foobar
@@ -0,0 +1,4 @@
+woopwoop
+
+foo
Mathias De Maré
subrepo: correctly add newline for git subrepo diffs...
r23938 +bar
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523
check output when diffing something else
$ hg diff -c . --subrepos .hgsubstate --nodates
diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate
--- a/.hgsubstate
+++ b/.hgsubstate
@@ -1,1 +1,1 @@
-32a343883b74769118bb1d3b4b1fbf9156f4dddc s
+fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s
add new changes, including whitespace
$ cd s
$ cat > foobar << EOF
> woop woop
>
> foo
> bar
> EOF
$ echo foo > barfoo
$ git add barfoo
$ cd ..
$ hg diff --subrepos --ignore-all-space
diff --git a/s/barfoo b/s/barfoo
new file mode 100644
index 0000000..257cc56
--- /dev/null
+++ b/s/barfoo
FUJIWARA Katsunori
tests: make chunk header of external diff glob-ed for portability...
r28035 @@ -0,0 +1* @@ (glob)
Mathias De Maré
subrepo: correctly add newline for git subrepo diffs...
r23938 +foo
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523 $ hg diff --subrepos s/foobar
diff --git a/s/foobar b/s/foobar
index 8a5a5e2..bd5812a 100644
--- a/s/foobar
+++ b/s/foobar
@@ -1,4 +1,4 @@
-woopwoop
+woop woop
foo
Mathias De Maré
subrepo: correctly add newline for git subrepo diffs...
r23938 bar
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523
Mathias De Maré
tests: allow more flexibility in git diffstat output...
r23542 execute a diffstat
the output contains a regex, because git 1.7.10 and 1.7.11
change the amount of whitespace
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523 $ hg diff --subrepos --stat
Mathias De Maré
tests: allow more flexibility in git diffstat output...
r23542 \s*barfoo |\s*1 + (re)
\s*foobar |\s*2 +- (re)
Mathias De Maré
subrepo: correctly add newline for git subrepo diffs...
r23938 2 files changed, 2 insertions\(\+\), 1 deletions?\(-\) (re)
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523
Mathias De Maré
subrepo: add include/exclude support for diffing git subrepos...
r24778 adding an include should ignore the other elements
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523 $ hg diff --subrepos -I s/foobar
Mathias De Maré
subrepo: add include/exclude support for diffing git subrepos...
r24778 diff --git a/s/foobar b/s/foobar
index 8a5a5e2..bd5812a 100644
--- a/s/foobar
+++ b/s/foobar
@@ -1,4 +1,4 @@
-woopwoop
+woop woop
foo
bar
adding an exclude should ignore this element
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523 $ hg diff --subrepos -X s/foobar
Mathias De Maré
subrepo: add include/exclude support for diffing git subrepos...
r24778 diff --git a/s/barfoo b/s/barfoo
new file mode 100644
index 0000000..257cc56
--- /dev/null
+++ b/s/barfoo
FUJIWARA Katsunori
tests: make chunk header of external diff glob-ed for portability...
r28035 @@ -0,0 +1* @@ (glob)
Mathias De Maré
subrepo: add include/exclude support for diffing git subrepos...
r24778 +foo
moving a file should show a removal and an add
$ hg revert --all
reverting subrepo ../gitroot
$ cd s
$ git mv foobar woop
$ cd ..
$ hg diff --subrepos
diff --git a/s/foobar b/s/foobar
deleted file mode 100644
index 8a5a5e2..0000000
--- a/s/foobar
+++ /dev/null
@@ -1,4 +0,0 @@
-woopwoop
-
-foo
-bar
diff --git a/s/woop b/s/woop
new file mode 100644
index 0000000..8a5a5e2
--- /dev/null
+++ b/s/woop
@@ -0,0 +1,4 @@
+woopwoop
+
+foo
+bar
$ rm s/woop
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523
Mathias De Maré
subrepo: add revert support without backup for git subrepos...
r23550 revert the subrepository
$ hg revert --all
FUJIWARA Katsunori
tests: discard useless "(glob)" in "reverting subrepo" lines
r23937 reverting subrepo ../gitroot
Mathias De Maré
subrepo: add revert support without backup for git subrepos...
r23550
$ hg status --subrepos
Mathias De Maré
subrepo: add full revert support for git subrepos...
r23678 ? s/barfoo
? s/foobar.orig
Mathias De Maré
subrepo: add revert support without backup for git subrepos...
r23550
Mathias De Maré
subrepo: add full revert support for git subrepos...
r23678 $ mv s/foobar.orig s/foobar
Mathias De Maré
subrepo: add revert support without backup for git subrepos...
r23550 $ hg revert --no-backup s
FUJIWARA Katsunori
tests: discard useless "(glob)" in "reverting subrepo" lines
r23937 reverting subrepo ../gitroot
Mathias De Maré
subrepo: add revert support without backup for git subrepos...
r23550
$ hg status --subrepos
? s/barfoo
Christian Delahousse
git-subrepos: revert respects specified location to save .orig files...
r26940 revert moves orig files to the right place
$ echo 'bloop' > s/foobar
$ hg revert --all --verbose --config 'ui.origbackuppath=.hg/origbackups'
reverting subrepo ../gitroot
Matt Harbison
tests: fix globs for Windows
r26969 creating directory: $TESTTMP/tc/.hg/origbackups (glob)
Mark Thomas
scmutil: don't append .orig to backups in origbackuppath (BC)...
r34145 saving current version of foobar as $TESTTMP/tc/.hg/origbackups/foobar (glob)
Christian Delahousse
git-subrepos: revert respects specified location to save .orig files...
r26940 $ ls .hg/origbackups
Mark Thomas
scmutil: don't append .orig to backups in origbackuppath (BC)...
r34145 foobar
Christian Delahousse
git-subrepos: revert respects specified location to save .orig files...
r26940 $ rm -rf .hg/origbackups
Mathias De Maré
subrepo: add 'cat' support for git subrepos...
r23991 show file at specific revision
$ cat > s/foobar << EOF
> woop woop
> fooo bar
> EOF
$ hg commit --subrepos -m "updated foobar"
committing subrepository s
$ cat > s/foobar << EOF
> current foobar
> (should not be visible using hg cat)
> EOF
$ hg cat -r . s/foobar
woop woop
fooo bar (no-eol)
$ hg cat -r "parents(.)" s/foobar > catparents
$ mkdir -p tmp/s
$ hg cat -r "parents(.)" --output tmp/%% s/foobar
$ diff tmp/% catparents
$ hg cat -r "parents(.)" --output tmp/%s s/foobar
$ diff tmp/foobar catparents
$ hg cat -r "parents(.)" --output tmp/%d/otherfoobar s/foobar
$ diff tmp/s/otherfoobar catparents
$ hg cat -r "parents(.)" --output tmp/%p s/foobar
$ diff tmp/s/foobar catparents
$ hg cat -r "parents(.)" --output tmp/%H s/foobar
$ diff tmp/255ee8cf690ec86e99b1e80147ea93ece117cd9d catparents
$ hg cat -r "parents(.)" --output tmp/%R s/foobar
$ diff tmp/10 catparents
$ hg cat -r "parents(.)" --output tmp/%h s/foobar
$ diff tmp/255ee8cf690e catparents
$ rm tmp/10
$ hg cat -r "parents(.)" --output tmp/%r s/foobar
$ diff tmp/10 catparents
$ mkdir tmp/tc
$ hg cat -r "parents(.)" --output tmp/%b/foobar s/foobar
$ diff tmp/tc/foobar catparents
Mathias De Maré
subrepos: support adding files in git subrepos...
r24174 cleanup
$ rm -r tmp
$ rm catparents
add git files, using either files or patterns
$ echo "hsss! hsssssssh!" > s/snake.python
$ echo "ccc" > s/c.c
$ echo "cpp" > s/cpp.cpp
$ hg add s/snake.python s/c.c s/cpp.cpp
$ hg st --subrepos s
M s/foobar
A s/c.c
A s/cpp.cpp
A s/snake.python
? s/barfoo
$ hg revert s
reverting subrepo ../gitroot
$ hg add --subrepos "glob:**.python"
adding s/snake.python (glob)
$ hg st --subrepos s
A s/snake.python
? s/barfoo
? s/c.c
? s/cpp.cpp
? s/foobar.orig
$ hg revert s
reverting subrepo ../gitroot
$ hg add --subrepos s
adding s/barfoo (glob)
adding s/c.c (glob)
adding s/cpp.cpp (glob)
adding s/foobar.orig (glob)
adding s/snake.python (glob)
$ hg st --subrepos s
A s/barfoo
A s/c.c
A s/cpp.cpp
A s/foobar.orig
A s/snake.python
$ hg revert s
reverting subrepo ../gitroot
make sure everything is reverted correctly
$ hg st --subrepos s
? s/barfoo
? s/c.c
? s/cpp.cpp
? s/foobar.orig
? s/snake.python
$ hg add --subrepos --exclude "path:s/c.c"
adding s/barfoo (glob)
adding s/cpp.cpp (glob)
adding s/foobar.orig (glob)
adding s/snake.python (glob)
$ hg st --subrepos s
A s/barfoo
A s/cpp.cpp
A s/foobar.orig
A s/snake.python
? s/c.c
$ hg revert --all -q
.hgignore should not have influence in subrepos
$ cat > .hgignore << EOF
> syntax: glob
> *.python
> EOF
$ hg add .hgignore
Matt Harbison
subrepo: don't exclude files in .hgignore when adding to git...
r24182 $ hg add --subrepos "glob:**.python" s/barfoo
Mathias De Maré
subrepos: support adding files in git subrepos...
r24174 adding s/snake.python (glob)
$ hg st --subrepos s
Matt Harbison
subrepo: don't exclude files in .hgignore when adding to git...
r24182 A s/barfoo
Mathias De Maré
subrepos: support adding files in git subrepos...
r24174 A s/snake.python
? s/c.c
? s/cpp.cpp
? s/foobar.orig
$ hg revert --all -q
.gitignore should have influence,
except for explicitly added files (no patterns)
$ cat > s/.gitignore << EOF
> *.python
> EOF
$ hg add s/.gitignore
$ hg st --subrepos s
A s/.gitignore
? s/barfoo
? s/c.c
? s/cpp.cpp
? s/foobar.orig
Mathias De Maré
subrepo: add status support for ignored and clean files in git subrepos
r24256 $ hg st --subrepos s --all
A s/.gitignore
? s/barfoo
? s/c.c
? s/cpp.cpp
? s/foobar.orig
I s/snake.python
C s/f
C s/foobar
C s/g
Mathias De Maré
subrepos: support adding files in git subrepos...
r24174 $ hg add --subrepos "glob:**.python"
$ hg st --subrepos s
A s/.gitignore
? s/barfoo
? s/c.c
? s/cpp.cpp
? s/foobar.orig
$ hg add --subrepos s/snake.python
$ hg st --subrepos s
A s/.gitignore
A s/snake.python
? s/barfoo
? s/c.c
? s/cpp.cpp
? s/foobar.orig
correctly do a dry run
$ hg add --subrepos s --dry-run
adding s/barfoo (glob)
adding s/c.c (glob)
adding s/cpp.cpp (glob)
adding s/foobar.orig (glob)
$ hg st --subrepos s
A s/.gitignore
A s/snake.python
? s/barfoo
? s/c.c
? s/cpp.cpp
? s/foobar.orig
Matt Harbison
subrepo: warn when adding already tracked files in gitsubrepo...
r24183 error given when adding an already tracked file
Mathias De Maré
subrepos: support adding files in git subrepos...
r24174 $ hg add s/.gitignore
Matt Harbison
subrepo: warn when adding already tracked files in gitsubrepo...
r24183 s/.gitignore already tracked!
[1]
Mathias De Maré
subrepo: add status support for ignored and clean files in git subrepos
r24256 $ hg add s/g
s/g already tracked!
[1]
Matt Harbison
subrepo: warn when adding already tracked files in gitsubrepo...
r24183
removed files can be re-added
Mathias De Maré
subrepo: add status support for ignored and clean files in git subrepos
r24256 removing files using 'rm' or 'git rm' has the same effect,
since we ignore the staging area
Matt Harbison
subrepo: warn when adding already tracked files in gitsubrepo...
r24183 $ hg ci --subrepos -m 'snake'
committing subrepository s
$ cd s
Mathias De Maré
subrepo: add status support for ignored and clean files in git subrepos
r24256 $ rm snake.python
(remove leftover .hg so Mercurial doesn't look for a root here)
Mathias De Maré
tests: handle deleted .hg directory (git 2.2.0 and higher) (issue4585)...
r24581 $ rm -rf .hg
Mathias De Maré
subrepo: add status support for ignored and clean files in git subrepos
r24256 $ hg status --subrepos --all .
R snake.python
? barfoo
? c.c
? cpp.cpp
? foobar.orig
C .gitignore
C f
C foobar
C g
Matt Harbison
subrepo: warn when adding already tracked files in gitsubrepo...
r24183 $ git rm snake.python
rm 'snake.python'
Mathias De Maré
subrepo: add status support for ignored and clean files in git subrepos
r24256 $ hg status --subrepos --all .
R snake.python
? barfoo
? c.c
? cpp.cpp
? foobar.orig
C .gitignore
C f
C foobar
C g
Matt Harbison
subrepo: warn when adding already tracked files in gitsubrepo...
r24183 $ touch snake.python
$ cd ..
$ hg add s/snake.python
$ hg status -S
M s/snake.python
? .hgignore
? s/barfoo
? s/c.c
? s/cpp.cpp
? s/foobar.orig
Mathias De Maré
subrepo: correctly handle git subdirectory status change...
r24943 $ hg revert --all -q
make sure we show changed files, rather than changed subtrees
$ mkdir s/foo
$ touch s/foo/bwuh
$ hg add s/foo/bwuh
$ hg commit -S -m "add bwuh"
committing subrepository s
$ hg status -S --change .
M .hgsubstate
A s/foo/bwuh
? s/barfoo
? s/c.c
? s/cpp.cpp
? s/foobar.orig
? s/snake.python.orig
Mathias De Maré
subrepos: support adding files in git subrepos...
r24174
Sean Farley
tests: protect tests involving git ext::sh with git-ext-sh
r32902 #if git19
Mateusz Kwapich
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)...
r28658 test for Git CVE-2016-3068
$ hg init malicious-subrepository
$ cd malicious-subrepository
Danek Duvall
tests-subrepo-git: use "f" to dump pwned.txt, for portability...
r29295 $ echo "s = [git]ext::sh -c echo% pwned:% \$PWNED_MSG% >pwned.txt" > .hgsub
Mateusz Kwapich
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)...
r28658 $ git init s
Initialized empty Git repository in $TESTTMP/tc/malicious-subrepository/s/.git/
$ cd s
$ git commit --allow-empty -m 'empty'
[master (root-commit) 153f934] empty
Mathias De Maré
subrepo: add partial diff support for git subrepos...
r23523 $ cd ..
Mateusz Kwapich
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)...
r28658 $ hg add .hgsub
$ hg commit -m "add subrepo"
$ cd ..
Danek Duvall
tests-subrepo-git: make the "pwned" message output in a stable order...
r29256 $ rm -f pwned.txt
Kevin Bullock
subrepo: use unset instead of env -u to fix test on BSDs (issue5229)
r29135 $ unset GIT_ALLOW_PROTOCOL
Matt Mackall
merge with stable
r29328 $ PWNED_MSG="your git is too old or mercurial has regressed" hg clone \
Danek Duvall
tests-subrepo-git: emit a different "pwned" message based on the test...
r29257 > malicious-subrepository malicious-subrepository-protected
Matt Harbison
test-subrepo-git: add globs for Windows
r28939 Cloning into '$TESTTMP/tc/malicious-subrepository-protected/s'... (glob)
Mateusz Kwapich
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)...
r28658 fatal: transport 'ext' not allowed
updating to branch default
Danek Duvall
tests-subrepo-git: use "f" to dump pwned.txt, for portability...
r29295 cloning subrepo s from ext::sh -c echo% pwned:% $PWNED_MSG% >pwned.txt
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 abort: git clone error 128 in s (in subrepository "s")
Mateusz Kwapich
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)...
r28658 [255]
Danek Duvall
tests-subrepo-git: use "f" to dump pwned.txt, for portability...
r29295 $ f -Dq pwned.txt
pwned.txt: file not found
Mateusz Kwapich
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)...
r28658
whitelisting of ext should be respected (that's the git submodule behaviour)
Danek Duvall
tests-subrepo-git: make the "pwned" message output in a stable order...
r29256 $ rm -f pwned.txt
Danek Duvall
tests-subrepo-git: emit a different "pwned" message based on the test...
r29257 $ env GIT_ALLOW_PROTOCOL=ext PWNED_MSG="you asked for it" hg clone \
> malicious-subrepository malicious-subrepository-clone-allowed
Matt Harbison
test-subrepo-git: add globs for Windows
r28939 Cloning into '$TESTTMP/tc/malicious-subrepository-clone-allowed/s'... (glob)
Mateusz Kwapich
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)...
r28658 fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
updating to branch default
Danek Duvall
tests-subrepo-git: use "f" to dump pwned.txt, for portability...
r29295 cloning subrepo s from ext::sh -c echo% pwned:% $PWNED_MSG% >pwned.txt
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 abort: git clone error 128 in s (in subrepository "s")
Mateusz Kwapich
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)...
r28658 [255]
Danek Duvall
tests-subrepo-git: use "f" to dump pwned.txt, for portability...
r29295 $ f -Dq pwned.txt
pwned: you asked for it
Sean Farley
tests: protect tests involving git ext::sh with git-ext-sh
r32902
#endif
Sean Farley
subrepo: add tests for git rogue ssh urls (SEC)...
r33731
test for ssh exploit with git subrepos 2017-07-25
$ hg init malicious-proxycommand
$ cd malicious-proxycommand
$ echo 's = [git]ssh://-oProxyCommand=rm${IFS}non-existent/path' > .hgsub
$ git init s
Initialized empty Git repository in $TESTTMP/tc/malicious-proxycommand/s/.git/
$ cd s
$ git commit --allow-empty -m 'empty'
[master (root-commit) 153f934] empty
$ 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=rm${IFS}non-existent/path' (in subrepository "s")
[255]
also check that a percent encoded '-' (%2D) doesn't work
$ cd malicious-proxycommand
$ echo 's = [git]ssh://%2DoProxyCommand=rm${IFS}non-existent/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=rm${IFS}non-existent/path' (in subrepository "s")
[255]