test-bookmarks-pushpull.t
1396 lines
| 41.4 KiB
| text/troff
|
Tads3Lexer
/ tests / test-bookmarks-pushpull.t
|
r35264 | #testcases b2-pushkey b2-binary | ||
|
r35265 | |||
#if b2-pushkey | ||||
$ cat << EOF >> $HGRCPATH | ||||
> [devel] | ||||
> legacy.exchange=bookmarks | ||||
> EOF | ||||
#endif | ||||
|
r22046 | #require serve | ||
|
r15446 | |||
|
r17551 | $ cat << EOF >> $HGRCPATH | ||
|
r46350 | > [command-templates] | ||
> log={rev}:{node|short} {desc|firstline} | ||||
|
r17551 | > [phases] | ||
> publish=False | ||||
|
r22955 | > [experimental] | ||
|
r34867 | > evolution.createmarkers=True | ||
|
r34869 | > evolution.exchange=True | ||
|
r17551 | > EOF | ||
|
r34939 | $ cat > $TESTTMP/hook.sh <<'EOF' | ||
> echo "test-hook-bookmark: $HG_BOOKMARK: $HG_OLDNODE -> $HG_NODE" | ||||
> EOF | ||||
$ TESTHOOK="hooks.txnclose-bookmark.test=sh $TESTTMP/hook.sh" | ||||
|
r34709 | |||
|
r12303 | initialize | ||
$ hg init a | ||||
$ cd a | ||||
$ echo 'test' > test | ||||
$ hg commit -Am'test' | ||||
adding test | ||||
set bookmarks | ||||
$ hg bookmark X | ||||
$ hg bookmark Y | ||||
$ hg bookmark Z | ||||
import bookmark by name | ||||
$ hg init ../b | ||||
$ cd ../b | ||||
|
r12969 | $ hg book Y | ||
$ hg book | ||||
* Y -1:000000000000 | ||||
|
r34709 | $ hg pull ../a --config "$TESTHOOK" | ||
|
r12303 | pulling from ../a | ||
requesting all changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
|
r18363 | adding remote bookmark X | ||
|
r13662 | updating bookmark Y | ||
|
r16697 | adding remote bookmark Z | ||
r43167 | added 1 changesets with 1 changes to 1 files | |||
|
r39516 | new changesets 4e3505fd9583 (1 drafts) | ||
|
r34709 | test-hook-bookmark: X: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77 | ||
test-hook-bookmark: Y: 0000000000000000000000000000000000000000 -> 4e3505fd95835d721066b76e75dbb8cc554d7f77 | ||||
test-hook-bookmark: Z: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77 | ||||
|
r12303 | (run 'hg update' to get a working copy) | ||
$ hg bookmarks | ||||
|
r16697 | X 0:4e3505fd9583 | ||
|
r18479 | * Y 0:4e3505fd9583 | ||
|
r16697 | Z 0:4e3505fd9583 | ||
|
r12969 | $ hg debugpushkey ../a namespaces | ||
bookmarks | ||||
namespaces | ||||
|
r17551 | obsolete | ||
|
r18255 | phases | ||
|
r12969 | $ hg debugpushkey ../a bookmarks | ||
|
r18255 | X 4e3505fd95835d721066b76e75dbb8cc554d7f77 | ||
|
r12969 | Y 4e3505fd95835d721066b76e75dbb8cc554d7f77 | ||
Z 4e3505fd95835d721066b76e75dbb8cc554d7f77 | ||||
|
r23199 | |||
|
r23543 | delete the bookmark to re-pull it | ||
|
r23199 | |||
$ hg book -d X | ||||
$ hg pull -B X ../a | ||||
pulling from ../a | ||||
no changes found | ||||
adding remote bookmark X | ||||
finally no-op pull | ||||
|
r12303 | $ hg pull -B X ../a | ||
pulling from ../a | ||||
no changes found | ||||
$ hg bookmark | ||||
|
r13388 | X 0:4e3505fd9583 | ||
|
r18479 | * Y 0:4e3505fd9583 | ||
|
r16697 | Z 0:4e3505fd9583 | ||
|
r12303 | |||
export bookmark by name | ||||
$ hg bookmark W | ||||
$ hg bookmark foo | ||||
$ hg bookmark foobar | ||||
$ hg push -B W ../a | ||||
pushing to ../a | ||||
searching for changes | ||||
no changes found | ||||
exporting bookmark W | ||||
|
r16038 | [1] | ||
|
r12303 | $ hg -R ../a bookmarks | ||
|
r13388 | W -1:000000000000 | ||
|
r12303 | X 0:4e3505fd9583 | ||
|
r13388 | Y 0:4e3505fd9583 | ||
|
r12303 | * Z 0:4e3505fd9583 | ||
|
r12969 | delete a remote bookmark | ||
$ hg book -d W | ||||
|
r35264 | |||
#if b2-pushkey | ||||
|
r35031 | $ hg push -B W ../a --config "$TESTHOOK" --debug --config devel.bundle2.debug=yes | ||
|
r13368 | pushing to ../a | ||
|
r35031 | query 1; heads | ||
|
r13368 | searching for changes | ||
|
r35031 | all remote heads known locally | ||
listing keys for "phases" | ||||
checking for updated bookmarks | ||||
listing keys for "bookmarks" | ||||
|
r13368 | no changes found | ||
|
r35260 | bundle2-output-bundle: "HG20", 4 parts total | ||
|
r35031 | bundle2-output: start emission of HG20 stream | ||
bundle2-output: bundle parameter: | ||||
bundle2-output: start of parts | ||||
bundle2-output: bundle part: "replycaps" | ||||
|
r44896 | bundle2-output-part: "replycaps" 241 bytes payload | ||
|
r35031 | bundle2-output: part 0: "REPLYCAPS" | ||
bundle2-output: header chunk size: 16 | ||||
|
r44896 | bundle2-output: payload chunk size: 241 | ||
|
r35260 | bundle2-output: closing payload chunk | ||
bundle2-output: bundle part: "check:bookmarks" | ||||
bundle2-output-part: "check:bookmarks" 23 bytes payload | ||||
bundle2-output: part 1: "CHECK:BOOKMARKS" | ||||
bundle2-output: header chunk size: 22 | ||||
bundle2-output: payload chunk size: 23 | ||||
|
r35031 | bundle2-output: closing payload chunk | ||
bundle2-output: bundle part: "check:phases" | ||||
|
r39182 | bundle2-output-part: "check:phases" 24 bytes payload | ||
|
r35260 | bundle2-output: part 2: "CHECK:PHASES" | ||
|
r35031 | bundle2-output: header chunk size: 19 | ||
|
r39182 | bundle2-output: payload chunk size: 24 | ||
|
r35031 | bundle2-output: closing payload chunk | ||
bundle2-output: bundle part: "pushkey" | ||||
bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload | ||||
|
r35260 | bundle2-output: part 3: "PUSHKEY" | ||
|
r35031 | bundle2-output: header chunk size: 90 | ||
bundle2-output: closing payload chunk | ||||
bundle2-output: end of bundle | ||||
bundle2-input: start processing of HG20 stream | ||||
bundle2-input: reading bundle2 stream parameters | ||||
bundle2-input-bundle: with-transaction | ||||
bundle2-input: start extraction of bundle2 parts | ||||
bundle2-input: part header size: 16 | ||||
bundle2-input: part type: "REPLYCAPS" | ||||
bundle2-input: part id: "0" | ||||
bundle2-input: part parameters: 0 | ||||
bundle2-input: found a handler for part replycaps | ||||
bundle2-input-part: "replycaps" supported | ||||
|
r44896 | bundle2-input: payload chunk size: 241 | ||
|
r35031 | bundle2-input: payload chunk size: 0 | ||
|
r44896 | bundle2-input-part: total payload size 241 | ||
|
r35260 | bundle2-input: part header size: 22 | ||
bundle2-input: part type: "CHECK:BOOKMARKS" | ||||
bundle2-input: part id: "1" | ||||
bundle2-input: part parameters: 0 | ||||
bundle2-input: found a handler for part check:bookmarks | ||||
bundle2-input-part: "check:bookmarks" supported | ||||
bundle2-input: payload chunk size: 23 | ||||
bundle2-input: payload chunk size: 0 | ||||
bundle2-input-part: total payload size 23 | ||||
|
r35031 | bundle2-input: part header size: 19 | ||
bundle2-input: part type: "CHECK:PHASES" | ||||
|
r35260 | bundle2-input: part id: "2" | ||
|
r35031 | bundle2-input: part parameters: 0 | ||
bundle2-input: found a handler for part check:phases | ||||
bundle2-input-part: "check:phases" supported | ||||
|
r39182 | bundle2-input: payload chunk size: 24 | ||
|
r35031 | bundle2-input: payload chunk size: 0 | ||
|
r39182 | bundle2-input-part: total payload size 24 | ||
|
r35031 | bundle2-input: part header size: 90 | ||
bundle2-input: part type: "PUSHKEY" | ||||
|
r35260 | bundle2-input: part id: "3" | ||
|
r35031 | bundle2-input: part parameters: 4 | ||
bundle2-input: found a handler for part pushkey | ||||
bundle2-input-part: "pushkey" (params: 4 mandatory) supported | ||||
pushing key for "bookmarks:W" | ||||
bundle2-input: payload chunk size: 0 | ||||
bundle2-input: part header size: 0 | ||||
bundle2-input: end of bundle2 stream | ||||
|
r43201 | bundle2-input-bundle: 4 parts total | ||
|
r35031 | running hook txnclose-bookmark.test: sh $TESTTMP/hook.sh | ||
|
r34709 | test-hook-bookmark: W: 0000000000000000000000000000000000000000 -> | ||
|
r35031 | bundle2-output-bundle: "HG20", 1 parts total | ||
bundle2-output: start emission of HG20 stream | ||||
bundle2-output: bundle parameter: | ||||
bundle2-output: start of parts | ||||
bundle2-output: bundle part: "reply:pushkey" | ||||
bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload | ||||
bundle2-output: part 0: "REPLY:PUSHKEY" | ||||
bundle2-output: header chunk size: 43 | ||||
bundle2-output: closing payload chunk | ||||
bundle2-output: end of bundle | ||||
bundle2-input: start processing of HG20 stream | ||||
bundle2-input: reading bundle2 stream parameters | ||||
bundle2-input-bundle: no-transaction | ||||
bundle2-input: start extraction of bundle2 parts | ||||
bundle2-input: part header size: 43 | ||||
bundle2-input: part type: "REPLY:PUSHKEY" | ||||
bundle2-input: part id: "0" | ||||
bundle2-input: part parameters: 2 | ||||
bundle2-input: found a handler for part reply:pushkey | ||||
bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported | ||||
bundle2-input: payload chunk size: 0 | ||||
bundle2-input: part header size: 0 | ||||
bundle2-input: end of bundle2 stream | ||||
|
r43201 | bundle2-input-bundle: 1 parts total | ||
|
r12969 | deleting remote bookmark W | ||
|
r35031 | listing keys for "phases" | ||
|
r16038 | [1] | ||
|
r12969 | |||
|
r35264 | #endif | ||
#if b2-binary | ||||
$ hg push -B W ../a --config "$TESTHOOK" --debug --config devel.bundle2.debug=yes | ||||
pushing to ../a | ||||
query 1; heads | ||||
searching for changes | ||||
all remote heads known locally | ||||
listing keys for "phases" | ||||
checking for updated bookmarks | ||||
listing keys for "bookmarks" | ||||
no changes found | ||||
bundle2-output-bundle: "HG20", 4 parts total | ||||
bundle2-output: start emission of HG20 stream | ||||
bundle2-output: bundle parameter: | ||||
bundle2-output: start of parts | ||||
bundle2-output: bundle part: "replycaps" | ||||
|
r44896 | bundle2-output-part: "replycaps" 241 bytes payload | ||
|
r35264 | bundle2-output: part 0: "REPLYCAPS" | ||
bundle2-output: header chunk size: 16 | ||||
|
r44896 | bundle2-output: payload chunk size: 241 | ||
|
r35264 | bundle2-output: closing payload chunk | ||
bundle2-output: bundle part: "check:bookmarks" | ||||
bundle2-output-part: "check:bookmarks" 23 bytes payload | ||||
bundle2-output: part 1: "CHECK:BOOKMARKS" | ||||
bundle2-output: header chunk size: 22 | ||||
bundle2-output: payload chunk size: 23 | ||||
bundle2-output: closing payload chunk | ||||
bundle2-output: bundle part: "check:phases" | ||||
|
r39182 | bundle2-output-part: "check:phases" 24 bytes payload | ||
|
r35264 | bundle2-output: part 2: "CHECK:PHASES" | ||
bundle2-output: header chunk size: 19 | ||||
|
r39182 | bundle2-output: payload chunk size: 24 | ||
|
r35264 | bundle2-output: closing payload chunk | ||
|
r35265 | bundle2-output: bundle part: "bookmarks" | ||
bundle2-output-part: "bookmarks" 23 bytes payload | ||||
bundle2-output: part 3: "BOOKMARKS" | ||||
bundle2-output: header chunk size: 16 | ||||
bundle2-output: payload chunk size: 23 | ||||
|
r35264 | bundle2-output: closing payload chunk | ||
bundle2-output: end of bundle | ||||
bundle2-input: start processing of HG20 stream | ||||
bundle2-input: reading bundle2 stream parameters | ||||
bundle2-input-bundle: with-transaction | ||||
bundle2-input: start extraction of bundle2 parts | ||||
bundle2-input: part header size: 16 | ||||
bundle2-input: part type: "REPLYCAPS" | ||||
bundle2-input: part id: "0" | ||||
bundle2-input: part parameters: 0 | ||||
bundle2-input: found a handler for part replycaps | ||||
bundle2-input-part: "replycaps" supported | ||||
|
r44896 | bundle2-input: payload chunk size: 241 | ||
|
r35264 | bundle2-input: payload chunk size: 0 | ||
|
r44896 | bundle2-input-part: total payload size 241 | ||
|
r35264 | bundle2-input: part header size: 22 | ||
bundle2-input: part type: "CHECK:BOOKMARKS" | ||||
bundle2-input: part id: "1" | ||||
bundle2-input: part parameters: 0 | ||||
bundle2-input: found a handler for part check:bookmarks | ||||
bundle2-input-part: "check:bookmarks" supported | ||||
bundle2-input: payload chunk size: 23 | ||||
bundle2-input: payload chunk size: 0 | ||||
bundle2-input-part: total payload size 23 | ||||
bundle2-input: part header size: 19 | ||||
bundle2-input: part type: "CHECK:PHASES" | ||||
bundle2-input: part id: "2" | ||||
bundle2-input: part parameters: 0 | ||||
bundle2-input: found a handler for part check:phases | ||||
bundle2-input-part: "check:phases" supported | ||||
|
r39182 | bundle2-input: payload chunk size: 24 | ||
|
r35264 | bundle2-input: payload chunk size: 0 | ||
|
r39182 | bundle2-input-part: total payload size 24 | ||
|
r35265 | bundle2-input: part header size: 16 | ||
bundle2-input: part type: "BOOKMARKS" | ||||
|
r35264 | bundle2-input: part id: "3" | ||
|
r35265 | bundle2-input: part parameters: 0 | ||
bundle2-input: found a handler for part bookmarks | ||||
bundle2-input-part: "bookmarks" supported | ||||
bundle2-input: payload chunk size: 23 | ||||
|
r35264 | bundle2-input: payload chunk size: 0 | ||
|
r35265 | bundle2-input-part: total payload size 23 | ||
|
r35264 | bundle2-input: part header size: 0 | ||
bundle2-input: end of bundle2 stream | ||||
|
r43201 | bundle2-input-bundle: 4 parts total | ||
|
r35264 | running hook txnclose-bookmark.test: sh $TESTTMP/hook.sh | ||
test-hook-bookmark: W: 0000000000000000000000000000000000000000 -> | ||||
|
r35265 | bundle2-output-bundle: "HG20", 0 parts total | ||
|
r35264 | bundle2-output: start emission of HG20 stream | ||
bundle2-output: bundle parameter: | ||||
bundle2-output: start of parts | ||||
bundle2-output: end of bundle | ||||
bundle2-input: start processing of HG20 stream | ||||
bundle2-input: reading bundle2 stream parameters | ||||
bundle2-input-bundle: no-transaction | ||||
bundle2-input: start extraction of bundle2 parts | ||||
bundle2-input: part header size: 0 | ||||
bundle2-input: end of bundle2 stream | ||||
bundle2-input-bundle: 0 parts total | ||||
deleting remote bookmark W | ||||
listing keys for "phases" | ||||
[1] | ||||
#endif | ||||
|
r44854 | Divergent bookmark cannot be exported | ||
$ hg book W@default | ||||
$ hg push -B W@default ../a | ||||
pushing to ../a | ||||
searching for changes | ||||
cannot push divergent bookmark W@default! | ||||
no changes found | ||||
[2] | ||||
$ hg book -d W@default | ||||
|
r28182 | export the active bookmark | ||
$ hg bookmark V | ||||
$ hg push -B . ../a | ||||
pushing to ../a | ||||
searching for changes | ||||
no changes found | ||||
exporting bookmark V | ||||
[1] | ||||
|
r29354 | exporting the active bookmark with 'push -B .' | ||
demand that one of the bookmarks is activated | ||||
$ hg update -r default | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(leaving bookmark V) | ||||
$ hg push -B . ../a | ||||
|
r46518 | abort: no active bookmark | ||
|
r29354 | [255] | ||
$ hg update -r V | ||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
(activating bookmark V) | ||||
|
r28182 | delete the bookmark | ||
$ hg book -d V | ||||
$ hg push -B V ../a | ||||
pushing to ../a | ||||
searching for changes | ||||
no changes found | ||||
deleting remote bookmark V | ||||
[1] | ||||
$ hg up foobar | ||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(activating bookmark foobar) | ||||
|
r12303 | push/pull name that doesn't exist | ||
$ hg push -B badname ../a | ||||
|
r13368 | pushing to ../a | ||
searching for changes | ||||
|
r22651 | bookmark badname does not exist on the local or remote repository! | ||
|
r13368 | no changes found | ||
|
r12316 | [2] | ||
|
r12303 | $ hg pull -B anotherbadname ../a | ||
|
r13368 | pulling from ../a | ||
|
r12303 | abort: remote bookmark anotherbadname not found! | ||
|
r46431 | [10] | ||
|
r12969 | |||
divergent bookmarks | ||||
$ cd ../a | ||||
$ echo c1 > f1 | ||||
$ hg ci -Am1 | ||||
adding f1 | ||||
|
r17770 | $ hg book -f @ | ||
|
r12969 | $ hg book -f X | ||
$ hg book | ||||
|
r17770 | @ 1:0d2164f0ce0d | ||
|
r13388 | * X 1:0d2164f0ce0d | ||
|
r12969 | Y 0:4e3505fd9583 | ||
Z 1:0d2164f0ce0d | ||||
$ cd ../b | ||||
|
r35056 | $ hg up | ||
|
r12969 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
|
r16010 | updating bookmark foobar | ||
|
r12969 | $ echo c2 > f2 | ||
$ hg ci -Am2 | ||||
adding f2 | ||||
|
r18470 | $ hg book -if @ | ||
$ hg book -if X | ||||
|
r12969 | $ hg book | ||
|
r17770 | @ 1:9b140be10808 | ||
|
r18470 | X 1:9b140be10808 | ||
|
r12969 | Y 0:4e3505fd9583 | ||
|
r16697 | Z 0:4e3505fd9583 | ||
|
r12969 | foo -1:000000000000 | ||
|
r18470 | * foobar 1:9b140be10808 | ||
|
r12969 | |||
|
r34709 | $ hg pull --config paths.foo=../a foo --config "$TESTHOOK" | ||
|
r35394 | pulling from $TESTTMP/a | ||
|
r12969 | searching for changes | ||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
|
r18363 | divergent bookmark @ stored as @foo | ||
|
r15614 | divergent bookmark X stored as X@foo | ||
|
r16697 | updating bookmark Z | ||
r43167 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
r39516 | new changesets 0d2164f0ce0d (1 drafts) | ||
|
r34709 | test-hook-bookmark: @foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | ||
test-hook-bookmark: X@foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | ||||
test-hook-bookmark: Z: 4e3505fd95835d721066b76e75dbb8cc554d7f77 -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | ||||
|
r12969 | (run 'hg heads' to see heads, 'hg merge' to merge) | ||
$ hg book | ||||
|
r17770 | @ 1:9b140be10808 | ||
@foo 2:0d2164f0ce0d | ||||
|
r18470 | X 1:9b140be10808 | ||
|
r15614 | X@foo 2:0d2164f0ce0d | ||
|
r12969 | Y 0:4e3505fd9583 | ||
|
r16697 | Z 2:0d2164f0ce0d | ||
|
r12969 | foo -1:000000000000 | ||
|
r18470 | * foobar 1:9b140be10808 | ||
|
r24353 | |||
(test that too many divergence of bookmark) | ||||
|
r39743 | $ "$PYTHON" $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done | ||
|
r24353 | $ hg pull ../a | ||
pulling from ../a | ||||
searching for changes | ||||
no changes found | ||||
warning: failed to assign numbered name to divergent bookmark X | ||||
divergent bookmark @ stored as @1 | ||||
$ hg bookmarks | grep '^ X' | grep -v ':000000000000' | ||||
X 1:9b140be10808 | ||||
X@foo 2:0d2164f0ce0d | ||||
|
r24355 | |||
(test that remotely diverged bookmarks are reused if they aren't changed) | ||||
$ hg bookmarks | grep '^ @' | ||||
@ 1:9b140be10808 | ||||
@1 2:0d2164f0ce0d | ||||
@foo 2:0d2164f0ce0d | ||||
$ hg pull ../a | ||||
pulling from ../a | ||||
searching for changes | ||||
no changes found | ||||
warning: failed to assign numbered name to divergent bookmark X | ||||
divergent bookmark @ stored as @1 | ||||
$ hg bookmarks | grep '^ @' | ||||
@ 1:9b140be10808 | ||||
@1 2:0d2164f0ce0d | ||||
@foo 2:0d2164f0ce0d | ||||
|
r39743 | $ "$PYTHON" $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done | ||
|
r24353 | $ hg bookmarks -d "@1" | ||
|
r12969 | $ hg push -f ../a | ||
pushing to ../a | ||||
searching for changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files (+1 heads) | ||||
$ hg -R ../a book | ||||
|
r17770 | @ 1:0d2164f0ce0d | ||
|
r13388 | * X 1:0d2164f0ce0d | ||
|
r12969 | Y 0:4e3505fd9583 | ||
Z 1:0d2164f0ce0d | ||||
|
r23543 | explicit pull should overwrite the local version (issue4439) | ||
|
r23199 | |||
|
r29376 | $ hg update -r X | ||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(activating bookmark X) | ||||
|
r34709 | $ hg pull --config paths.foo=../a foo -B . --config "$TESTHOOK" | ||
|
r35394 | pulling from $TESTTMP/a | ||
|
r23199 | no changes found | ||
divergent bookmark @ stored as @foo | ||||
importing bookmark X | ||||
|
r34709 | test-hook-bookmark: @foo: 0d2164f0ce0d8f1d6f94351eba04b794909be66c -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | ||
test-hook-bookmark: X: 9b140be1080824d768c5a4691a564088eede71f9 -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | ||||
|
r23199 | |||
reinstall state for further testing: | ||||
$ hg book -fr 9b140be10808 X | ||||
|
r18495 | revsets should not ignore divergent bookmarks | ||
$ hg bookmark -fr 1 Z | ||||
$ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n' | ||||
0:4e3505fd9583 Y | ||||
1:9b140be10808 @ X Z foobar | ||||
2:0d2164f0ce0d @foo X@foo | ||||
$ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n' | ||||
2:0d2164f0ce0d @foo X@foo | ||||
$ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n' | ||||
2:0d2164f0ce0d @foo X@foo | ||||
|
r16835 | update a remote bookmark from a non-head to a head | ||
$ hg up -q Y | ||||
$ echo c3 > f2 | ||||
$ hg ci -Am3 | ||||
adding f2 | ||||
created new head | ||||
|
r34709 | $ hg push ../a --config "$TESTHOOK" | ||
|
r16835 | pushing to ../a | ||
searching for changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files (+1 heads) | ||||
|
r34709 | test-hook-bookmark: Y: 4e3505fd95835d721066b76e75dbb8cc554d7f77 -> f6fc62dde3c0771e29704af56ba4d8af77abcc2f | ||
|
r16835 | updating bookmark Y | ||
$ hg -R ../a book | ||||
|
r17770 | @ 1:0d2164f0ce0d | ||
|
r16835 | * X 1:0d2164f0ce0d | ||
Y 3:f6fc62dde3c0 | ||||
Z 1:0d2164f0ce0d | ||||
|
r18851 | update a bookmark in the middle of a client pulling changes | ||
$ cd .. | ||||
$ hg clone -q a pull-race | ||||
|
r25442 | |||
We want to use http because it is stateless and therefore more susceptible to | ||||
race conditions | ||||
|
r28549 | $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log | ||
|
r25442 | $ cat pull-race.pid >> $DAEMON_PIDS | ||
|
r32077 | $ cat <<EOF > $TESTTMP/out_makecommit.sh | ||
> #!/bin/sh | ||||
> hg ci -Am5 | ||||
> echo committed in pull-race | ||||
> EOF | ||||
|
r34709 | $ hg clone -q http://localhost:$HGPORT/ pull-race2 --config "$TESTHOOK" | ||
test-hook-bookmark: @: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | ||||
test-hook-bookmark: X: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | ||||
test-hook-bookmark: Y: -> f6fc62dde3c0771e29704af56ba4d8af77abcc2f | ||||
test-hook-bookmark: Z: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | ||||
|
r18851 | $ cd pull-race | ||
$ hg up -q Y | ||||
$ echo c4 > f2 | ||||
$ hg ci -Am4 | ||||
$ echo c5 > f3 | ||||
$ cat <<EOF > .hg/hgrc | ||||
> [hooks] | ||||
|
r32077 | > outgoing.makecommit = sh $TESTTMP/out_makecommit.sh | ||
|
r18851 | > EOF | ||
|
r25442 | |||
(new config needs a server restart) | ||||
$ cd .. | ||||
|
r25474 | $ killdaemons.py | ||
|
r28549 | $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log | ||
|
r25442 | $ cat pull-race.pid >> $DAEMON_PIDS | ||
$ cd pull-race2 | ||||
|
r25441 | $ hg -R $TESTTMP/pull-race book | ||
@ 1:0d2164f0ce0d | ||||
X 1:0d2164f0ce0d | ||||
* Y 4:b0a5eff05604 | ||||
Z 1:0d2164f0ce0d | ||||
|
r18851 | $ hg pull | ||
|
r25442 | pulling from http://localhost:$HGPORT/ | ||
|
r18851 | searching for changes | ||
|
r25352 | adding changesets | ||
|
r18851 | adding manifests | ||
adding file changes | ||||
r43167 | updating bookmark Y | |||
|
r18851 | added 1 changesets with 1 changes to 1 files | ||
|
r39516 | new changesets b0a5eff05604 (1 drafts) | ||
|
r18851 | (run 'hg update' to get a working copy) | ||
$ hg book | ||||
* @ 1:0d2164f0ce0d | ||||
X 1:0d2164f0ce0d | ||||
Y 4:b0a5eff05604 | ||||
Z 1:0d2164f0ce0d | ||||
|
r25442 | |||
|
r25446 | Update a bookmark right after the initial lookup -B (issue4689) | ||
$ echo c6 > ../pull-race/f3 # to be committed during the race | ||||
|
r32077 | $ cat <<EOF > $TESTTMP/listkeys_makecommit.sh | ||
> #!/bin/sh | ||||
> if hg st | grep -q M; then | ||||
> hg commit -m race | ||||
> echo committed in pull-race | ||||
> else | ||||
> exit 0 | ||||
> fi | ||||
> EOF | ||||
|
r25446 | $ cat <<EOF > ../pull-race/.hg/hgrc | ||
> [hooks] | ||||
> # If anything to commit, commit it right after the first key listing used | ||||
> # during lookup. This makes the commit appear before the actual getbundle | ||||
> # call. | ||||
|
r32077 | > listkeys.makecommit= sh $TESTTMP/listkeys_makecommit.sh | ||
|
r25446 | > EOF | ||
|
r41055 | $ restart_server() { | ||
> "$TESTDIR/killdaemons.py" $DAEMON_PIDS | ||||
> hg serve -R ../pull-race -p $HGPORT -d --pid-file=../pull-race.pid -E main-error.log | ||||
> cat ../pull-race.pid >> $DAEMON_PIDS | ||||
> } | ||||
$ restart_server # new config need server restart | ||||
|
r25446 | $ hg -R $TESTTMP/pull-race book | ||
@ 1:0d2164f0ce0d | ||||
X 1:0d2164f0ce0d | ||||
* Y 5:35d1ef0a8d1b | ||||
Z 1:0d2164f0ce0d | ||||
|
r29376 | $ hg update -r Y | ||
1 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
(activating bookmark Y) | ||||
$ hg pull -B . | ||||
|
r25446 | pulling from http://localhost:$HGPORT/ | ||
searching for changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
r43167 | updating bookmark Y | |||
|
r25446 | added 1 changesets with 1 changes to 1 files | ||
|
r39516 | new changesets 35d1ef0a8d1b (1 drafts) | ||
|
r25446 | (run 'hg update' to get a working copy) | ||
$ hg book | ||||
|
r29376 | @ 1:0d2164f0ce0d | ||
|
r25446 | X 1:0d2164f0ce0d | ||
|
r29376 | * Y 5:35d1ef0a8d1b | ||
|
r25446 | Z 1:0d2164f0ce0d | ||
|
r41055 | Update a bookmark right after the initial lookup -r (issue4700) | ||
$ echo c7 > ../pull-race/f3 # to be committed during the race | ||||
$ cat <<EOF > ../lookuphook.py | ||||
> """small extensions adding a hook after wireprotocol lookup to test race""" | ||||
> import functools | ||||
> from mercurial import wireprotov1server, wireprotov2server | ||||
> | ||||
> def wrappedlookup(orig, repo, *args, **kwargs): | ||||
> ret = orig(repo, *args, **kwargs) | ||||
> repo.hook(b'lookup') | ||||
> return ret | ||||
> for table in [wireprotov1server.commands, wireprotov2server.COMMANDS]: | ||||
> table[b'lookup'].func = functools.partial(wrappedlookup, table[b'lookup'].func) | ||||
> EOF | ||||
$ cat <<EOF > ../pull-race/.hg/hgrc | ||||
> [extensions] | ||||
> lookuphook=$TESTTMP/lookuphook.py | ||||
> [hooks] | ||||
> lookup.makecommit= sh $TESTTMP/listkeys_makecommit.sh | ||||
> EOF | ||||
$ restart_server # new config need server restart | ||||
$ hg -R $TESTTMP/pull-race book | ||||
@ 1:0d2164f0ce0d | ||||
X 1:0d2164f0ce0d | ||||
* Y 6:0d60821d2197 | ||||
Z 1:0d2164f0ce0d | ||||
$ hg pull -r Y | ||||
pulling from http://localhost:$HGPORT/ | ||||
searching for changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
r43167 | updating bookmark Y | |||
|
r41055 | added 1 changesets with 1 changes to 1 files | ||
new changesets 0d60821d2197 (1 drafts) | ||||
(run 'hg update' to get a working copy) | ||||
$ hg book | ||||
@ 1:0d2164f0ce0d | ||||
X 1:0d2164f0ce0d | ||||
|
r41081 | * Y 6:0d60821d2197 | ||
|
r41055 | Z 1:0d2164f0ce0d | ||
$ hg -R $TESTTMP/pull-race book | ||||
@ 1:0d2164f0ce0d | ||||
X 1:0d2164f0ce0d | ||||
* Y 7:714424d9e8b8 | ||||
Z 1:0d2164f0ce0d | ||||
|
r25442 | (done with this section of the test) | ||
|
r25474 | $ killdaemons.py | ||
|
r18851 | $ cd ../b | ||
|
r16835 | diverging a remote bookmark fails | ||
$ hg up -q 4e3505fd9583 | ||||
$ echo c4 > f2 | ||||
$ hg ci -Am4 | ||||
adding f2 | ||||
created new head | ||||
|
r17864 | $ echo c5 > f2 | ||
$ hg ci -Am5 | ||||
$ hg log -G | ||||
@ 5:c922c0139ca0 5 | ||||
| | ||||
o 4:4efff6d98829 4 | ||||
| | ||||
| o 3:f6fc62dde3c0 3 | ||||
|/ | ||||
| o 2:0d2164f0ce0d 1 | ||||
|/ | ||||
| o 1:9b140be10808 2 | ||||
|/ | ||||
o 0:4e3505fd9583 test | ||||
|
r16835 | $ hg book -f Y | ||
|
r17043 | |||
$ cat <<EOF > ../a/.hg/hgrc | ||||
> [web] | ||||
> push_ssl = false | ||||
> allow_push = * | ||||
> EOF | ||||
|
r28549 | $ hg serve -R ../a -p $HGPORT2 -d --pid-file=../hg2.pid | ||
|
r17043 | $ cat ../hg2.pid >> $DAEMON_PIDS | ||
$ hg push http://localhost:$HGPORT2/ | ||||
pushing to http://localhost:$HGPORT2/ | ||||
|
r16835 | searching for changes | ||
|
r46520 | abort: push creates new remote head c922c0139ca0 with bookmark 'Y' | ||
|
r29973 | (merge or see 'hg help push' for details about pushing new heads) | ||
|
r46735 | [20] | ||
|
r16835 | $ hg -R ../a book | ||
|
r17770 | @ 1:0d2164f0ce0d | ||
|
r16835 | * X 1:0d2164f0ce0d | ||
Y 3:f6fc62dde3c0 | ||||
Z 1:0d2164f0ce0d | ||||
|
r17551 | |||
Unrelated marker does not alter the decision | ||||
$ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb | ||||
r43163 | 1 new obsolescence markers | |||
|
r17551 | $ hg push http://localhost:$HGPORT2/ | ||
pushing to http://localhost:$HGPORT2/ | ||||
searching for changes | ||||
|
r46520 | abort: push creates new remote head c922c0139ca0 with bookmark 'Y' | ||
|
r29973 | (merge or see 'hg help push' for details about pushing new heads) | ||
|
r46735 | [20] | ||
|
r17551 | $ hg -R ../a book | ||
|
r17770 | @ 1:0d2164f0ce0d | ||
|
r17551 | * X 1:0d2164f0ce0d | ||
Y 3:f6fc62dde3c0 | ||||
Z 1:0d2164f0ce0d | ||||
Update to a successor works | ||||
$ hg id --debug -r 3 | ||||
f6fc62dde3c0771e29704af56ba4d8af77abcc2f | ||||
$ hg id --debug -r 4 | ||||
|
r17864 | 4efff6d98829d9c824c621afd6e3f01865f5439f | ||
$ hg id --debug -r 5 | ||||
c922c0139ca03858f655e4a2af4dd02796a63969 tip Y | ||||
|
r17865 | $ hg debugobsolete f6fc62dde3c0771e29704af56ba4d8af77abcc2f cccccccccccccccccccccccccccccccccccccccc | ||
r43163 | 1 new obsolescence markers | |||
|
r33542 | obsoleted 1 changesets | ||
|
r17865 | $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc 4efff6d98829d9c824c621afd6e3f01865f5439f | ||
r43163 | 1 new obsolescence markers | |||
|
r17551 | $ hg push http://localhost:$HGPORT2/ | ||
pushing to http://localhost:$HGPORT2/ | ||||
searching for changes | ||||
remote: adding changesets | ||||
remote: adding manifests | ||||
remote: adding file changes | ||||
|
r17864 | remote: added 2 changesets with 2 changes to 1 files (+1 heads) | ||
|
r25352 | remote: 2 new obsolescence markers | ||
r33249 | remote: obsoleted 1 changesets | |||
|
r17551 | updating bookmark Y | ||
$ hg -R ../a book | ||||
|
r17770 | @ 1:0d2164f0ce0d | ||
|
r17551 | * X 1:0d2164f0ce0d | ||
|
r17864 | Y 5:c922c0139ca0 | ||
|
r17551 | Z 1:0d2164f0ce0d | ||
|
r12969 | hgweb | ||
$ cat <<EOF > .hg/hgrc | ||||
> [web] | ||||
> push_ssl = false | ||||
> allow_push = * | ||||
> EOF | ||||
$ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log | ||||
$ cat ../hg.pid >> $DAEMON_PIDS | ||||
$ cd ../a | ||||
|
r17345 | $ hg debugpushkey http://localhost:$HGPORT/ namespaces | ||
|
r12969 | bookmarks | ||
namespaces | ||||
|
r17551 | obsolete | ||
|
r18255 | phases | ||
|
r12969 | $ hg debugpushkey http://localhost:$HGPORT/ bookmarks | ||
|
r17770 | @ 9b140be1080824d768c5a4691a564088eede71f9 | ||
|
r18255 | X 9b140be1080824d768c5a4691a564088eede71f9 | ||
Y c922c0139ca03858f655e4a2af4dd02796a63969 | ||||
|
r18495 | Z 9b140be1080824d768c5a4691a564088eede71f9 | ||
|
r17770 | foo 0000000000000000000000000000000000000000 | ||
foobar 9b140be1080824d768c5a4691a564088eede71f9 | ||||
|
r12969 | $ hg out -B http://localhost:$HGPORT/ | ||
comparing with http://localhost:$HGPORT/ | ||||
searching for changed bookmarks | ||||
|
r24658 | @ 0d2164f0ce0d | ||
X 0d2164f0ce0d | ||||
Z 0d2164f0ce0d | ||||
foo | ||||
foobar | ||||
|
r12969 | $ hg push -B Z http://localhost:$HGPORT/ | ||
pushing to http://localhost:$HGPORT/ | ||||
searching for changes | ||||
no changes found | ||||
|
r22651 | updating bookmark Z | ||
|
r16038 | [1] | ||
|
r12969 | $ hg book -d Z | ||
$ hg in -B http://localhost:$HGPORT/ | ||||
comparing with http://localhost:$HGPORT/ | ||||
searching for changed bookmarks | ||||
|
r24657 | @ 9b140be10808 | ||
X 9b140be10808 | ||||
|
r12969 | Z 0d2164f0ce0d | ||
foo 000000000000 | ||||
|
r15935 | foobar 9b140be10808 | ||
|
r12969 | $ hg pull -B Z http://localhost:$HGPORT/ | ||
pulling from http://localhost:$HGPORT/ | ||||
no changes found | ||||
|
r17770 | divergent bookmark @ stored as @1 | ||
|
r18363 | divergent bookmark X stored as X@1 | ||
adding remote bookmark Z | ||||
|
r17770 | adding remote bookmark foo | ||
|
r16697 | adding remote bookmark foobar | ||
|
r13604 | $ hg clone http://localhost:$HGPORT/ cloned-bookmarks | ||
requesting all changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
|
r17864 | added 5 changesets with 5 changes to 3 files (+2 heads) | ||
|
r25352 | 2 new obsolescence markers | ||
|
r39516 | new changesets 4e3505fd9583:c922c0139ca0 (5 drafts) | ||
|
r17882 | updating to bookmark @ | ||
|
r13604 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ hg -R cloned-bookmarks bookmarks | ||||
|
r17870 | * @ 1:9b140be10808 | ||
|
r13604 | X 1:9b140be10808 | ||
|
r17864 | Y 4:c922c0139ca0 | ||
|
r13604 | Z 2:0d2164f0ce0d | ||
foo -1:000000000000 | ||||
|
r15935 | foobar 1:9b140be10808 | ||
|
r17346 | |||
|
r17189 | $ cd .. | ||
|
r30332 | Test to show result of bookmarks comparison | ||
|
r24659 | |||
$ mkdir bmcomparison | ||||
$ cd bmcomparison | ||||
$ hg init source | ||||
$ hg -R source debugbuilddag '+2*2*3*4' | ||||
$ hg -R source log -G --template '{rev}:{node|short}' | ||||
o 4:e7bd5218ca15 | ||||
| | ||||
| o 3:6100d3090acf | ||||
|/ | ||||
| o 2:fa942426a6fd | ||||
|/ | ||||
| o 1:66f7d451a68b | ||||
|/ | ||||
o 0:1ea73414a91b | ||||
$ hg -R source bookmarks -r 0 SAME | ||||
$ hg -R source bookmarks -r 0 ADV_ON_REPO1 | ||||
$ hg -R source bookmarks -r 0 ADV_ON_REPO2 | ||||
$ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO1 | ||||
$ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO2 | ||||
$ hg -R source bookmarks -r 1 DIVERGED | ||||
$ hg clone -U source repo1 | ||||
(test that incoming/outgoing exit with 1, if there is no bookmark to | ||||
|
r26781 | be exchanged) | ||
|
r24659 | |||
$ hg -R repo1 incoming -B | ||||
|
r35394 | comparing with $TESTTMP/bmcomparison/source | ||
|
r24659 | searching for changed bookmarks | ||
no changed bookmarks found | ||||
[1] | ||||
$ hg -R repo1 outgoing -B | ||||
|
r35394 | comparing with $TESTTMP/bmcomparison/source | ||
|
r24659 | searching for changed bookmarks | ||
no changed bookmarks found | ||||
[1] | ||||
$ hg -R repo1 bookmarks -f -r 1 ADD_ON_REPO1 | ||||
$ hg -R repo1 bookmarks -f -r 2 ADV_ON_REPO1 | ||||
$ hg -R repo1 bookmarks -f -r 3 DIFF_ADV_ON_REPO1 | ||||
$ hg -R repo1 bookmarks -f -r 3 DIFF_DIVERGED | ||||
$ hg -R repo1 -q --config extensions.mq= strip 4 | ||||
$ hg -R repo1 log -G --template '{node|short} ({bookmarks})' | ||||
o 6100d3090acf (DIFF_ADV_ON_REPO1 DIFF_DIVERGED) | ||||
| | ||||
| o fa942426a6fd (ADV_ON_REPO1) | ||||
|/ | ||||
| o 66f7d451a68b (ADD_ON_REPO1 DIVERGED) | ||||
|/ | ||||
o 1ea73414a91b (ADV_ON_REPO2 DIFF_ADV_ON_REPO2 SAME) | ||||
$ hg clone -U source repo2 | ||||
$ hg -R repo2 bookmarks -f -r 1 ADD_ON_REPO2 | ||||
$ hg -R repo2 bookmarks -f -r 1 ADV_ON_REPO2 | ||||
$ hg -R repo2 bookmarks -f -r 2 DIVERGED | ||||
$ hg -R repo2 bookmarks -f -r 4 DIFF_ADV_ON_REPO2 | ||||
$ hg -R repo2 bookmarks -f -r 4 DIFF_DIVERGED | ||||
$ hg -R repo2 -q --config extensions.mq= strip 3 | ||||
$ hg -R repo2 log -G --template '{node|short} ({bookmarks})' | ||||
o e7bd5218ca15 (DIFF_ADV_ON_REPO2 DIFF_DIVERGED) | ||||
| | ||||
| o fa942426a6fd (DIVERGED) | ||||
|/ | ||||
| o 66f7d451a68b (ADD_ON_REPO2 ADV_ON_REPO2) | ||||
|/ | ||||
o 1ea73414a91b (ADV_ON_REPO1 DIFF_ADV_ON_REPO1 SAME) | ||||
(test that difference of bookmarks between repositories are fully shown) | ||||
$ hg -R repo1 incoming -B repo2 -v | ||||
comparing with repo2 | ||||
searching for changed bookmarks | ||||
|
r24660 | ADD_ON_REPO2 66f7d451a68b added | ||
ADV_ON_REPO2 66f7d451a68b advanced | ||||
DIFF_ADV_ON_REPO2 e7bd5218ca15 changed | ||||
DIFF_DIVERGED e7bd5218ca15 changed | ||||
DIVERGED fa942426a6fd diverged | ||||
|
r24659 | $ hg -R repo1 outgoing -B repo2 -v | ||
comparing with repo2 | ||||
searching for changed bookmarks | ||||
|
r24661 | ADD_ON_REPO1 66f7d451a68b added | ||
ADD_ON_REPO2 deleted | ||||
ADV_ON_REPO1 fa942426a6fd advanced | ||||
DIFF_ADV_ON_REPO1 6100d3090acf advanced | ||||
DIFF_ADV_ON_REPO2 1ea73414a91b changed | ||||
DIFF_DIVERGED 6100d3090acf changed | ||||
DIVERGED 66f7d451a68b diverged | ||||
|
r24659 | |||
$ hg -R repo2 incoming -B repo1 -v | ||||
comparing with repo1 | ||||
searching for changed bookmarks | ||||
|
r24660 | ADD_ON_REPO1 66f7d451a68b added | ||
ADV_ON_REPO1 fa942426a6fd advanced | ||||
DIFF_ADV_ON_REPO1 6100d3090acf changed | ||||
DIFF_DIVERGED 6100d3090acf changed | ||||
DIVERGED 66f7d451a68b diverged | ||||
|
r24659 | $ hg -R repo2 outgoing -B repo1 -v | ||
comparing with repo1 | ||||
searching for changed bookmarks | ||||
|
r24661 | ADD_ON_REPO1 deleted | ||
ADD_ON_REPO2 66f7d451a68b added | ||||
ADV_ON_REPO2 66f7d451a68b advanced | ||||
DIFF_ADV_ON_REPO1 1ea73414a91b changed | ||||
DIFF_ADV_ON_REPO2 e7bd5218ca15 advanced | ||||
DIFF_DIVERGED e7bd5218ca15 changed | ||||
DIVERGED fa942426a6fd diverged | ||||
|
r24659 | |||
$ cd .. | ||||
|
r17189 | Pushing a bookmark should only push the changes required by that | ||
bookmark, not all outgoing changes: | ||||
$ hg clone http://localhost:$HGPORT/ addmarks | ||||
requesting all changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
|
r17864 | added 5 changesets with 5 changes to 3 files (+2 heads) | ||
|
r25352 | 2 new obsolescence markers | ||
|
r39516 | new changesets 4e3505fd9583:c922c0139ca0 (5 drafts) | ||
|
r17882 | updating to bookmark @ | ||
|
r17189 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ cd addmarks | ||||
$ echo foo > foo | ||||
$ hg add foo | ||||
$ hg commit -m 'add foo' | ||||
$ echo bar > bar | ||||
$ hg add bar | ||||
$ hg commit -m 'add bar' | ||||
$ hg co "tip^" | ||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
|
r21404 | (leaving bookmark @) | ||
|
r17189 | $ hg book add-foo | ||
$ hg book -r tip add-bar | ||||
Note: this push *must* push only a single changeset, as that's the point | ||||
of this test. | ||||
|
r17548 | $ hg push -B add-foo --traceback | ||
|
r17189 | pushing to http://localhost:$HGPORT/ | ||
searching for changes | ||||
remote: adding changesets | ||||
remote: adding manifests | ||||
remote: adding file changes | ||||
remote: added 1 changesets with 1 changes to 1 files | ||||
exporting bookmark add-foo | ||||
|
r12969 | |||
|
r20184 | pushing a new bookmark on a new head does not require -f if -B is specified | ||
$ hg up -q X | ||||
$ hg book W | ||||
$ echo c5 > f2 | ||||
$ hg ci -Am5 | ||||
created new head | ||||
|
r29229 | $ hg push -B . | ||
|
r20184 | pushing to http://localhost:$HGPORT/ | ||
searching for changes | ||||
remote: adding changesets | ||||
remote: adding manifests | ||||
remote: adding file changes | ||||
remote: added 1 changesets with 1 changes to 1 files (+1 heads) | ||||
exporting bookmark W | ||||
$ hg -R ../b id -r W | ||||
cc978a373a53 tip W | ||||
|
r26819 | pushing an existing but divergent bookmark with -B still requires -f | ||
|
r28082 | $ hg clone -q . ../r | ||
|
r26819 | $ hg up -q X | ||
$ echo 1 > f2 | ||||
$ hg ci -qAml | ||||
|
r28082 | $ cd ../r | ||
|
r26819 | $ hg up -q X | ||
$ echo 2 > f2 | ||||
$ hg ci -qAmr | ||||
$ hg push -B X | ||||
|
r35394 | pushing to $TESTTMP/addmarks | ||
|
r26819 | searching for changes | ||
remote has heads on branch 'default' that are not known locally: a2a606d9ff1b | ||||
|
r46520 | abort: push creates new remote head 54694f811df9 with bookmark 'X' | ||
|
r29973 | (pull and merge or see 'hg help push' for details about pushing new heads) | ||
|
r46735 | [20] | ||
|
r28082 | $ cd ../addmarks | ||
|
r26819 | |||
|
r24400 | Check summary output for incoming/outgoing bookmarks | ||
$ hg bookmarks -d X | ||||
$ hg bookmarks -d Y | ||||
$ hg summary --remote | grep '^remote:' | ||||
remote: *, 2 incoming bookmarks, 1 outgoing bookmarks (glob) | ||||
|
r16913 | $ cd .. | ||
|
r23082 | |||
pushing an unchanged bookmark should result in no changes | ||||
$ hg init unchanged-a | ||||
$ hg init unchanged-b | ||||
$ cd unchanged-a | ||||
$ echo initial > foo | ||||
$ hg commit -A -m initial | ||||
adding foo | ||||
$ hg bookmark @ | ||||
$ hg push -B @ ../unchanged-b | ||||
pushing to ../unchanged-b | ||||
searching for changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
exporting bookmark @ | ||||
$ hg push -B @ ../unchanged-b | ||||
pushing to ../unchanged-b | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
|
r36807 | Pushing a really long bookmark should work fine (issue5165) | ||
=============================================== | ||||
#if b2-binary | ||||
|
r38625 | >>> with open('longname', 'w') as f: | ||
... f.write('wat' * 100) and None | ||||
|
r36807 | $ hg book `cat longname` | ||
$ hg push -B `cat longname` ../unchanged-b | ||||
pushing to ../unchanged-b | ||||
searching for changes | ||||
no changes found | ||||
exporting bookmark (wat){100} (re) | ||||
[1] | ||||
$ hg -R ../unchanged-b book --delete `cat longname` | ||||
Test again but forcing bundle2 exchange to make sure that doesn't regress. | ||||
$ hg push -B `cat longname` ../unchanged-b --config devel.legacy.exchange=bundle1 | ||||
pushing to ../unchanged-b | ||||
searching for changes | ||||
no changes found | ||||
exporting bookmark (wat){100} (re) | ||||
[1] | ||||
$ hg -R ../unchanged-b book --delete `cat longname` | ||||
$ hg book --delete `cat longname` | ||||
$ hg co @ | ||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(activating bookmark @) | ||||
#endif | ||||
|
r23416 | |||
Check hook preventing push (issue4455) | ||||
====================================== | ||||
$ hg bookmarks | ||||
* @ 0:55482a6fb4b1 | ||||
$ hg log -G | ||||
@ 0:55482a6fb4b1 initial | ||||
$ hg init ../issue4455-dest | ||||
$ hg push ../issue4455-dest # changesets only | ||||
pushing to ../issue4455-dest | ||||
searching for changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
$ cat >> .hg/hgrc << EOF | ||||
> [paths] | ||||
> local=../issue4455-dest/ | ||||
> ssh=ssh://user@dummy/issue4455-dest | ||||
> http=http://localhost:$HGPORT/ | ||||
> [ui] | ||||
|
r39743 | > ssh="$PYTHON" "$TESTDIR/dummyssh" | ||
|
r23416 | > EOF | ||
$ cat >> ../issue4455-dest/.hg/hgrc << EOF | ||||
> [hooks] | ||||
> prepushkey=false | ||||
> [web] | ||||
> push_ssl = false | ||||
> allow_push = * | ||||
> EOF | ||||
|
r25474 | $ killdaemons.py | ||
|
r28549 | $ hg serve -R ../issue4455-dest -p $HGPORT -d --pid-file=../issue4455.pid -E ../issue4455-error.log | ||
|
r23416 | $ cat ../issue4455.pid >> $DAEMON_PIDS | ||
Local push | ||||
---------- | ||||
|
r35264 | #if b2-pushkey | ||
|
r23416 | $ hg push -B @ local | ||
|
r35394 | pushing to $TESTTMP/issue4455-dest | ||
|
r23416 | searching for changes | ||
no changes found | ||||
pushkey-abort: prepushkey hook exited with status 1 | ||||
|
r46522 | abort: exporting bookmark @ failed | ||
|
r25501 | [255] | ||
|
r35264 | |||
#endif | ||||
#if b2-binary | ||||
$ hg push -B @ local | ||||
|
r35394 | pushing to $TESTTMP/issue4455-dest | ||
|
r35264 | searching for changes | ||
no changes found | ||||
|
r35265 | abort: prepushkey hook exited with status 1 | ||
|
r47145 | [40] | ||
|
r35264 | |||
#endif | ||||
|
r23416 | $ hg -R ../issue4455-dest/ bookmarks | ||
no bookmarks set | ||||
Using ssh | ||||
--------- | ||||
|
r35264 | #if b2-pushkey | ||
|
r29688 | $ hg push -B @ ssh # bundle2+ | ||
|
r25357 | pushing to ssh://user@dummy/issue4455-dest | ||
searching for changes | ||||
no changes found | ||||
remote: pushkey-abort: prepushkey hook exited with status 1 | ||||
|
r46522 | abort: exporting bookmark @ failed | ||
|
r25501 | [255] | ||
|
r35264 | |||
|
r25357 | $ hg -R ../issue4455-dest/ bookmarks | ||
no bookmarks set | ||||
|
r29687 | $ hg push -B @ ssh --config devel.legacy.exchange=bundle1 | ||
|
r23416 | pushing to ssh://user@dummy/issue4455-dest | ||
searching for changes | ||||
no changes found | ||||
remote: pushkey-abort: prepushkey hook exited with status 1 | ||||
|
r46522 | exporting bookmark @ failed | ||
|
r23416 | [1] | ||
|
r35264 | |||
#endif | ||||
#if b2-binary | ||||
$ hg push -B @ ssh # bundle2+ | ||||
pushing to ssh://user@dummy/issue4455-dest | ||||
searching for changes | ||||
no changes found | ||||
|
r35265 | remote: prepushkey hook exited with status 1 | ||
abort: push failed on remote | ||||
|
r35264 | [255] | ||
#endif | ||||
|
r23416 | $ hg -R ../issue4455-dest/ bookmarks | ||
no bookmarks set | ||||
Using http | ||||
---------- | ||||
|
r35264 | #if b2-pushkey | ||
|
r29688 | $ hg push -B @ http # bundle2+ | ||
|
r23416 | pushing to http://localhost:$HGPORT/ | ||
searching for changes | ||||
no changes found | ||||
remote: pushkey-abort: prepushkey hook exited with status 1 | ||||
|
r46522 | abort: exporting bookmark @ failed | ||
|
r25501 | [255] | ||
|
r35264 | |||
|
r23416 | $ hg -R ../issue4455-dest/ bookmarks | ||
no bookmarks set | ||||
|
r25357 | |||
|
r29687 | $ hg push -B @ http --config devel.legacy.exchange=bundle1 | ||
|
r25357 | pushing to http://localhost:$HGPORT/ | ||
searching for changes | ||||
no changes found | ||||
remote: pushkey-abort: prepushkey hook exited with status 1 | ||||
|
r46522 | exporting bookmark @ failed | ||
|
r25357 | [1] | ||
|
r35264 | |||
#endif | ||||
#if b2-binary | ||||
$ hg push -B @ ssh # bundle2+ | ||||
pushing to ssh://user@dummy/issue4455-dest | ||||
searching for changes | ||||
no changes found | ||||
|
r35265 | remote: prepushkey hook exited with status 1 | ||
abort: push failed on remote | ||||
|
r35264 | [255] | ||
#endif | ||||
|
r25357 | $ hg -R ../issue4455-dest/ bookmarks | ||
no bookmarks set | ||||
|
r35829 | |||
$ cd .. | ||||
Test that pre-pushkey compat for bookmark works as expected (issue5777) | ||||
$ cat << EOF >> $HGRCPATH | ||||
> [ui] | ||||
> ssh="$PYTHON" "$TESTDIR/dummyssh" | ||||
> [server] | ||||
> bookmarks-pushkey-compat = yes | ||||
> EOF | ||||
$ hg init server | ||||
$ echo foo > server/a | ||||
$ hg -R server book foo | ||||
$ hg -R server commit -Am a | ||||
adding a | ||||
$ hg clone ssh://user@dummy/server client | ||||
requesting all changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
|
r39516 | new changesets 79513d0d7716 (1 drafts) | ||
|
r35829 | updating to branch default | ||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
Forbid bookmark move on the server | ||||
|
r40267 | $ cat << EOF >> $TESTTMP/no-bm-move.sh | ||
|
r35834 | > #!/bin/sh | ||
> echo \$HG_NAMESPACE | grep -v bookmarks | ||||
> EOF | ||||
|
r35829 | $ cat << EOF >> server/.hg/hgrc | ||
> [hooks] | ||||
|
r40267 | > prepushkey.no-bm-move= sh $TESTTMP/no-bm-move.sh | ||
|
r35829 | > EOF | ||
pushing changeset is okay | ||||
$ echo bar >> client/a | ||||
$ hg -R client commit -m b | ||||
$ hg -R client push | ||||
pushing to ssh://user@dummy/server | ||||
searching for changes | ||||
remote: adding changesets | ||||
remote: adding manifests | ||||
remote: adding file changes | ||||
remote: added 1 changesets with 1 changes to 1 files | ||||
attempt to move the bookmark is rejected | ||||
$ hg -R client book foo -r . | ||||
moving bookmark 'foo' forward from 79513d0d7716 | ||||
#if b2-pushkey | ||||
$ hg -R client push | ||||
pushing to ssh://user@dummy/server | ||||
searching for changes | ||||
no changes found | ||||
remote: pushkey-abort: prepushkey.no-bm-move hook exited with status 1 | ||||
|
r46522 | abort: updating bookmark foo failed | ||
|
r35829 | [255] | ||
#endif | ||||
#if b2-binary | ||||
$ hg -R client push | ||||
pushing to ssh://user@dummy/server | ||||
searching for changes | ||||
no changes found | ||||
remote: prepushkey.no-bm-move hook exited with status 1 | ||||
abort: push failed on remote | ||||
[255] | ||||
#endif | ||||
|
r43081 | |||
-- test for pushing bookmarks pointing to secret changesets | ||||
Set up a "remote" repo | ||||
$ hg init issue6159remote | ||||
$ cd issue6159remote | ||||
$ echo a > a | ||||
$ hg add a | ||||
$ hg commit -m_ | ||||
$ hg bookmark foo | ||||
$ cd .. | ||||
Clone a local repo | ||||
$ hg clone -q issue6159remote issue6159local | ||||
$ cd issue6159local | ||||
$ hg up -qr foo | ||||
$ echo b > b | ||||
Move the bookmark "foo" to point at a secret changeset | ||||
$ hg commit -qAm_ --config phases.new-commit=secret | ||||
Pushing the bookmark "foo" now fails as it contains a secret changeset | ||||
$ hg push -r foo | ||||
pushing to $TESTTMP/issue6159remote | ||||
searching for changes | ||||
no changes found (ignored 1 secret changesets) | ||||
|
r43082 | abort: cannot push bookmark foo as it points to a secret changeset | ||
|
r43081 | [255] | ||
|
r46407 | |||
Test pushing all bookmarks | ||||
$ hg init $TESTTMP/ab1 | ||||
$ cd $TESTTMP/ab1 | ||||
$ "$PYTHON" $TESTDIR/seq.py 1 5 | while read i; do | ||||
> echo $i > test && hg ci -Am test | ||||
> done | ||||
adding test | ||||
$ hg clone -U . ../ab2 | ||||
$ hg book -r 1 A; hg book -r 2 B; hg book -r 3 C | ||||
$ hg push ../ab2 | ||||
pushing to ../ab2 | ||||
searching for changes | ||||
no changes found | ||||
[1] | ||||
$ hg push --all-bookmarks -r 1 ../ab2 | ||||
abort: cannot specify both --all-bookmarks and --rev | ||||
|
r46431 | [10] | ||
|
r46407 | $ hg push --all-bookmarks -B A ../ab2 | ||
abort: cannot specify both --all-bookmarks and --bookmark | ||||
|
r46431 | [10] | ||
|
r46407 | $ hg push --all-bookmarks ../ab2 | ||
pushing to ../ab2 | ||||
searching for changes | ||||
no changes found | ||||
exporting bookmark A | ||||
exporting bookmark B | ||||
exporting bookmark C | ||||
[1] | ||||