test-subrepo-git.t
804 lines
| 17.8 KiB
| text/troff
|
Tads3Lexer
/ tests / test-subrepo-git.t
|
r22046 | #require git | ||
|
r12992 | |||
make git commits repeatable | ||||
|
r17022 | $ echo "[core]" >> $HOME/.gitconfig | ||
$ echo "autocrlf = false" >> $HOME/.gitconfig | ||||
|
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 | ||||
|
r23693 | $ GIT_CONFIG_NOSYSTEM=1; export GIT_CONFIG_NOSYSTEM | ||
|
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 | ||||
|
r12995 | record a new commit from upstream from a different branch | ||
|
r12992 | |||
$ cd ../gitroot | ||||
|
r13091 | $ git checkout -q -b testing | ||
|
r12992 | $ echo gg >> g | ||
$ git commit -q -a -m gg | ||||
$ cd ../t/s | ||||
|
r13091 | $ git pull -q >/dev/null 2>/dev/null | ||
$ git checkout -q -b testing origin/testing >/dev/null | ||||
|
r12992 | |||
$ cd .. | ||||
|
r13182 | $ hg status --subrepos | ||
M s/g | ||||
|
r12992 | $ hg commit -m 'update git subrepo' | ||
$ hg debugsub | ||||
path s | ||||
source ../gitroot | ||||
revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a | ||||
|
r12993 | |||
|
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 | ||||
|
r12993 | clone root | ||
|
r13092 | $ cd t | ||
|
r20105 | $ hg clone . ../tc 2> /dev/null | ||
|
r12993 | updating to branch default | ||
|
r13525 | cloning subrepo s from $TESTTMP/gitroot | ||
|
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 | ||||
|
r13111 | $ hg update 1 -q | ||
|
r12993 | $ cat s/g | ||
g | ||||
$ hg debugsub | ||||
path s | ||||
source ../gitroot | ||||
revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 | ||||
|
r12994 | |||
clone root, make local change | ||||
|
r13092 | $ cd ../t | ||
|
r20105 | $ hg clone . ../ta 2> /dev/null | ||
|
r12994 | updating to branch default | ||
|
r13525 | cloning subrepo s from $TESTTMP/gitroot | ||
|
r12994 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ cd ../ta | ||||
$ echo ggg >> s/g | ||||
|
r13182 | $ hg status --subrepos | ||
M s/g | ||||
|
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 | ||||
|
r23938 | +ggg | ||
|
r15321 | $ hg commit --subrepos -m ggg | ||
|
r13181 | committing subrepository s | ||
|
r12994 | $ hg debugsub | ||
path s | ||||
source ../gitroot | ||||
revision 79695940086840c99328513acbe35f90fcd55e57 | ||||
clone root separately, make different local change | ||||
$ cd ../t | ||||
|
r20105 | $ hg clone . ../tb 2> /dev/null | ||
|
r12994 | updating to branch default | ||
|
r13525 | cloning subrepo s from $TESTTMP/gitroot | ||
|
r12994 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ cd ../tb/s | ||||
|
r23411 | $ hg status --subrepos | ||
|
r12994 | $ echo f > f | ||
|
r23411 | $ hg status --subrepos | ||
? s/f | ||||
|
r12994 | $ git add f | ||
$ cd .. | ||||
|
r13182 | $ hg status --subrepos | ||
A s/f | ||||
|
r15321 | $ hg commit --subrepos -m f | ||
|
r13181 | committing subrepository s | ||
|
r12994 | $ hg debugsub | ||
path s | ||||
source ../gitroot | ||||
revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc | ||||
user b push changes | ||||
|
r13091 | $ hg push 2>/dev/null | ||
|
r17022 | pushing to $TESTTMP/t (glob) | ||
|
r13029 | pushing branch testing of subrepo s | ||
|
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 | ||||
|
r17022 | pulling from $TESTTMP/t (glob) | ||
|
r12994 | 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) | ||||
|
r13091 | $ hg merge 2>/dev/null | ||
|
r21401 | subrepository s diverged (local revision: 7969594, remote revision: aa84837) | ||
|
r19811 | (M)erge, keep (l)ocal or keep (r)emote? m | ||
|
r13569 | pulling subrepo s from $TESTTMP/gitroot | ||
|
r12994 | 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 | ||||
|
r15321 | $ hg commit --subrepos -m 'merge' | ||
|
r13181 | committing subrepository s | ||
|
r13182 | $ hg status --subrepos --rev 1:5 | ||
M .hgsubstate | ||||
M s/g | ||||
A s/f | ||||
|
r12994 | $ hg debugsub | ||
path s | ||||
source ../gitroot | ||||
revision f47b465e1bce645dbf37232a00574aa1546ca8d3 | ||||
|
r13091 | $ hg push 2>/dev/null | ||
|
r17022 | pushing to $TESTTMP/t (glob) | ||
|
r13029 | pushing branch testing of subrepo s | ||
|
r12994 | searching for changes | ||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 2 changesets with 2 changes to 1 files | ||||
|
r12996 | |||
|
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 | ||||
|
r13091 | $ git push origin testing 2>/dev/null | ||
|
r13029 | |||
make and push changes to hg without updating the subrepo | ||||
$ cd ../t | ||||
|
r20105 | $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.' | ||
|
r13029 | updating to branch default | ||
|
r13525 | cloning subrepo s from $TESTTMP/gitroot | ||
|
r13029 | 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 | ||||
|
r17022 | pushing to $TESTTMP/t (glob) | ||
|
r13029 | searching for changes | ||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
|
r13087 | sync to upstream git, distribute changes | ||
$ cd ../ta | ||||
$ hg pull -u -q | ||||
$ cd s | ||||
|
r13091 | $ git pull -q >/dev/null 2>/dev/null | ||
|
r13087 | $ cd .. | ||
$ hg commit -m 'git upstream sync' | ||||
$ hg debugsub | ||||
path s | ||||
source ../gitroot | ||||
revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc | ||||
$ hg push -q | ||||
$ cd ../tb | ||||
$ hg pull -q | ||||
|
r13091 | $ hg update 2>/dev/null | ||
|
r13569 | pulling subrepo s from $TESTTMP/gitroot | ||
|
r13087 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ hg debugsub | ||||
path s | ||||
source ../gitroot | ||||
revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc | ||||
|
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 | ||||
|
r19049 | $ git branch --no-track oldtesting | ||
|
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 | ||||
|
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 | ||||
|
r13010 | $ ls -a s | ||
|
r12996 | . | ||
.. | ||||
.git | ||||
$ hg up 2 | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
|
r13010 | $ ls -a s | ||
|
r12996 | . | ||
.. | ||||
.git | ||||
g | ||||
|
r13027 | |||
archive subrepos | ||||
|
r13091 | $ cd ../tc | ||
$ hg pull -q | ||||
$ hg archive --subrepos -r 5 ../archive 2>/dev/null | ||||
|
r13569 | pulling subrepo s from $TESTTMP/gitroot | ||
|
r13027 | $ cd ../archive | ||
$ cat s/f | ||||
f | ||||
$ cat s/g | ||||
g | ||||
gg | ||||
ggg | ||||
|
r13181 | |||
|
r17108 | $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null | ||
|
r17114 | $ find ../archive_x | sort | grep -v pax_global_header | ||
|
r17108 | ../archive_x | ||
../archive_x/.hg_archival.txt | ||||
../archive_x/.hgsub | ||||
../archive_x/.hgsubstate | ||||
../archive_x/a | ||||
../archive_x/s | ||||
../archive_x/s/g | ||||
|
r13181 | create nested repo | ||
$ cd .. | ||||
$ hg init outer | ||||
$ cd outer | ||||
$ echo b>b | ||||
$ hg add b | ||||
$ hg commit -m b | ||||
|
r20105 | $ hg clone ../t inner 2> /dev/null | ||
|
r13181 | updating to branch default | ||
|
r13525 | cloning subrepo s from $TESTTMP/gitroot | ||
|
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 | ||||
|
r13182 | $ hg status --subrepos | ||
M inner/s/f | ||||
|
r15321 | $ hg commit --subrepos -m nested | ||
|
r13181 | committing subrepository inner | ||
|
r17022 | committing subrepository inner/s (glob) | ||
|
r13181 | |||
nested archive | ||||
$ hg archive --subrepos ../narchive | ||||
|
r13296 | $ ls ../narchive/inner/s | grep -v pax_global_header | ||
|
r13181 | f | ||
g | ||||
|
r13324 | |||
|
r13460 | relative source expansion | ||
$ cd .. | ||||
$ mkdir d | ||||
|
r20105 | $ hg clone t d/t 2> /dev/null | ||
|
r13460 | updating to branch default | ||
|
r13525 | cloning subrepo s from $TESTTMP/gitroot | ||
|
r13460 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
|
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 | ||||
|
r18109 | abort: subrepo s is missing (in subrepo s) | ||
|
r13553 | [255] | ||
|
r15321 | $ hg commit --subrepos -qm missing | ||
|
r18109 | abort: subrepo s is missing (in subrepo s) | ||
|
r13553 | [255] | ||
|
r20105 | $ hg update -C 2> /dev/null | ||
|
r13560 | cloning subrepo s from $TESTTMP/gitroot | ||
|
r13553 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ hg sum | grep commit | ||||
commit: (clean) | ||||
|
r14469 | Don't crash if the .hgsubstate entry is missing | ||
$ hg update 1 -q | ||||
$ hg rm .hgsubstate | ||||
$ hg commit .hgsubstate -m 'no substate' | ||||
|
r16073 | nothing changed | ||
[1] | ||||
|
r14469 | $ hg tag -l nosubstate | ||
$ hg manifest | ||||
.hgsub | ||||
|
r16073 | .hgsubstate | ||
|
r14469 | a | ||
$ hg status -S | ||||
|
r16073 | R .hgsubstate | ||
|
r14469 | $ hg sum | grep commit | ||
|
r16073 | commit: 1 removed, 1 subrepos (new branch head) | ||
|
r14469 | |||
$ hg commit -m 'restore substate' | ||||
|
r16073 | nothing changed | ||
[1] | ||||
|
r14469 | $ hg manifest | ||
.hgsub | ||||
.hgsubstate | ||||
a | ||||
$ hg sum | grep commit | ||||
|
r16073 | commit: 1 removed, 1 subrepos (new branch head) | ||
|
r14469 | |||
$ hg update -qC nosubstate | ||||
$ ls s | ||||
|
r16073 | g | ||
|
r14469 | |||
|
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) | ||||
|
r13324 | Check hg update --clean | ||
|
r13331 | $ cd $TESTTMP/ta | ||
|
r13324 | $ echo > s/g | ||
$ cd s | ||||
$ echo c1 > f1 | ||||
$ echo c1 > f2 | ||||
$ git add f1 | ||||
$ cd .. | ||||
|
r13331 | $ hg status -S | ||
M s/g | ||||
A s/f1 | ||||
|
r23411 | ? s/f2 | ||
|
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 | ||||
|
r23411 | ? s/f1 | ||
? s/f2 | ||||
|
r13331 | $ ls s | ||
f | ||||
f1 | ||||
f2 | ||||
g | ||||
|
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 .. | ||||
|
r21024 | Sticky subrepositories, file changes | ||
|
r13417 | $ touch s/f1 | ||
$ cd s | ||||
$ git add f1 | ||||
$ cd .. | ||||
$ hg id -n | ||||
|
r17255 | 1+ | ||
|
r13417 | $ cd s | ||
$ git rev-parse HEAD | ||||
da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 | ||||
$ cd .. | ||||
$ hg update 4 | ||||
|
r21401 | subrepository s diverged (local revision: da5f5b1, remote revision: aa84837) | ||
|
r19811 | (M)erge, keep (l)ocal or keep (r)emote? m | ||
|
r13417 | subrepository sources for s differ | ||
|
r22590 | use (l)ocal source (da5f5b1) or (r)emote source (aa84837)? l | ||
|
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 .. | ||||
|
r17345 | $ hg update --clean tip > /dev/null 2>&1 | ||
|
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 | ||||
|
r21401 | subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1) | ||
|
r19811 | (M)erge, keep (l)ocal or keep (r)emote? m | ||
|
r13417 | subrepository sources for s differ (in checked out version) | ||
|
r22590 | use (l)ocal source (32a3438) or (r)emote source (da5f5b1)? l | ||
|
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 | ||||
|
r21401 | subrepository s diverged (local revision: 32a3438, remote revision: 32a3438) | ||
|
r19811 | (M)erge, keep (l)ocal or keep (r)emote? m | ||
|
r13417 | subrepository sources for s differ | ||
|
r22590 | use (l)ocal source (32a3438) or (r)emote source (32a3438)? l | ||
|
r13417 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ hg id -n | ||||
|
r17255 | 7+ | ||
|
r13417 | $ cd s | ||
$ git rev-parse HEAD | ||||
aa84837ccfbdfedcdcdeeedc309d73e6eb069edc | ||||
$ cd .. | ||||
Sticky repository, update --clean | ||||
|
r16264 | $ hg update --clean tip 2>/dev/null | ||
|
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 .. | ||||
|
r16527 | Test forgetting files, not implemented in git subrepo, used to | ||
traceback | ||||
|
r17022 | #if no-windows | ||
|
r16527 | $ hg forget 'notafile*' | ||
notafile*: No such file or directory | ||||
[1] | ||||
|
r17022 | #else | ||
$ hg forget 'notafile' | ||||
notafile: * (glob) | ||||
[1] | ||||
#endif | ||||
|
r16913 | |||
$ cd .. | ||||
|
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 .. | ||||
|
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) | ||||
|
r21564 | $ cd tc | ||
$ hg parents -q | ||||
8:3473d20bddcf | ||||
$ grep ' s$' .hgsubstate | ||||
c4069473b459cf27fd4d7c2f50c4346b4e936599 s | ||||
|
r21748 | $ test -f s/.hg/hgrc | ||
|
r21564 | [1] | ||
|
r21748 | $ test -f s/sub/.hg/hgrc | ||
|
r21564 | [1] | ||
$ cd .. | ||||
|
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 | ||||
|
r21748 | $ test -f s/.hg/hgrc | ||
|
r21565 | [1] | ||
|
r21748 | $ test -f s/sub/.hg/hgrc | ||
|
r21565 | [1] | ||
|
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 | ||||
|
r21565 | $ hg parents -q | ||
9:ed23f7fe024e | ||||
$ grep ' s$' .hgsubstate | ||||
f262643c1077219fbd3858d54e78ef050ef84fbf s | ||||
|
r21748 | $ test -f s/.hg/hgrc | ||
|
r21565 | [1] | ||
|
r21748 | $ test -f s/sub/.hg/hgrc | ||
|
r21565 | [1] | ||
|
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 | ||||
checking out detached HEAD in subrepo s | ||||
check out a git branch if you intend to make changes | ||||
|
r23523 | check differences made by most recent change | ||
$ cd s | ||||
$ cat > foobar << EOF | ||||
> woopwoop | ||||
> | ||||
> foo | ||||
> bar | ||||
> EOF | ||||
$ git add foobar | ||||
|
r21565 | $ cd .. | ||
|
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 | ||||
|
r23938 | +bar | ||
|
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 | ||||
|
r23938 | +bar | ||
|
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 | ||||
|
r23938 | +bar | ||
|
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 | ||||
@@ -0,0 +1 @@ | ||||
|
r23938 | +foo | ||
|
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 | ||||
|
r23938 | bar | ||
|
r23523 | |||
|
r23542 | execute a diffstat | ||
the output contains a regex, because git 1.7.10 and 1.7.11 | ||||
change the amount of whitespace | ||||
|
r23523 | $ hg diff --subrepos --stat | ||
|
r23542 | \s*barfoo |\s*1 + (re) | ||
\s*foobar |\s*2 +- (re) | ||||
|
r23938 | 2 files changed, 2 insertions\(\+\), 1 deletions?\(-\) (re) | ||
|
r23523 | |||
ensure adding include/exclude ignores the subrepo | ||||
$ hg diff --subrepos -I s/foobar | ||||
$ hg diff --subrepos -X s/foobar | ||||
|
r23550 | revert the subrepository | ||
$ hg revert --all | ||||
|
r23937 | reverting subrepo ../gitroot | ||
|
r23550 | |||
$ hg status --subrepos | ||||
|
r23678 | ? s/barfoo | ||
? s/foobar.orig | ||||
|
r23550 | |||
|
r23678 | $ mv s/foobar.orig s/foobar | ||
|
r23550 | $ hg revert --no-backup s | ||
|
r23937 | reverting subrepo ../gitroot | ||
|
r23550 | |||
$ hg status --subrepos | ||||
? s/barfoo | ||||
|
r23523 | $ cd .. | ||