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

133 lines
3.9 KiB
Perl

#chg-compatible
Set up test environment.
$ configure mutation-norecord
$ enable amend rebase
$ setconfig ui.disallowemptyupdate=true
$ newrepo amendprevious
Check help text for new options and removal of unsupported options.
$ hg previous --help
hg previous [OPTIONS]... [STEPS]
aliases: prev
check out the parent commit
Options:
--newest always pick the newest parent when a changeset has
multiple parents
--bottom update to the lowest non-public ancestor of the
current changeset
--bookmark update to the first ancestor with a bookmark
--no-activate-bookmark do not activate the bookmark on the destination
changeset
-C --clean discard uncommitted changes (no backup)
-B --move-bookmark move active bookmark
-m --merge merge uncommitted changes
-c --check require clean working directory
(some details hidden, use --verbose to show complete help)
Create stack of commits and go to the top.
$ hg debugbuilddag --mergeable-file +6
$ hg up tip
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg book top
Test invalid argument combinations.
$ hg previous --bottom 1
abort: cannot use both number and --bottom
[255]
$ hg previous --bookmark 1
abort: cannot use both number and --bookmark
[255]
$ hg previous --bottom --bookmark
abort: cannot use both --bottom and --bookmark
[255]
Test basic usage.
$ hg previous
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark top)
[*] r4 (glob)
With positional argument.
$ hg previous 2
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
[*] r2 (glob)
Overshoot bottom of repo.
$ hg previous 5
reached root changeset
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
[*] r0 (glob)
Test --bottom flag.
$ hg up top
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark top)
$ hg previous --bottom
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark top)
[*] r0 (glob)
Test bookmark navigation.
$ hg book -r 'desc(r0)' root
$ hg book -r 'desc(r2)' bookmark
$ hg up top
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark top)
$ hg previous --bookmark
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark top)
[*] (bookmark) r2 (glob)
(activating bookmark bookmark)
$ hg previous --bookmark
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark bookmark)
[*] (root) r0 (glob)
(activating bookmark root)
Test bookmark activation.
$ hg up top
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark top)
$ hg previous 3
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark top)
[*] (bookmark) r2 (glob)
(activating bookmark bookmark)
$ hg previous 2 --no-activate-bookmark
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark bookmark)
[*] (root) r0 (glob)
Test dirty working copy and --merge.
$ hg up top
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark top)
$ echo "test" >> mf
$ hg st
M mf
$ hg previous --check
abort: uncommitted changes
[255]
$ hg previous --merge
merging mf
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(leaving bookmark top)
[*] r4 (glob)
$ hg st
M mf
Test dirty working copy and --clean.
$ hg previous --check
abort: uncommitted changes
[255]
$ hg previous --clean
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
[*] r3 (glob)
$ hg st