sapling/eden/hg-server/tests/test-amend-userestack.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

87 lines
1.9 KiB
Perl

#chg-compatible
Set up test environment.
$ configure mutation
$ enable amend rebase tweakdefaults
$ mkcommit() {
> echo "$1" > "$1"
> hg add "$1"
> echo "add $1" > msg
> hg ci -l msg
> }
$ reset() {
> cd ..
> rm -rf userestack
> hg init userestack
> cd userestack
> }
$ showgraph() {
> hg log --graph -r '(::.)::' -T "{desc|firstline}" | sed \$d
> }
$ hg init userestack && cd userestack
Test that no preamend bookmark is created.
$ mkcommit a
$ mkcommit b
$ mkcommit c
$ mkcommit d
$ hg up 7c3bad9141dcb46ff89abf5f61856facd56e476c
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ hg amend -m "amended" --no-rebase
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
$ hg book
no bookmarks set
Test hg amend --fixup.
$ showgraph
@ amended
o add d
o add c
x add b
o add a
$ hg amend --fixup
warning: --fixup is deprecated and WILL BE REMOVED. use 'hg restack' instead.
rebasing 4538525df7e2 "add c"
rebasing 47d2a3944de8 "add d"
$ showgraph
o add d
o add c
@ amended
o add a
Test that the operation field on the metadata is correctly set.
$ hg debugmutation -r "all()"
* 1f0dee641bb7258c56bd60e93edfa2405381c41e
\* * amend by test at 1970-01-01T00:00:00 from: (glob)
7c3bad9141dcb46ff89abf5f61856facd56e476c
\* * rebase by test at 1970-01-01T00:00:00 from: (glob)
4538525df7e2b9f09423636c61ef63a4cb872a2d
\* * rebase by test at 1970-01-01T00:00:00 from: (glob)
47d2a3944de8b013de3be9578e8e344ea2e6c097
Test hg amend --rebase
$ hg amend -m "amended again" --rebase
rebasing * "add c" (glob)
rebasing * "add d" (glob)
$ showgraph
o add d
o add c
@ amended again
o add a