2016-09-26 21:40:29 +03:00
|
|
|
|
2016-08-26 16:09:01 +03:00
|
|
|
Create an ondisk bundlestore in .hg/scratchbranches
|
2016-11-16 13:13:17 +03:00
|
|
|
$ . "$TESTDIR/library.sh"
|
|
|
|
$ . "$TESTDIR/library-infinitepush.sh"
|
2016-08-26 16:09:01 +03:00
|
|
|
$ extpath=`dirname $TESTDIR`
|
2016-10-02 12:54:03 +03:00
|
|
|
$ cp $extpath/hgext3rd/pushrebase.py $TESTTMP # use $TESTTMP substitution in message
|
|
|
|
$ cp $HGRCPATH $TESTTMP/defaulthgrc
|
2016-11-16 13:13:17 +03:00
|
|
|
$ setupcommon
|
2016-08-26 16:09:01 +03:00
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
|
|
|
|
|
|
|
Check that we can send a scratch on the server and it does not show there in
|
|
|
|
the history but is stored on disk
|
2016-11-16 13:13:17 +03:00
|
|
|
$ setupserver
|
2016-08-26 16:09:01 +03:00
|
|
|
$ cd ..
|
|
|
|
$ hg clone ssh://user@dummy/repo client -q
|
|
|
|
$ cd client
|
|
|
|
$ mkcommit initialcommit
|
|
|
|
$ hg push -r . --create
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: adding changesets
|
|
|
|
remote: adding manifests
|
|
|
|
remote: adding file changes
|
|
|
|
remote: added 1 changesets with 1 changes to 1 files
|
|
|
|
$ mkcommit scratchcommit
|
|
|
|
$ hg push -r . --to scratch/mybranch --create
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 1 commit:
|
|
|
|
remote: 20759b6926ce scratchcommit
|
2016-08-26 18:01:30 +03:00
|
|
|
$ hg log -G
|
2016-08-26 16:09:01 +03:00
|
|
|
@ changeset: 1:20759b6926ce
|
2016-10-13 10:11:56 +03:00
|
|
|
| bookmark: scratch/mybranch
|
2016-08-26 16:09:01 +03:00
|
|
|
| tag: tip
|
|
|
|
| user: test
|
|
|
|
| date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
| summary: scratchcommit
|
|
|
|
|
|
|
|
|
o changeset: 0:67145f466344
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: initialcommit
|
|
|
|
|
|
|
|
$ hg log -G -R ../repo
|
|
|
|
o changeset: 0:67145f466344
|
|
|
|
tag: tip
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: initialcommit
|
|
|
|
|
|
|
|
$ find ../repo/.hg/scratchbranches | sort
|
|
|
|
../repo/.hg/scratchbranches
|
|
|
|
../repo/.hg/scratchbranches/filebundlestore
|
2016-12-15 21:02:59 +03:00
|
|
|
../repo/.hg/scratchbranches/filebundlestore/b9
|
|
|
|
../repo/.hg/scratchbranches/filebundlestore/b9/e1
|
|
|
|
../repo/.hg/scratchbranches/filebundlestore/b9/e1/b9e1ee5f93fb6d7c42496fc176c09839639dd9cc
|
2016-08-26 16:09:01 +03:00
|
|
|
../repo/.hg/scratchbranches/index
|
|
|
|
../repo/.hg/scratchbranches/index/bookmarkmap
|
|
|
|
../repo/.hg/scratchbranches/index/bookmarkmap/scratch
|
|
|
|
../repo/.hg/scratchbranches/index/bookmarkmap/scratch/mybranch
|
|
|
|
../repo/.hg/scratchbranches/index/nodemap
|
|
|
|
../repo/.hg/scratchbranches/index/nodemap/20759b6926ce827d5a8c73eb1fa9726d6f7defb2
|
|
|
|
|
|
|
|
From another client we can get the scratchbranch if we ask for it explicitely
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ hg clone ssh://user@dummy/repo client2 -q
|
2016-08-26 18:01:30 +03:00
|
|
|
$ cd client2
|
2016-08-26 16:09:01 +03:00
|
|
|
$ hg pull -B scratch/mybranch --traceback
|
|
|
|
pulling from ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files
|
|
|
|
(run 'hg update' to get a working copy)
|
|
|
|
$ hg log -G
|
|
|
|
o changeset: 1:20759b6926ce
|
2016-09-13 12:34:55 +03:00
|
|
|
| bookmark: scratch/mybranch
|
2016-08-26 16:09:01 +03:00
|
|
|
| tag: tip
|
|
|
|
| user: test
|
|
|
|
| date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
| summary: scratchcommit
|
|
|
|
|
|
|
|
|
@ changeset: 0:67145f466344
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: initialcommit
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Push to non-scratch bookmark
|
|
|
|
|
|
|
|
$ cd client
|
|
|
|
$ hg up 0
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ mkcommit newcommit
|
|
|
|
created new head
|
2016-09-13 12:34:55 +03:00
|
|
|
$ hg push -r .
|
2016-08-26 16:09:01 +03:00
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: adding changesets
|
|
|
|
remote: adding manifests
|
|
|
|
remote: adding file changes
|
|
|
|
remote: added 1 changesets with 1 changes to 1 files
|
2016-10-13 10:11:56 +03:00
|
|
|
$ hg log -G -T '{desc} {phase} {bookmarks}'
|
2016-08-26 16:09:01 +03:00
|
|
|
@ newcommit public
|
|
|
|
|
|
2016-10-13 10:11:56 +03:00
|
|
|
| o scratchcommit draft scratch/mybranch
|
2016-08-26 16:09:01 +03:00
|
|
|
|/
|
|
|
|
o initialcommit public
|
|
|
|
|
2016-09-16 11:45:33 +03:00
|
|
|
|
2016-09-13 12:34:55 +03:00
|
|
|
Push to scratch branch
|
|
|
|
$ cd ../client2
|
|
|
|
$ hg up -q scratch/mybranch
|
|
|
|
$ mkcommit 'new scratch commit'
|
|
|
|
$ hg push -r . --to scratch/mybranch
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 2 commits:
|
|
|
|
remote: 20759b6926ce scratchcommit
|
|
|
|
remote: 1de1d7d92f89 new scratch commit
|
2016-10-13 10:11:56 +03:00
|
|
|
$ hg log -G -T '{desc} {phase} {bookmarks}'
|
|
|
|
@ new scratch commit draft scratch/mybranch
|
|
|
|
|
|
|
|
|
o scratchcommit draft
|
|
|
|
|
|
|
|
|
o initialcommit public
|
|
|
|
|
2016-09-28 23:17:25 +03:00
|
|
|
$ scratchnodes
|
2016-12-15 21:02:59 +03:00
|
|
|
1de1d7d92f8965260391d0513fe8a8d5973d3042 bed63daed3beba97fff2e819a148cf415c217a85
|
|
|
|
20759b6926ce827d5a8c73eb1fa9726d6f7defb2 bed63daed3beba97fff2e819a148cf415c217a85
|
2016-09-13 12:34:55 +03:00
|
|
|
|
2016-10-02 13:05:50 +03:00
|
|
|
$ scratchbookmarks
|
2016-10-10 18:37:04 +03:00
|
|
|
scratch/mybranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
|
2016-10-02 13:05:50 +03:00
|
|
|
|
|
|
|
Push scratch bookmark with no new revs
|
|
|
|
$ hg push -r . --to scratch/anotherbranch --create
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 2 commits:
|
|
|
|
remote: 20759b6926ce scratchcommit
|
|
|
|
remote: 1de1d7d92f89 new scratch commit
|
2016-10-13 10:11:56 +03:00
|
|
|
$ hg log -G -T '{desc} {phase} {bookmarks}'
|
|
|
|
@ new scratch commit draft scratch/anotherbranch scratch/mybranch
|
|
|
|
|
|
|
|
|
o scratchcommit draft
|
|
|
|
|
|
|
|
|
o initialcommit public
|
|
|
|
|
2016-10-02 13:05:50 +03:00
|
|
|
$ scratchbookmarks
|
2016-10-10 18:37:04 +03:00
|
|
|
scratch/anotherbranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
|
|
|
|
scratch/mybranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
|
2016-10-02 13:05:50 +03:00
|
|
|
|
2016-09-13 12:34:55 +03:00
|
|
|
Pull scratch and non-scratch bookmark at the same time
|
2016-09-13 12:34:55 +03:00
|
|
|
|
2016-09-13 12:34:55 +03:00
|
|
|
$ hg -R ../repo book newbook
|
|
|
|
$ cd ../client
|
|
|
|
$ hg pull -B newbook -B scratch/mybranch --traceback
|
|
|
|
pulling from ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 2 files
|
|
|
|
adding remote bookmark newbook
|
|
|
|
(run 'hg update' to get a working copy)
|
2016-10-13 10:11:56 +03:00
|
|
|
$ hg log -G -T '{desc} {phase} {bookmarks}'
|
|
|
|
o new scratch commit draft scratch/mybranch
|
2016-09-13 12:34:55 +03:00
|
|
|
|
|
|
|
|
| @ newcommit public
|
|
|
|
| |
|
|
|
|
o | scratchcommit draft
|
|
|
|
|/
|
|
|
|
o initialcommit public
|
|
|
|
|
2016-09-28 23:17:25 +03:00
|
|
|
|
2016-10-13 10:11:56 +03:00
|
|
|
Push scratch revision without bookmark with --bundle-store
|
2016-09-28 23:17:25 +03:00
|
|
|
|
|
|
|
$ hg up -q tip
|
|
|
|
$ mkcommit scratchcommitnobook
|
2016-10-13 10:11:56 +03:00
|
|
|
$ hg log -G -T '{desc} {phase} {bookmarks}'
|
2016-09-28 23:17:25 +03:00
|
|
|
@ scratchcommitnobook draft
|
|
|
|
|
|
2016-10-13 10:11:56 +03:00
|
|
|
o new scratch commit draft scratch/mybranch
|
2016-09-28 23:17:25 +03:00
|
|
|
|
|
|
|
|
| o newcommit public
|
|
|
|
| |
|
|
|
|
o | scratchcommit draft
|
|
|
|
|/
|
|
|
|
o initialcommit public
|
|
|
|
|
|
|
|
$ hg push -r . --bundle-store
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 3 commits:
|
|
|
|
remote: 20759b6926ce scratchcommit
|
|
|
|
remote: 1de1d7d92f89 new scratch commit
|
|
|
|
remote: 2b5d271c7e0d scratchcommitnobook
|
|
|
|
$ hg -R ../repo log -G -T '{desc} {phase}'
|
|
|
|
o newcommit public
|
|
|
|
|
|
|
|
|
o initialcommit public
|
|
|
|
|
|
|
|
|
|
|
|
$ scratchnodes
|
2016-12-15 21:02:59 +03:00
|
|
|
1de1d7d92f8965260391d0513fe8a8d5973d3042 66fa08ff107451320512817bed42b7f467a1bec3
|
|
|
|
20759b6926ce827d5a8c73eb1fa9726d6f7defb2 66fa08ff107451320512817bed42b7f467a1bec3
|
|
|
|
2b5d271c7e0d25d811359a314d413ebcc75c9524 66fa08ff107451320512817bed42b7f467a1bec3
|
2016-10-02 12:54:03 +03:00
|
|
|
|
|
|
|
Test with pushrebase
|
|
|
|
$ cp $TESTTMP/defaulthgrc $HGRCPATH
|
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [extensions]
|
|
|
|
> pushrebase=$TESTTMP/pushrebase.py
|
|
|
|
> infinitepush=$TESTTMP/infinitepush
|
|
|
|
> [infinitepush]
|
|
|
|
> branchpattern=re:scratch/.+
|
|
|
|
> [ui]
|
|
|
|
> ssh = python "$TESTDIR/dummyssh"
|
|
|
|
> EOF
|
|
|
|
$ mkcommit scratchcommitwithpushrebase
|
|
|
|
$ hg push -r . --to scratch/mybranch
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 4 commits:
|
|
|
|
remote: 20759b6926ce scratchcommit
|
|
|
|
remote: 1de1d7d92f89 new scratch commit
|
|
|
|
remote: 2b5d271c7e0d scratchcommitnobook
|
|
|
|
remote: d8c4f54ab678 scratchcommitwithpushrebase
|
|
|
|
$ hg -R ../repo log -G -T '{desc} {phase}'
|
|
|
|
o newcommit public
|
|
|
|
|
|
|
|
|
o initialcommit public
|
|
|
|
|
|
|
|
$ scratchnodes
|
2016-12-15 21:02:59 +03:00
|
|
|
1de1d7d92f8965260391d0513fe8a8d5973d3042 e3cb2ac50f9e1e6a5ead3217fc21236c84af4397
|
|
|
|
20759b6926ce827d5a8c73eb1fa9726d6f7defb2 e3cb2ac50f9e1e6a5ead3217fc21236c84af4397
|
|
|
|
2b5d271c7e0d25d811359a314d413ebcc75c9524 e3cb2ac50f9e1e6a5ead3217fc21236c84af4397
|
|
|
|
d8c4f54ab678fd67cb90bb3f272a2dc6513a59a7 e3cb2ac50f9e1e6a5ead3217fc21236c84af4397
|
2016-10-02 12:54:03 +03:00
|
|
|
|
|
|
|
Change the order of pushrebase and infinitepush
|
|
|
|
$ cp $TESTTMP/defaulthgrc $HGRCPATH
|
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [extensions]
|
|
|
|
> infinitepush=$TESTTMP/infinitepush
|
|
|
|
> pushrebase=$TESTTMP/pushrebase.py
|
|
|
|
> [infinitepush]
|
|
|
|
> branchpattern=re:scratch/.+
|
|
|
|
> [ui]
|
|
|
|
> ssh = python "$TESTDIR/dummyssh"
|
|
|
|
> EOF
|
|
|
|
$ mkcommit scratchcommitwithpushrebase2
|
|
|
|
$ hg push -r . --to scratch/mybranch
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 5 commits:
|
|
|
|
remote: 20759b6926ce scratchcommit
|
|
|
|
remote: 1de1d7d92f89 new scratch commit
|
|
|
|
remote: 2b5d271c7e0d scratchcommitnobook
|
|
|
|
remote: d8c4f54ab678 scratchcommitwithpushrebase
|
|
|
|
remote: 6c10d49fe927 scratchcommitwithpushrebase2
|
|
|
|
$ hg -R ../repo log -G -T '{desc} {phase}'
|
|
|
|
o newcommit public
|
|
|
|
|
|
|
|
|
o initialcommit public
|
|
|
|
|
|
|
|
$ scratchnodes
|
2016-12-15 21:02:59 +03:00
|
|
|
1de1d7d92f8965260391d0513fe8a8d5973d3042 cd0586065eaf8b483698518f5fc32531e36fd8e0
|
|
|
|
20759b6926ce827d5a8c73eb1fa9726d6f7defb2 cd0586065eaf8b483698518f5fc32531e36fd8e0
|
|
|
|
2b5d271c7e0d25d811359a314d413ebcc75c9524 cd0586065eaf8b483698518f5fc32531e36fd8e0
|
|
|
|
6c10d49fe92751666c40263f96721b918170d3da cd0586065eaf8b483698518f5fc32531e36fd8e0
|
|
|
|
d8c4f54ab678fd67cb90bb3f272a2dc6513a59a7 cd0586065eaf8b483698518f5fc32531e36fd8e0
|
2016-10-02 15:13:06 +03:00
|
|
|
|
2016-10-10 13:48:21 +03:00
|
|
|
Non-fastforward scratch bookmark push
|
2016-10-17 15:36:26 +03:00
|
|
|
$ hg up 6c10d49fe927
|
2016-10-10 13:48:21 +03:00
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ echo 1 > amend
|
|
|
|
$ hg add amend
|
|
|
|
$ hg ci --amend -m 'scratch amended commit'
|
2016-10-17 15:36:26 +03:00
|
|
|
saved backup bundle to $TESTTMP/client/.hg/strip-backup/6c10d49fe927-a7adb791-amend-backup.hg (glob)
|
2016-10-13 10:11:56 +03:00
|
|
|
$ hg log -G -T '{desc} {phase} {bookmarks}'
|
|
|
|
@ scratch amended commit draft scratch/mybranch
|
2016-10-10 13:48:21 +03:00
|
|
|
|
|
|
|
|
o scratchcommitwithpushrebase draft
|
|
|
|
|
|
|
|
|
o scratchcommitnobook draft
|
|
|
|
|
|
|
|
|
o new scratch commit draft
|
|
|
|
|
|
|
|
|
| o newcommit public
|
|
|
|
| |
|
|
|
|
o | scratchcommit draft
|
|
|
|
|/
|
|
|
|
o initialcommit public
|
|
|
|
|
|
|
|
|
|
|
|
$ scratchbookmarks
|
|
|
|
scratch/anotherbranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
|
2016-10-17 15:36:26 +03:00
|
|
|
scratch/mybranch 6c10d49fe92751666c40263f96721b918170d3da
|
2016-10-10 13:48:21 +03:00
|
|
|
$ hg push -r . --to scratch/mybranch
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
2016-10-12 12:57:53 +03:00
|
|
|
remote: non-forward push
|
2016-10-10 13:48:21 +03:00
|
|
|
abort: push failed on remote
|
2016-12-22 20:20:49 +03:00
|
|
|
(use --non-forward-move to override)
|
2016-10-10 13:48:21 +03:00
|
|
|
[255]
|
|
|
|
|
2016-12-22 20:20:49 +03:00
|
|
|
$ hg push -r . --to scratch/mybranch --non-forward-move
|
2016-10-10 13:48:21 +03:00
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
2016-10-17 15:36:26 +03:00
|
|
|
remote: pushing 5 commits:
|
2016-10-10 13:48:21 +03:00
|
|
|
remote: 20759b6926ce scratchcommit
|
|
|
|
remote: 1de1d7d92f89 new scratch commit
|
|
|
|
remote: 2b5d271c7e0d scratchcommitnobook
|
|
|
|
remote: d8c4f54ab678 scratchcommitwithpushrebase
|
2016-10-17 15:36:26 +03:00
|
|
|
remote: 8872775dd97a scratch amended commit
|
2016-10-10 13:48:21 +03:00
|
|
|
$ scratchbookmarks
|
|
|
|
scratch/anotherbranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
|
2016-10-17 15:36:26 +03:00
|
|
|
scratch/mybranch 8872775dd97a750e1533dc1fbbca665644b32547
|
2016-10-13 10:11:56 +03:00
|
|
|
$ hg log -G -T '{desc} {phase} {bookmarks}'
|
|
|
|
@ scratch amended commit draft scratch/mybranch
|
|
|
|
|
|
|
|
|
o scratchcommitwithpushrebase draft
|
|
|
|
|
|
|
|
|
o scratchcommitnobook draft
|
|
|
|
|
|
|
|
|
o new scratch commit draft
|
|
|
|
|
|
|
|
|
| o newcommit public
|
|
|
|
| |
|
|
|
|
o | scratchcommit draft
|
|
|
|
|/
|
|
|
|
o initialcommit public
|
|
|
|
|
2016-10-26 19:29:23 +03:00
|
|
|
Check that push path is not ignored. Add new path to the hgrc
|
|
|
|
$ cat >> .hg/hgrc << EOF
|
|
|
|
> [paths]
|
|
|
|
> peer=ssh://user@dummy/client2
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
Checkout last non-scrath commit
|
|
|
|
$ hg up 91894e11e8255
|
|
|
|
1 files updated, 0 files merged, 6 files removed, 0 files unresolved
|
|
|
|
$ mkcommit peercommit
|
|
|
|
Use --force because this push creates new head
|
|
|
|
$ hg push peer -r . -f
|
|
|
|
pushing to ssh://user@dummy/client2
|
|
|
|
searching for changes
|
|
|
|
remote: adding changesets
|
|
|
|
remote: adding manifests
|
|
|
|
remote: adding file changes
|
|
|
|
remote: added 2 changesets with 2 changes to 2 files (+1 heads)
|
|
|
|
$ hg -R ../repo log -G -T '{desc} {phase} {bookmarks}'
|
|
|
|
o newcommit public
|
|
|
|
|
|
|
|
|
o initialcommit public
|
|
|
|
|
|
|
|
$ hg -R ../client2 log -G -T '{desc} {phase} {bookmarks}'
|
|
|
|
o peercommit public
|
|
|
|
|
|
|
|
|
o newcommit public
|
|
|
|
|
|
|
|
|
| @ new scratch commit draft scratch/anotherbranch scratch/mybranch
|
|
|
|
| |
|
|
|
|
| o scratchcommit draft
|
|
|
|
|/
|
|
|
|
o initialcommit public
|
|
|
|
|
2016-10-26 20:03:35 +03:00
|
|
|
$ hg book --list-remote scratch/*
|
|
|
|
scratch/anotherbranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
|
|
|
|
scratch/mybranch 8872775dd97a750e1533dc1fbbca665644b32547
|
|
|
|
$ hg book --list-remote scratch/my
|
|
|
|
$ hg book --list-remote scratch/my*
|
|
|
|
scratch/mybranch 8872775dd97a750e1533dc1fbbca665644b32547
|
|
|
|
$ hg book --list-remote scratch/my* -T json
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"bookmark": "scratch/mybranch",
|
|
|
|
"node": "8872775dd97a750e1533dc1fbbca665644b32547"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
$ cd ../repo
|
|
|
|
$ hg book scratch/serversidebook
|
|
|
|
$ hg book serversidebook
|
|
|
|
$ cd ../client
|
|
|
|
$ hg book --list-remote scratch/* -T json
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"bookmark": "scratch/anotherbranch",
|
|
|
|
"node": "1de1d7d92f8965260391d0513fe8a8d5973d3042"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"bookmark": "scratch/mybranch",
|
|
|
|
"node": "8872775dd97a750e1533dc1fbbca665644b32547"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"bookmark": "scratch/serversidebook",
|
|
|
|
"node": "0000000000000000000000000000000000000000"
|
|
|
|
}
|
|
|
|
]
|
2016-12-06 18:41:04 +03:00
|
|
|
|
2016-11-01 11:50:34 +03:00
|
|
|
Push to svn server should fail
|
|
|
|
$ hg push svn+ssh://svn.vip.facebook.com/svnroot/tfb/trunk/www -r . --to scratch/serversidebook
|
|
|
|
abort: infinite push does not work with svn repo
|
|
|
|
(did you forget to `hg push default`?)
|
|
|
|
[255]
|
2016-11-01 13:42:26 +03:00
|
|
|
|
|
|
|
Scratch pull of pruned commits
|
|
|
|
$ . $TESTDIR/require-ext.sh inhibit directaccess evolve
|
|
|
|
$ cat >> .hg/hgrc << EOF
|
|
|
|
> [extensions]
|
|
|
|
> directaccess=
|
|
|
|
> evolve=
|
|
|
|
> inhibit=
|
|
|
|
> [experimental]
|
|
|
|
> evolution=createmarkers
|
|
|
|
> evolutioncommands=obsolete
|
|
|
|
> EOF
|
|
|
|
$ hg prune -r scratch/mybranch
|
|
|
|
1 changesets pruned
|
|
|
|
$ hg log -r 'reverse(::scratch/mybranch)' -T '{desc}\n'
|
|
|
|
scratchcommitwithpushrebase
|
|
|
|
scratchcommitnobook
|
|
|
|
new scratch commit
|
|
|
|
scratchcommit
|
|
|
|
initialcommit
|
|
|
|
$ hg pull -B scratch/mybranch
|
|
|
|
pulling from ssh://user@dummy/repo
|
|
|
|
no changes found
|
2016-12-06 18:41:04 +03:00
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 0 changesets with 0 changes to 6 files
|
2016-11-01 13:42:26 +03:00
|
|
|
adding remote bookmark scratch/serversidebook
|
|
|
|
adding remote bookmark serversidebook
|
|
|
|
$ hg log -r 'reverse(::scratch/mybranch)' -T '{desc}\n'
|
|
|
|
scratch amended commit
|
|
|
|
scratchcommitwithpushrebase
|
|
|
|
scratchcommitnobook
|
|
|
|
new scratch commit
|
|
|
|
scratchcommit
|
|
|
|
initialcommit
|
|
|
|
|
|
|
|
Prune it again and pull it via commit hash
|
|
|
|
$ hg log -r scratch/mybranch -T '{node}\n'
|
|
|
|
8872775dd97a750e1533dc1fbbca665644b32547
|
|
|
|
$ hg prune -r scratch/mybranch
|
|
|
|
1 changesets pruned
|
|
|
|
$ hg log -G -T '{node|short} {desc} {bookmarks}'
|
|
|
|
@ fe8283fe1190 peercommit
|
|
|
|
|
|
|
|
|
| o d8c4f54ab678 scratchcommitwithpushrebase scratch/mybranch
|
|
|
|
| |
|
|
|
|
| o 2b5d271c7e0d scratchcommitnobook
|
|
|
|
| |
|
|
|
|
| o 1de1d7d92f89 new scratch commit
|
|
|
|
| |
|
|
|
|
o | 91894e11e825 newcommit
|
|
|
|
| |
|
|
|
|
| o 20759b6926ce scratchcommit
|
|
|
|
|/
|
|
|
|
o 67145f466344 initialcommit
|
|
|
|
|
|
|
|
Have to use full hash because short hashes are not supported yet
|
|
|
|
$ hg pull -r 8872775dd97a750e1533dc1fbbca665644b32547
|
|
|
|
pulling from ssh://user@dummy/repo
|
|
|
|
no changes found
|
2016-12-06 18:41:04 +03:00
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 0 changesets with 0 changes to 6 files
|
2016-11-01 13:42:26 +03:00
|
|
|
$ hg log -G -T '{node|short} {desc} {bookmarks}'
|
|
|
|
@ fe8283fe1190 peercommit
|
|
|
|
|
|
|
|
|
| o 8872775dd97a scratch amended commit
|
|
|
|
| |
|
|
|
|
| o d8c4f54ab678 scratchcommitwithpushrebase scratch/mybranch
|
|
|
|
| |
|
|
|
|
| o 2b5d271c7e0d scratchcommitnobook
|
|
|
|
| |
|
|
|
|
| o 1de1d7d92f89 new scratch commit
|
|
|
|
| |
|
|
|
|
o | 91894e11e825 newcommit
|
|
|
|
| |
|
|
|
|
| o 20759b6926ce scratchcommit
|
|
|
|
|/
|
|
|
|
o 67145f466344 initialcommit
|
|
|
|
|
2016-11-08 13:27:25 +03:00
|
|
|
Push new scratch head. Make sure that new bundle is created but 8872775dd97a
|
|
|
|
still in the old bundle
|
|
|
|
$ hg up scratch/mybranch
|
|
|
|
4 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
|
|
(activating bookmark scratch/mybranch)
|
|
|
|
$ mkcommit newscratchhead
|
|
|
|
created new head
|
|
|
|
$ hg push -r . --to scratch/newscratchhead --create
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 5 commits:
|
|
|
|
remote: 20759b6926ce scratchcommit
|
|
|
|
remote: 1de1d7d92f89 new scratch commit
|
|
|
|
remote: 2b5d271c7e0d scratchcommitnobook
|
|
|
|
remote: d8c4f54ab678 scratchcommitwithpushrebase
|
|
|
|
remote: 8611afacb870 newscratchhead
|
|
|
|
$ scratchnodes
|
2016-12-15 21:02:59 +03:00
|
|
|
1de1d7d92f8965260391d0513fe8a8d5973d3042 d1b4f12087a79b2b1d342e222686a829d09d399b
|
|
|
|
20759b6926ce827d5a8c73eb1fa9726d6f7defb2 d1b4f12087a79b2b1d342e222686a829d09d399b
|
|
|
|
2b5d271c7e0d25d811359a314d413ebcc75c9524 d1b4f12087a79b2b1d342e222686a829d09d399b
|
|
|
|
6c10d49fe92751666c40263f96721b918170d3da cd0586065eaf8b483698518f5fc32531e36fd8e0
|
|
|
|
8611afacb87078300a6d6b2f0c4b49fa506a8db9 d1b4f12087a79b2b1d342e222686a829d09d399b
|
|
|
|
8872775dd97a750e1533dc1fbbca665644b32547 ac7f12436d58e685616ffc1f619bcecce8829e25
|
|
|
|
d8c4f54ab678fd67cb90bb3f272a2dc6513a59a7 d1b4f12087a79b2b1d342e222686a829d09d399b
|
2016-11-21 11:48:09 +03:00
|
|
|
|
2016-12-06 18:41:04 +03:00
|
|
|
Recreate the repo
|
2016-11-21 11:48:09 +03:00
|
|
|
$ cd ..
|
|
|
|
$ rm -rf repo
|
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
|
|
|
$ setupserver
|
2016-12-06 18:41:04 +03:00
|
|
|
$ mkcommit initialcommit
|
|
|
|
$ hg phase --public .
|
|
|
|
|
|
|
|
Recreate the clients
|
2016-11-21 11:48:09 +03:00
|
|
|
$ cd ..
|
|
|
|
$ rm -rf client
|
2016-12-06 18:41:04 +03:00
|
|
|
$ rm -rf client2
|
2016-11-21 11:48:09 +03:00
|
|
|
$ hg clone ssh://user@dummy/repo client -q
|
|
|
|
|
|
|
|
Create two heads. Push first head alone, then two heads together. Make sure that
|
|
|
|
multihead push works.
|
2016-12-06 18:41:04 +03:00
|
|
|
$ cd client
|
2016-11-21 11:48:09 +03:00
|
|
|
$ mkcommit multihead1
|
|
|
|
$ hg up null
|
2016-12-06 18:41:04 +03:00
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
2016-11-21 11:48:09 +03:00
|
|
|
$ mkcommit multihead2
|
|
|
|
created new head
|
|
|
|
$ hg push -r . --bundle-store
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 1 commit:
|
|
|
|
remote: ee4802bf6864 multihead2
|
2016-12-06 18:41:04 +03:00
|
|
|
$ hg push -r '1:2' --bundle-store
|
2016-11-21 11:48:09 +03:00
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 2 commits:
|
2016-12-06 18:41:04 +03:00
|
|
|
remote: bc22f9a30a82 multihead1
|
2016-11-21 11:48:09 +03:00
|
|
|
remote: ee4802bf6864 multihead2
|
|
|
|
$ scratchnodes
|
2016-12-15 21:02:59 +03:00
|
|
|
bc22f9a30a821118244deacbd732e394ed0b686c ab1bc557aa090a9e4145512c734b6e8a828393a5
|
|
|
|
ee4802bf6864326a6b3dcfff5a03abc2a0a69b8f ab1bc557aa090a9e4145512c734b6e8a828393a5
|
2016-12-06 18:41:04 +03:00
|
|
|
|
|
|
|
Create two new scratch bookmarks
|
|
|
|
$ hg up 0
|
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ mkcommit scratchfirstpart
|
|
|
|
created new head
|
|
|
|
$ hg push -r . --to scratch/firstpart --create
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 1 commit:
|
|
|
|
remote: 176993b87e39 scratchfirstpart
|
|
|
|
$ hg up 0
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ mkcommit scratchsecondpart
|
|
|
|
created new head
|
|
|
|
$ hg push -r . --to scratch/secondpart --create
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 1 commit:
|
|
|
|
remote: 8db3891c220e scratchsecondpart
|
|
|
|
|
|
|
|
Pull two bookmarks from the second client
|
|
|
|
$ cd ..
|
|
|
|
$ hg clone ssh://user@dummy/repo client2 -q
|
|
|
|
$ cd client2
|
|
|
|
$ hg pull -B scratch/firstpart -B scratch/secondpart
|
|
|
|
pulling from ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files
|
|
|
|
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)
|
|
|
|
$ hg log -G -T '{desc} {phase} {bookmarks}'
|
|
|
|
o scratchsecondpart draft scratch/secondpart
|
|
|
|
|
|
|
|
|
| o scratchfirstpart draft scratch/firstpart
|
|
|
|
|/
|
|
|
|
@ initialcommit public
|
|
|
|
|
|
|
|
Make two commits to the scratch branch
|
|
|
|
$ mkcommit testpullbycommithash1
|
|
|
|
created new head
|
|
|
|
$ hg log -r '.' -T '{node}\n' > ../testpullbycommithash1
|
|
|
|
$ mkcommit testpullbycommithash2
|
|
|
|
$ hg push -r . --to scratch/mybranch --create -q
|
|
|
|
|
|
|
|
Create third client and pull by commit hash.
|
|
|
|
Make sure testpullbycommithash2 has not fetched
|
|
|
|
$ cd ..
|
|
|
|
$ hg clone ssh://user@dummy/repo client3 -q
|
|
|
|
$ cd client3
|
|
|
|
$ hg pull -r `cat ../testpullbycommithash1`
|
|
|
|
pulling from ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files
|
|
|
|
$ hg log -G -T '{desc} {phase} {bookmarks}'
|
|
|
|
o testpullbycommithash1 draft
|
|
|
|
|
|
|
|
|
@ initialcommit public
|
|
|
|
|
|
|
|
Make public commit in the repo and pull it.
|
|
|
|
Make sure phase on the client is public.
|
|
|
|
$ cd ../repo
|
|
|
|
$ mkcommit publiccommit
|
|
|
|
$ hg phase --public .
|
|
|
|
$ cd ../client3
|
|
|
|
$ hg pull
|
|
|
|
pulling from ssh://user@dummy/repo
|
|
|
|
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)
|
|
|
|
$ hg log -G -T '{desc} {phase} {bookmarks} {node|short}'
|
|
|
|
o publiccommit public a79b6597f322
|
|
|
|
|
|
|
|
|
| o testpullbycommithash1 draft 33910bfe6ffe
|
|
|
|
|/
|
|
|
|
@ initialcommit public 67145f466344
|
|
|
|
|
|
|
|
$ hg up a79b6597f322
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ mkcommit scratchontopofpublic
|
|
|
|
$ hg push -r . --to scratch/scratchontopofpublic --create
|
|
|
|
pushing to ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 1 commit:
|
|
|
|
remote: c70aee6da07d scratchontopofpublic
|
|
|
|
$ cd ../client2
|
|
|
|
$ hg pull -B scratch/scratchontopofpublic
|
|
|
|
pulling from ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files (+1 heads)
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files
|
|
|
|
(run 'hg heads .' to see heads, 'hg merge' to merge)
|
|
|
|
$ hg log -G -T '{desc} {phase} {bookmarks} {node|short}'
|
|
|
|
o scratchontopofpublic draft scratch/scratchontopofpublic c70aee6da07d
|
|
|
|
|
|
|
|
|
o publiccommit public a79b6597f322
|
|
|
|
|
|
|
|
|
| @ testpullbycommithash2 draft scratch/mybranch d8fde0ddfc96
|
|
|
|
| |
|
|
|
|
| o testpullbycommithash1 draft 33910bfe6ffe
|
|
|
|
|/
|
|
|
|
| o scratchsecondpart draft scratch/secondpart 8db3891c220e
|
|
|
|
|/
|
|
|
|
| o scratchfirstpart draft scratch/firstpart 176993b87e39
|
|
|
|
|/
|
|
|
|
o initialcommit public 67145f466344
|
|
|
|
|
2017-02-10 11:20:54 +03:00
|
|
|
Strip scratchontopofpublic commit and do hg update
|
|
|
|
$ hg log -r tip -T '{node}\n'
|
|
|
|
c70aee6da07d7cdb9897375473690df3a8563339
|
|
|
|
$ hg strip -q tip
|
|
|
|
$ hg up c70aee6da07d7cdb9897375473690df3a8563339
|
|
|
|
'c70aee6da07d7cdb9897375473690df3a8563339' does not exist locally - looking for it remotely...
|
|
|
|
pulling from ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files
|
|
|
|
'c70aee6da07d7cdb9897375473690df3a8563339' found remotely
|
|
|
|
2 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
Trying to pull from bad path
|
|
|
|
$ hg strip -q tip
|
|
|
|
$ hg --config paths.default=badpath up c70aee6da07d7cdb9897375473690df3a8563339
|
|
|
|
'c70aee6da07d7cdb9897375473690df3a8563339' does not exist locally - looking for it remotely...
|
|
|
|
pulling from $TESTTMP/client2/badpath (glob)
|
|
|
|
pull failed: repository $TESTTMP/client2/badpath not found
|
|
|
|
abort: unknown revision 'c70aee6da07d7cdb9897375473690df3a8563339'!
|
|
|
|
[255]
|
2017-02-15 20:33:44 +03:00
|
|
|
|
|
|
|
Strip commit and pull it using hg update with bookmark name
|
|
|
|
$ hg strip -q d8fde0ddfc96
|
|
|
|
$ hg book -d scratch/mybranch
|
|
|
|
$ hg up scratch/mybranch
|
|
|
|
'scratch/mybranch' does not exist locally - looking for it remotely...
|
|
|
|
pulling from ssh://user@dummy/repo
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 2 files
|
|
|
|
(run 'hg update' to get a working copy)
|
|
|
|
'scratch/mybranch' found remotely
|
|
|
|
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
(activating bookmark scratch/mybranch)
|
|
|
|
$ hg log -G -T '{desc} {phase} {bookmarks} {node|short}'
|
|
|
|
@ testpullbycommithash2 draft scratch/mybranch d8fde0ddfc96
|
|
|
|
|
|
|
|
|
| o publiccommit public scratch/scratchontopofpublic a79b6597f322
|
|
|
|
| |
|
|
|
|
o | testpullbycommithash1 draft 33910bfe6ffe
|
|
|
|
|/
|
|
|
|
| o scratchsecondpart draft scratch/secondpart 8db3891c220e
|
|
|
|
|/
|
|
|
|
| o scratchfirstpart draft scratch/firstpart 176993b87e39
|
|
|
|
|/
|
|
|
|
o initialcommit public 67145f466344
|
|
|
|
|