2018-07-17 22:53:27 +03:00
|
|
|
$ . $TESTDIR/library.sh
|
|
|
|
|
|
|
|
setup configuration
|
2019-02-12 01:35:41 +03:00
|
|
|
$ setup_common_config "blob:files"
|
2018-07-17 22:53:27 +03:00
|
|
|
$ cd $TESTTMP
|
|
|
|
|
|
|
|
setup common configuration
|
|
|
|
$ cat >> $HGRCPATH <<EOF
|
|
|
|
> [ui]
|
|
|
|
> ssh="$DUMMYSSH"
|
2019-02-07 01:28:53 +03:00
|
|
|
> [extensions]
|
|
|
|
> amend=
|
2018-07-17 22:53:27 +03:00
|
|
|
> EOF
|
|
|
|
|
2019-02-07 01:28:53 +03:00
|
|
|
Setup helpers
|
|
|
|
$ log() {
|
2019-03-16 03:40:48 +03:00
|
|
|
> hg log -G -T "{desc} [{phase};rev={rev};{node|short}] {remotenames}" "$@"
|
2019-02-07 01:28:53 +03:00
|
|
|
> }
|
|
|
|
|
2018-07-17 22:53:27 +03:00
|
|
|
setup repo
|
|
|
|
$ hg init repo-hg
|
|
|
|
$ cd repo-hg
|
|
|
|
$ setup_hg_server
|
|
|
|
$ hg debugdrawdag <<EOF
|
|
|
|
> C
|
|
|
|
> |
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
create master bookmark
|
|
|
|
|
|
|
|
$ hg bookmark master_bookmark -r tip
|
|
|
|
|
|
|
|
blobimport them into Mononoke storage and start Mononoke
|
|
|
|
$ cd ..
|
2018-12-11 20:45:43 +03:00
|
|
|
$ blobimport repo-hg/.hg repo
|
2018-07-17 22:53:27 +03:00
|
|
|
|
|
|
|
start mononoke
|
|
|
|
$ mononoke
|
|
|
|
$ wait_for_mononoke $TESTTMP/repo
|
|
|
|
|
|
|
|
Clone the repo
|
2018-09-06 16:40:38 +03:00
|
|
|
$ hgclone_treemanifest ssh://user@dummy/repo-hg repo2 --noupdate --config extensions.remotenames= -q
|
2018-07-17 22:53:27 +03:00
|
|
|
$ cd repo2
|
|
|
|
$ setup_hg_client
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> pushrebase =
|
2018-09-06 16:40:38 +03:00
|
|
|
> remotenames =
|
2018-07-17 22:53:27 +03:00
|
|
|
> EOF
|
|
|
|
|
2018-08-17 16:51:01 +03:00
|
|
|
$ hg up -q 0
|
2018-07-17 22:53:27 +03:00
|
|
|
$ echo 1 > 1 && hg add 1 && hg ci -m 1
|
|
|
|
$ hgmn push -r . --to master_bookmark
|
2018-09-06 16:40:38 +03:00
|
|
|
pushing rev a0c9c5791058 to destination ssh://user@dummy/repo bookmark master_bookmark
|
2018-07-17 22:53:27 +03:00
|
|
|
searching for changes
|
2018-09-06 16:40:38 +03:00
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 0 changes to 0 files
|
2019-01-28 17:53:48 +03:00
|
|
|
updating bookmark master_bookmark
|
2018-07-17 22:53:27 +03:00
|
|
|
|
|
|
|
TODO(stash): pushrebase of a merge commit, pushrebase over a merge commit
|
2018-08-17 16:51:01 +03:00
|
|
|
|
|
|
|
$ hgmn up master_bookmark
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2019-02-07 01:28:53 +03:00
|
|
|
$ log -r ":"
|
|
|
|
@ 1 [public;rev=4;c2e526aacb51] default/master_bookmark
|
2018-08-17 16:51:01 +03:00
|
|
|
|
|
2019-02-07 01:28:53 +03:00
|
|
|
| o 1 [draft;rev=3;a0c9c5791058]
|
2019-03-16 03:40:48 +03:00
|
|
|
| |
|
|
|
|
o | C [public;rev=2;26805aba1e60]
|
|
|
|
| |
|
|
|
|
o | B [public;rev=1;112478962961]
|
2019-02-07 01:28:53 +03:00
|
|
|
|/
|
|
|
|
o A [public;rev=0;426bada5c675]
|
2018-10-08 18:56:12 +03:00
|
|
|
(re)
|
2018-09-06 16:40:38 +03:00
|
|
|
|
|
|
|
|
2019-02-07 01:28:53 +03:00
|
|
|
Push rebase fails with conflict in the bottom of the stack
|
2018-08-17 16:51:01 +03:00
|
|
|
$ hg up -q 0
|
|
|
|
$ echo 1 > 1 && hg add 1 && hg ci -m 1
|
2019-02-07 01:28:53 +03:00
|
|
|
$ echo 2 > 2 && hg add 2 && hg ci -m 2
|
2018-08-17 16:51:01 +03:00
|
|
|
$ hgmn push -r . --to master_bookmark
|
2019-02-07 01:28:53 +03:00
|
|
|
pushing rev * to destination ssh://user@dummy/repo bookmark master_bookmark (glob)
|
2018-08-17 16:51:01 +03:00
|
|
|
searching for changes
|
2019-02-20 19:40:02 +03:00
|
|
|
remote: Command failed
|
|
|
|
remote: Error:
|
2018-08-29 16:42:33 +03:00
|
|
|
remote: * pushrebase failed * (glob)
|
2019-02-20 19:40:02 +03:00
|
|
|
remote: Root cause:
|
|
|
|
remote: ErrorMessage {
|
2019-05-29 10:58:19 +03:00
|
|
|
remote: msg: "pushrebase failed Conflicts([PushrebaseConflict { left: MPath(\"1\"), right: MPath(\"1\") }])",
|
2019-02-20 19:40:02 +03:00
|
|
|
remote: }
|
2018-08-29 16:42:33 +03:00
|
|
|
abort: * (glob)
|
|
|
|
[255]
|
2019-02-07 01:28:53 +03:00
|
|
|
$ hg hide -r ".^ + ." -q
|
2018-08-17 17:12:37 +03:00
|
|
|
|
2019-02-07 01:28:53 +03:00
|
|
|
|
|
|
|
Push rebase fails with conflict in the top of the stack
|
2018-08-17 17:12:37 +03:00
|
|
|
$ hg up -q 0
|
|
|
|
$ echo 2 > 2 && hg add 2 && hg ci -m 2
|
2019-02-07 01:28:53 +03:00
|
|
|
$ echo 1 > 1 && hg add 1 && hg ci -m 1
|
|
|
|
$ hgmn push -r . --to master_bookmark
|
|
|
|
pushing rev * to destination ssh://user@dummy/repo bookmark master_bookmark (glob)
|
|
|
|
searching for changes
|
2019-02-20 19:40:02 +03:00
|
|
|
remote: Command failed
|
|
|
|
remote: Error:
|
2019-02-07 01:28:53 +03:00
|
|
|
remote: * pushrebase failed * (glob)
|
2019-02-20 19:40:02 +03:00
|
|
|
remote: Root cause:
|
|
|
|
remote: ErrorMessage {
|
2019-05-29 10:58:19 +03:00
|
|
|
remote: msg: "pushrebase failed Conflicts([PushrebaseConflict { left: MPath(\"1\"), right: MPath(\"1\") }])",
|
2019-02-20 19:40:02 +03:00
|
|
|
remote: }
|
2019-02-07 01:28:53 +03:00
|
|
|
abort: * (glob)
|
|
|
|
[255]
|
|
|
|
$ hg hide -r ".^ + ." -q
|
|
|
|
|
|
|
|
|
|
|
|
Push stack
|
|
|
|
$ hg up -q 0
|
2018-08-17 17:12:37 +03:00
|
|
|
$ echo 3 > 3 && hg add 3 && hg ci -m 3
|
2019-02-07 01:28:53 +03:00
|
|
|
$ echo 4 > 4 && hg add 4 && hg ci -m 4
|
2018-08-17 17:12:37 +03:00
|
|
|
$ hgmn push -r . --to master_bookmark
|
2019-02-07 01:28:53 +03:00
|
|
|
pushing rev 7a68f123d810 to destination ssh://user@dummy/repo bookmark master_bookmark
|
2018-08-17 17:12:37 +03:00
|
|
|
searching for changes
|
2018-09-06 16:40:38 +03:00
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 2 changesets with 0 changes to 0 files
|
2019-01-28 17:53:48 +03:00
|
|
|
updating bookmark master_bookmark
|
2019-02-07 01:28:53 +03:00
|
|
|
$ hg hide -r ".^ + ." -q
|
2018-08-17 17:12:37 +03:00
|
|
|
$ hgmn up -q master_bookmark
|
2019-02-07 01:28:53 +03:00
|
|
|
$ log -r ":"
|
2019-02-07 01:28:53 +03:00
|
|
|
@ 4 [public;rev=11;4f5a4463b24b] default/master_bookmark
|
2018-08-17 17:12:37 +03:00
|
|
|
|
|
2019-02-07 01:28:53 +03:00
|
|
|
o 3 [public;rev=10;7796136324ad]
|
2018-08-17 17:12:37 +03:00
|
|
|
|
|
2019-02-07 01:28:53 +03:00
|
|
|
o 1 [public;rev=4;c2e526aacb51]
|
2018-08-17 17:12:37 +03:00
|
|
|
|
|
2019-02-07 01:28:53 +03:00
|
|
|
o C [public;rev=2;26805aba1e60]
|
2018-08-17 17:12:37 +03:00
|
|
|
|
|
2019-02-07 01:28:53 +03:00
|
|
|
o B [public;rev=1;112478962961]
|
2018-08-17 17:12:37 +03:00
|
|
|
|
|
2019-02-07 01:28:53 +03:00
|
|
|
o A [public;rev=0;426bada5c675]
|
2018-10-08 18:56:12 +03:00
|
|
|
(re)
|
2019-02-07 01:28:55 +03:00
|
|
|
|
|
|
|
Push fast-forward
|
|
|
|
$ hg up master_bookmark
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ echo 5 > 5 && hg add 5 && hg ci -m 5
|
|
|
|
$ hgmn push -r . --to master_bookmark
|
|
|
|
pushing rev 59e5396444cf to destination ssh://user@dummy/repo bookmark master_bookmark
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 0 changesets with 0 changes to 0 files
|
|
|
|
updating bookmark master_bookmark
|
|
|
|
$ log -r ":"
|
|
|
|
@ 5 [public;rev=12;59e5396444cf] default/master_bookmark
|
|
|
|
|
|
|
|
|
o 4 [public;rev=11;4f5a4463b24b]
|
|
|
|
|
|
|
|
|
o 3 [public;rev=10;7796136324ad]
|
|
|
|
|
|
|
|
|
o 1 [public;rev=4;c2e526aacb51]
|
|
|
|
|
|
|
|
|
o C [public;rev=2;26805aba1e60]
|
|
|
|
|
|
|
|
|
o B [public;rev=1;112478962961]
|
|
|
|
|
|
|
|
|
o A [public;rev=0;426bada5c675]
|
|
|
|
|
2019-02-07 01:28:55 +03:00
|
|
|
|
|
|
|
Push with no new commits
|
|
|
|
$ hgmn push -r . --to master_bookmark
|
|
|
|
pushing rev 59e5396444cf to destination ssh://user@dummy/repo bookmark master_bookmark
|
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
updating bookmark master_bookmark
|
|
|
|
[1]
|
|
|
|
$ log -r "."
|
|
|
|
@ 5 [public;rev=12;59e5396444cf] default/master_bookmark
|
|
|
|
|
|
|
|
|
~
|
2019-02-07 01:28:55 +03:00
|
|
|
|
|
|
|
Push a merge commit with both parents not ancestors of destination bookmark
|
|
|
|
$ hg up -q 1
|
|
|
|
$ echo 6 > 6 && hg add 6 && hg ci -m 6
|
|
|
|
$ hg up -q 1
|
|
|
|
$ echo 7 > 7 && hg add 7 && hg ci -m 7
|
|
|
|
$ hg merge -q -r 13 && hg ci -m "merge 6 and 7"
|
|
|
|
$ log -r ":"
|
2019-03-15 21:00:38 +03:00
|
|
|
@ merge 6 and 7 [draft;rev=15;fad460d85200]
|
|
|
|
|\
|
|
|
|
| o 7 [draft;rev=14;299aa3fbbd3f]
|
2019-02-07 01:28:55 +03:00
|
|
|
| |
|
2019-03-15 21:00:38 +03:00
|
|
|
o | 6 [draft;rev=13;55337b4265b3]
|
|
|
|
|/
|
|
|
|
| o 5 [public;rev=12;59e5396444cf] default/master_bookmark
|
|
|
|
| |
|
|
|
|
| o 4 [public;rev=11;4f5a4463b24b]
|
|
|
|
| |
|
|
|
|
| o 3 [public;rev=10;7796136324ad]
|
|
|
|
| |
|
|
|
|
| o 1 [public;rev=4;c2e526aacb51]
|
|
|
|
| |
|
|
|
|
| o C [public;rev=2;26805aba1e60]
|
2019-02-07 01:28:55 +03:00
|
|
|
|/
|
|
|
|
o B [public;rev=1;112478962961]
|
|
|
|
|
|
|
|
|
o A [public;rev=0;426bada5c675]
|
|
|
|
|
|
|
|
$ hgmn push -r . --to master_bookmark
|
|
|
|
pushing rev fad460d85200 to destination ssh://user@dummy/repo bookmark master_bookmark
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 3 changesets with 0 changes to 0 files
|
|
|
|
updating bookmark master_bookmark
|
|
|
|
$ hgmn up master_bookmark -q && hg hide -r "13+14+15" -q
|
|
|
|
$ log -r ":"
|
|
|
|
@ merge 6 and 7 [public;rev=18;4a0002072071] default/master_bookmark
|
|
|
|
|\
|
2019-03-15 21:00:38 +03:00
|
|
|
\| o (6|7) \[public;rev=17;.*\] (re)
|
2019-03-16 03:40:48 +03:00
|
|
|
| |
|
|
|
|
o \| (7|6) \[public;rev=16;.*\] (re)
|
2019-02-07 01:28:55 +03:00
|
|
|
|/
|
|
|
|
o 5 [public;rev=12;59e5396444cf]
|
|
|
|
|
|
|
|
|
o 4 [public;rev=11;4f5a4463b24b]
|
|
|
|
|
|
|
|
|
o 3 [public;rev=10;7796136324ad]
|
|
|
|
|
|
|
|
|
o 1 [public;rev=4;c2e526aacb51]
|
|
|
|
|
|
|
|
|
o C [public;rev=2;26805aba1e60]
|
|
|
|
|
|
|
|
|
o B [public;rev=1;112478962961]
|
|
|
|
|
|
|
|
|
o A [public;rev=0;426bada5c675]
|
|
|
|
|
2019-02-07 01:28:55 +03:00
|
|
|
|
|
|
|
Push-Rebase over merge is not allowed
|
|
|
|
$ hgmn up 11 -q
|
|
|
|
$ echo 8 > 8 && hg add 8 && hg ci -m 8
|
|
|
|
$ hgmn push -r . --to master_bookmark
|
|
|
|
pushing rev e0f0824ca6a6 to destination ssh://user@dummy/repo bookmark master_bookmark
|
|
|
|
searching for changes
|
2019-02-20 19:40:02 +03:00
|
|
|
remote: Command failed
|
|
|
|
remote: Error:
|
|
|
|
remote: pushrebase failed RebaseOverMerge
|
|
|
|
remote: Root cause:
|
|
|
|
remote: ErrorMessage {
|
2019-05-29 10:58:19 +03:00
|
|
|
remote: msg: "pushrebase failed RebaseOverMerge",
|
2019-02-20 19:40:02 +03:00
|
|
|
remote: }
|
2019-02-07 01:28:55 +03:00
|
|
|
abort: stream ended unexpectedly (got 0 bytes, expected 4)
|
|
|
|
[255]
|
|
|
|
$ hgmn up master_bookmark -q
|
2019-02-07 01:28:55 +03:00
|
|
|
|
2019-02-07 02:06:12 +03:00
|
|
|
Push-rebase of a commit with p2 being the ancestor of the destination bookmark
|
2019-02-07 01:28:55 +03:00
|
|
|
- Do some preparatory work
|
|
|
|
$ echo 9 > 9 && hg add 9 && hg ci -m 9
|
|
|
|
$ echo 10 > 10 && hg add 10 && hg ci -m 10
|
|
|
|
$ echo 11 > 11 && hg add 11 && hg ci -m 11
|
|
|
|
$ hgmn push -r . --to master_bookmark -q
|
|
|
|
$ hgmn up .^^ && echo 12 > 12 && hg add 12 && hg ci -m 12
|
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
2019-04-13 12:44:20 +03:00
|
|
|
$ hg log -r master_bookmark -T '{node}\n'
|
|
|
|
589551466f2555a4d90ca544b23273a2eed21f9d
|
|
|
|
|
2019-02-07 01:28:55 +03:00
|
|
|
$ hg merge -qr 21 && hg ci -qm "merge 10 and 12"
|
|
|
|
$ hg phase -r $(hg log -r . -T "{p1node}")
|
|
|
|
23: draft
|
|
|
|
$ hg phase -r $(hg log -r . -T "{p2node}")
|
|
|
|
21: public
|
2019-04-13 12:44:20 +03:00
|
|
|
$ hg log -r master_bookmark -T '{node}\n'
|
|
|
|
589551466f2555a4d90ca544b23273a2eed21f9d
|
2019-02-07 01:28:55 +03:00
|
|
|
|
|
|
|
- Actually test the push
|
|
|
|
$ hgmn push -r . --to master_bookmark
|
|
|
|
pushing rev e3db177db1d1 to destination ssh://user@dummy/repo bookmark master_bookmark
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 0 changes to 0 files
|
|
|
|
updating bookmark master_bookmark
|
|
|
|
$ hg hide -r . -q && hgmn up master_bookmark -q
|
2019-04-13 12:44:20 +03:00
|
|
|
$ hg log -r master_bookmark -T '{node}\n'
|
|
|
|
eb388b759fde98ed5b1e05fd2da5309f3762c2fd
|
2019-02-07 02:06:12 +03:00
|
|
|
Test creating a bookmark on a public commit
|
|
|
|
$ hgmn push --rev 25 --to master_bookmark_2 --create
|
|
|
|
pushing rev eb388b759fde to destination ssh://user@dummy/repo bookmark master_bookmark_2
|
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
exporting bookmark master_bookmark_2
|
|
|
|
[1]
|
|
|
|
$ log -r "20::"
|
|
|
|
@ merge 10 and 12 [public;rev=25;eb388b759fde] default/master_bookmark default/master_bookmark_2
|
|
|
|
|\
|
|
|
|
| o 12 [public;rev=23;cd5aac4439e5]
|
|
|
|
| |
|
|
|
|
o | 11 [public;rev=22;589551466f25]
|
|
|
|
| |
|
|
|
|
o | 10 [public;rev=21;c573a92e1179]
|
|
|
|
|/
|
|
|
|
o 9 [public;rev=20;2f7cc50dc4e5]
|
|
|
|
|
|
|
|
|
~
|
2019-02-07 02:06:12 +03:00
|
|
|
|
|
|
|
Test a non-forward push
|
|
|
|
$ hgmn up 22 -q
|
|
|
|
$ log -r "20::"
|
|
|
|
o merge 10 and 12 [public;rev=25;eb388b759fde] default/master_bookmark default/master_bookmark_2
|
|
|
|
|\
|
2019-03-16 03:40:48 +03:00
|
|
|
| o 12 [public;rev=23;cd5aac4439e5]
|
|
|
|
| |
|
2019-02-07 02:06:12 +03:00
|
|
|
@ | 11 [public;rev=22;589551466f25]
|
|
|
|
| |
|
|
|
|
o | 10 [public;rev=21;c573a92e1179]
|
|
|
|
|/
|
|
|
|
o 9 [public;rev=20;2f7cc50dc4e5]
|
|
|
|
|
|
|
|
|
~
|
2019-03-18 14:09:28 +03:00
|
|
|
$ hgmn push --force -r . --to master_bookmark_2 --non-forward-move --pushvar NON_FAST_FORWARD=true
|
2019-02-07 02:06:12 +03:00
|
|
|
pushing rev 589551466f25 to destination ssh://user@dummy/repo bookmark master_bookmark_2
|
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
updating bookmark master_bookmark_2
|
|
|
|
[1]
|
|
|
|
$ log -r "20::"
|
|
|
|
o merge 10 and 12 [public;rev=25;eb388b759fde] default/master_bookmark
|
|
|
|
|\
|
2019-03-16 03:40:48 +03:00
|
|
|
| o 12 [public;rev=23;cd5aac4439e5]
|
|
|
|
| |
|
2019-02-07 02:06:12 +03:00
|
|
|
@ | 11 [public;rev=22;589551466f25] default/master_bookmark_2
|
|
|
|
| |
|
|
|
|
o | 10 [public;rev=21;c573a92e1179]
|
|
|
|
|/
|
|
|
|
o 9 [public;rev=20;2f7cc50dc4e5]
|
|
|
|
|
|
|
|
|
~
|
2019-02-07 02:06:12 +03:00
|
|
|
|
|
|
|
Test deleting a bookmark
|
|
|
|
$ hgmn push --delete master_bookmark_2
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
deleting remote bookmark master_bookmark_2
|
|
|
|
[1]
|
|
|
|
$ log -r "20::"
|
|
|
|
o merge 10 and 12 [public;rev=25;eb388b759fde] default/master_bookmark
|
|
|
|
|\
|
2019-03-16 03:40:48 +03:00
|
|
|
| o 12 [public;rev=23;cd5aac4439e5]
|
|
|
|
| |
|
2019-02-07 02:06:12 +03:00
|
|
|
@ | 11 [public;rev=22;589551466f25]
|
|
|
|
| |
|
|
|
|
o | 10 [public;rev=21;c573a92e1179]
|
|
|
|
|/
|
|
|
|
o 9 [public;rev=20;2f7cc50dc4e5]
|
|
|
|
|
|
|
|
|
~
|
2019-04-03 16:07:55 +03:00
|
|
|
|
|
|
|
Test creating a bookmark and new head
|
|
|
|
$ echo draft > draft && hg add draft && hg ci -m draft
|
|
|
|
$ hgmn push -r . --to newbook --create
|
|
|
|
pushing rev 7a037594e202 to destination ssh://user@dummy/repo bookmark newbook
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 0 changesets with 0 changes to 0 files
|
|
|
|
exporting bookmark newbook
|