sapling/eden/hg-server/tests/test-remotenames-transition.t
Durham Goode 98d9269874 server: copy hg to a new hg-server directory
Summary:
Create a fork of the Mercurial code that we can use to build server
rpms. The hg servers will continue to exist for a few more months while we move
the darkstorm and ediscovery use cases off them. In the mean time, we want to
start making breaking changes to the client, so let's create a stable copy of
the hg code to produce rpms for the hg servers.

The fork is based off c7770c78d, the latest hg release.

This copies the files as is, then adds some minor tweaks to get it to build:
- Disables some lint checks that appear to be bypassed by path
- sed replace eden/scm with eden/hg-server
- Removed a dependency on scm/telemetry from the edenfs-client tests since
  scm/telemetry pulls in the original eden/scm/lib/configparser which conflicts
  with the hg-server conflict parser.

allow-large-files

Reviewed By: quark-zju

Differential Revision: D27632557

fbshipit-source-id: b2f442f4ec000ea08e4d62de068750832198e1f4
2021-04-09 10:09:06 -07:00

127 lines
3.4 KiB
Perl

#chg-compatible
Set up extension and repos
$ enable remotenames
$ 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
$ setconfig paths.default-push="$TESTTMP/repo1"
$ 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
$ hg dbsh -c 'with repo.lock(), repo.transaction("tr"): repo.svfs.writeutf8("remotenames","")'
$ setglobalconfig remotenames.rename.default=remote
$ 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
$ setglobalconfig remotenames.hoist=remote
$ hg debugnamecomplete
bm1
bm2
default
remote/bm1
remote/bm2
Test hoisting name lookup
$ hg dbsh -c 'with repo.lock(), repo.transaction("tr"): repo.svfs.writeutf8("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
$ hg dbsh -c 'with repo.lock(), repo.transaction("tr"): repo.svfs.writeutf8("remotenames","")'
$ hg book stable -r .
$ echo b > b
$ hg add b
$ hg commit -qm 'b'
$ hg book notdeleted
$ hg book master
$ hg bookmarks
* master d2ae7f538514
notdeleted d2ae7f538514
stable cb9a9f314b8b
$ setglobalconfig remotenames.transitionbookmarks="master, stable, other"
$ hg pull
pulling from $TESTTMP/repo1 (glob)
searching for changes
no changes found
$ hg bookmarks
notdeleted d2ae7f538514
Test message
$ hg dbsh -c 'with repo.lock(), repo.transaction("tr"): repo.svfs.writeutf8("remotenames","")'
$ hg book -ir tip master
$ readglobalconfig <<EOF
> [remotenames]
> transitionmessage = Test transition message
> with newline
> EOF
$ hg pull -q
Test transition message
with newline
Test transition bookmark disallowed
$ setglobalconfig remotenames.disallowedbookmarks="master, stable, other, notdelete"
$ 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