2015-02-20 12:27:49 +03:00
|
|
|
Set up extension and repos
|
|
|
|
$ echo "[extensions]" >> $HGRCPATH
|
2018-01-03 17:15:47 +03:00
|
|
|
$ echo "remotenames=" >> $HGRCPATH
|
2015-02-20 12:27:49 +03:00
|
|
|
$ hg init repo1
|
|
|
|
$ cd repo1
|
|
|
|
$ echo a > a
|
|
|
|
$ hg add a
|
|
|
|
$ hg commit -qm 'a'
|
|
|
|
$ hg boo bm1
|
|
|
|
$ hg boo bm2
|
|
|
|
$ cd ..
|
|
|
|
$ hg clone repo1 repo2
|
|
|
|
updating to branch default
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cd repo2
|
2015-04-09 01:08:37 +03:00
|
|
|
$ echo "[paths]" >> .hg/hgrc
|
|
|
|
$ echo "default-push=$TESTTMP/repo1" >> .hg/hgrc
|
|
|
|
$ hg pull
|
2015-04-10 01:47:27 +03:00
|
|
|
pulling from $TESTTMP/repo1 (glob)
|
2015-04-09 01:08:37 +03:00
|
|
|
searching for changes
|
|
|
|
no changes found
|
2015-03-03 12:07:50 +03:00
|
|
|
$ hg log -l 1 -T '{node|short} {remotenames}\n'
|
2019-02-13 06:48:27 +03:00
|
|
|
cb9a9f314b8b default/bm1 default/bm2
|
2015-03-03 12:07:50 +03:00
|
|
|
|
|
|
|
Test renaming
|
|
|
|
|
|
|
|
$ rm .hg/remotenames
|
|
|
|
$ echo "[remotenames]" >> $HGRCPATH
|
|
|
|
$ echo "rename.default = remote" >> $HGRCPATH
|
|
|
|
$ hg pull
|
2015-03-12 00:53:36 +03:00
|
|
|
pulling from $TESTTMP/repo1 (glob)
|
2015-03-03 12:07:50 +03:00
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
$ hg log -l 1 -T '{node|short} {remotenames}\n'
|
2019-02-13 06:48:27 +03:00
|
|
|
cb9a9f314b8b remote/bm1 remote/bm2
|
2015-02-20 12:27:49 +03:00
|
|
|
|
|
|
|
Test hoisting basics
|
|
|
|
$ hg book
|
|
|
|
no bookmarks set
|
|
|
|
$ hg debugnamecomplete
|
|
|
|
default
|
2015-03-03 12:07:50 +03:00
|
|
|
remote/bm1
|
|
|
|
remote/bm2
|
2015-02-20 12:27:49 +03:00
|
|
|
tip
|
|
|
|
$ echo "[remotenames]" >> $HGRCPATH
|
2015-03-03 12:11:47 +03:00
|
|
|
$ echo "hoist = remote" >> $HGRCPATH
|
2015-02-20 12:27:49 +03:00
|
|
|
$ hg debugnamecomplete
|
|
|
|
bm1
|
|
|
|
bm2
|
|
|
|
default
|
2015-03-03 12:07:50 +03:00
|
|
|
remote/bm1
|
|
|
|
remote/bm2
|
2015-02-20 12:27:49 +03:00
|
|
|
tip
|
|
|
|
|
|
|
|
Test hoisting name lookup
|
2015-03-24 06:16:25 +03:00
|
|
|
$ rm .hg/remotenames
|
|
|
|
$ hg log -r . -T '{hoistedbookmarks}\n'
|
|
|
|
|
|
|
|
$ hg pull
|
2015-03-26 20:18:24 +03:00
|
|
|
pulling from $TESTTMP/repo1 (glob)
|
2015-03-24 06:16:25 +03:00
|
|
|
searching for changes
|
|
|
|
no changes found
|
2015-03-26 20:48:23 +03:00
|
|
|
$ hg log -r bm1 -T '{node|short} - {bookmarks} - {hoistednames} - {remotebookmarks}\n'
|
2015-03-26 20:18:24 +03:00
|
|
|
cb9a9f314b8b - - bm1 bm2 - remote/bm1 remote/bm2
|
2015-03-26 20:48:23 +03:00
|
|
|
$ hg log -r bm2 -T '{node|short} - {bookmarks} - {hoistednames} - {remotebookmarks}\n'
|
2015-03-26 20:18:24 +03:00
|
|
|
cb9a9f314b8b - - bm1 bm2 - remote/bm1 remote/bm2
|
2015-03-03 12:08:44 +03:00
|
|
|
|
|
|
|
Test transition bookmark deletion
|
|
|
|
$ rm .hg/remotenames
|
|
|
|
$ hg book stable -r .
|
|
|
|
$ echo b > b
|
|
|
|
$ hg add b
|
|
|
|
$ hg commit -qm 'b'
|
2015-03-14 03:37:05 +03:00
|
|
|
$ hg book notdeleted
|
2015-03-03 12:08:44 +03:00
|
|
|
$ hg book master
|
|
|
|
$ hg bookmarks
|
|
|
|
* master 1:d2ae7f538514
|
2015-03-14 03:37:05 +03:00
|
|
|
notdeleted 1:d2ae7f538514
|
2015-03-03 12:08:44 +03:00
|
|
|
stable 0:cb9a9f314b8b
|
|
|
|
$ echo "[remotenames]" >> $HGRCPATH
|
|
|
|
$ echo "transitionbookmarks = master, stable, other" >> $HGRCPATH
|
|
|
|
$ hg pull
|
2015-03-12 00:53:36 +03:00
|
|
|
pulling from $TESTTMP/repo1 (glob)
|
2015-03-03 12:08:44 +03:00
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
$ hg bookmarks
|
2015-03-14 03:37:05 +03:00
|
|
|
notdeleted 1:d2ae7f538514
|
2015-03-11 06:38:03 +03:00
|
|
|
|
2015-04-10 02:50:41 +03:00
|
|
|
Test message
|
|
|
|
$ rm .hg/remotenames
|
|
|
|
$ echo "[remotenames]" >> $HGRCPATH
|
|
|
|
$ echo "transitionmessage = Test transition message" >> $HGRCPATH
|
|
|
|
$ echo " with newline" >> $HGRCPATH
|
|
|
|
$ hg pull -q
|
|
|
|
Test transition message
|
|
|
|
with newline
|
|
|
|
|
2015-03-11 06:38:03 +03:00
|
|
|
Test transition bookmark disallowed
|
|
|
|
$ echo "[remotenames]" >> $HGRCPATH
|
2015-03-14 03:37:05 +03:00
|
|
|
$ echo "disallowedbookmarks = master, stable, other, notdeleted" >> $HGRCPATH
|
2015-03-11 06:38:03 +03:00
|
|
|
$ hg book master
|
2015-03-14 03:37:05 +03:00
|
|
|
abort: bookmark 'master' not allowed by configuration
|
2015-03-11 06:38:03 +03:00
|
|
|
[255]
|
|
|
|
$ hg book okay stable
|
2015-03-14 03:37:05 +03:00
|
|
|
abort: bookmark 'stable' not allowed by configuration
|
2015-03-11 06:38:03 +03:00
|
|
|
[255]
|
2015-03-12 00:53:36 +03:00
|
|
|
$ hg book other -r ".^"
|
2015-03-14 03:37:05 +03:00
|
|
|
abort: bookmark 'other' not allowed by configuration
|
2015-03-11 06:38:03 +03:00
|
|
|
[255]
|
|
|
|
$ hg book foo
|
|
|
|
$ hg book -m foo stable
|
2015-03-14 03:37:05 +03:00
|
|
|
abort: bookmark 'stable' not allowed by configuration
|
2015-03-11 06:38:03 +03:00
|
|
|
[255]
|
2015-03-14 03:37:05 +03:00
|
|
|
$ hg book -d notdeleted
|
2015-03-14 03:20:31 +03:00
|
|
|
|
|
|
|
Test push to renamed dest
|
|
|
|
$ hg push remote
|
|
|
|
pushing to $TESTTMP/repo1 (glob)
|
|
|
|
searching for changes
|
|
|
|
abort: push would create new anonymous heads (d2ae7f538514)
|
2015-11-05 01:28:02 +03:00
|
|
|
(use --allow-anon to override this warning)
|
2015-03-14 03:20:31 +03:00
|
|
|
[255]
|
2015-03-14 03:17:49 +03:00
|
|
|
|
|
|
|
Test pull from renamed source
|
|
|
|
$ hg pull remote
|
|
|
|
pulling from $TESTTMP/repo1 (glob)
|
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
|