##// END OF EJS Templates
test-subrepo-git.t: make compatible with old git
test-subrepo-git.t: make compatible with old git

File last commit:

r13331:9f2c6892 default
r13331:9f2c6892 default
Show More
test-subrepo-git.t
331 lines | 6.7 KiB | text/troff | Tads3Lexer
/ tests / test-subrepo-git.t
Eric Eisner
subrepo: support for adding a git subrepo...
r12992 $ "$TESTDIR/hghave" git || exit 80
make git commits repeatable
$ 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
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'
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181 committing subrepository s
Eric Eisner
subrepo: support for adding a git subrepo...
r12992 $ 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'
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181 committing subrepository s
Eric Eisner
subrepo: support for adding a git subrepo...
r12992 $ 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
Eric Eisner
subrepo: cloning and updating of git subrepos...
r12993 $ hg clone . ../tc
updating to branch default
cloning subrepo s
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
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 $ hg clone . ../ta
updating to branch default
cloning subrepo s
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
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 $ hg commit -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
$ hg clone . ../tb
updating to branch default
cloning subrepo s
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd ../tb/s
$ echo f > f
$ git add f
$ cd ..
Eric Eisner
subrepo: basic support for status of git subrepos
r13182 $ hg status --subrepos
A s/f
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 $ hg commit -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
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 pushing to $TESTTMP/t
Eric Eisner
subrepo: lazier git push logic...
r13029 pushing branch testing of subrepo 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
pulling from $TESTTMP/t
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
(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
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 pulling subrepo s
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ cat s/f
f
$ cat s/g
g
gg
ggg
$ hg commit -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
Eric Eisner
subrepo: allow git subrepos to push and merge...
r12994 pushing to $TESTTMP/t
Eric Eisner
subrepo: lazier git push logic...
r13029 pushing branch testing of subrepo 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
$ hg clone . ../td
updating to branch default
cloning subrepo s
checking out detached HEAD in subrepo s
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
pushing to $TESTTMP/t
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'
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181 committing subrepository s
Eric Eisner
subrepo: lazily update git's local tracking branches...
r13087 $ 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: lazily update git's local tracking branches...
r13087 pulling subrepo s
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg debugsub
path s
source ../gitroot
revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
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: archive git subrepos
r13027 pulling subrepo s
$ cd ../archive
$ cat s/f
f
$ cat s/g
g
gg
ggg
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
$ hg clone ../t inner
updating to branch default
cloning subrepo s
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo inner = inner > .hgsub
$ hg add .hgsub
$ hg commit -m 'nested sub'
committing subrepository inner
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
Eric Eisner
subrepo: fix subrelpath for git subrepos...
r13181 $ hg commit -m nested
committing subrepository inner
committing subrepository inner/s
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
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
$ ls s
f
f1
f2
g
$ hg update --clean
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg status -S
$ ls s
f
f1
f2
g