sapling/tests/test-remotenames-transition.t
Durham Goode ad813edcbd treemanifest: enable treemanifest by default in tests
Summary:
Now that all our repos are treemanifest, let's enable the extension by
default in tests. Once we're certain no one needs it in production we'll also
make it the default in core Mercurial.

This diff includes a minor fix in treemanifest to be aware of always-enabled
extensions. It won't matter until we actually add treemanifest to the list of
default enabled extensions, but I caught this while testing things.

Reviewed By: ikostia

Differential Revision: D15030253

fbshipit-source-id: d8361f915928b6ad90665e6ed330c1df5c8d8d86
2019-05-28 03:17:02 -07:00

131 lines
3.4 KiB
Perl

$ setconfig extensions.treemanifest=!
Set up extension and repos
$ echo "[extensions]" >> $HGRCPATH
$ echo "remotenames=" >> $HGRCPATH
$ 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
$ echo "[paths]" >> .hg/hgrc
$ echo "default-push=$TESTTMP/repo1" >> .hg/hgrc
$ hg pull
pulling from $TESTTMP/repo1 (glob)
searching for changes
no changes found
$ hg log -l 1 -T '{node|short} {remotenames}\n'
cb9a9f314b8b default/bm1 default/bm2
Test renaming
$ rm .hg/remotenames
$ echo "[remotenames]" >> $HGRCPATH
$ echo "rename.default = remote" >> $HGRCPATH
$ hg pull
pulling from $TESTTMP/repo1 (glob)
searching for changes
no changes found
$ hg log -l 1 -T '{node|short} {remotenames}\n'
cb9a9f314b8b remote/bm1 remote/bm2
Test hoisting basics
$ hg book
no bookmarks set
$ hg debugnamecomplete
default
remote/bm1
remote/bm2
tip
$ echo "[remotenames]" >> $HGRCPATH
$ echo "hoist = remote" >> $HGRCPATH
$ hg debugnamecomplete
bm1
bm2
default
remote/bm1
remote/bm2
tip
Test hoisting name lookup
$ rm .hg/remotenames
$ hg log -r . -T '{hoistedbookmarks}\n'
$ hg pull
pulling from $TESTTMP/repo1 (glob)
searching for changes
no changes found
$ hg log -r bm1 -T '{node|short} - {bookmarks} - {hoistednames} - {remotebookmarks}\n'
cb9a9f314b8b - - bm1 bm2 - remote/bm1 remote/bm2
$ hg log -r bm2 -T '{node|short} - {bookmarks} - {hoistednames} - {remotebookmarks}\n'
cb9a9f314b8b - - bm1 bm2 - remote/bm1 remote/bm2
Test transition bookmark deletion
$ rm .hg/remotenames
$ hg book stable -r .
$ echo b > b
$ hg add b
$ hg commit -qm 'b'
$ hg book notdeleted
$ hg book master
$ hg bookmarks
* master 1:d2ae7f538514
notdeleted 1:d2ae7f538514
stable 0:cb9a9f314b8b
$ echo "[remotenames]" >> $HGRCPATH
$ echo "transitionbookmarks = master, stable, other" >> $HGRCPATH
$ hg pull
pulling from $TESTTMP/repo1 (glob)
searching for changes
no changes found
$ hg bookmarks
notdeleted 1:d2ae7f538514
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
Test transition bookmark disallowed
$ echo "[remotenames]" >> $HGRCPATH
$ echo "disallowedbookmarks = master, stable, other, notdeleted" >> $HGRCPATH
$ hg book master
abort: bookmark 'master' not allowed by configuration
[255]
$ hg book okay stable
abort: bookmark 'stable' not allowed by configuration
[255]
$ hg book other -r ".^"
abort: bookmark 'other' not allowed by configuration
[255]
$ hg book foo
$ hg book -m foo stable
abort: bookmark 'stable' not allowed by configuration
[255]
$ hg book -d notdeleted
Test push to renamed dest
$ hg push remote
pushing to $TESTTMP/repo1 (glob)
searching for changes
abort: push would create new anonymous heads (d2ae7f538514)
(use --allow-anon to override this warning)
[255]
Test pull from renamed source
$ hg pull remote
pulling from $TESTTMP/repo1 (glob)
searching for changes
no changes found