sapling/eden/hg-server/tests/test-fb-hgext-fbhistedit-graft.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

89 lines
1.9 KiB
Perl

#chg-compatible
$ configure mutation-norecord
$ . "$TESTDIR/histedit-helpers.sh"
$ enable fbhistedit histedit rebase
$ hg init repo
$ cd repo
$ echo base > base
$ hg add base
$ hg commit -m "base"
$ for x in a b c ; do
> echo $x > $x
> hg add $x
> hg commit -m $x
> done
$ hg up -q 'desc(base)'
$ for x in d e f ; do
> echo $x > $x
> hg add $x
> hg commit -m $x
> done
$ tglogp
@ 1eb7eda15cd7 draft 'f'
o 581a2eefdc84 draft 'e'
o 331acda6ee00 draft 'd'
│ o f9d2e574dc58 draft 'c'
│ │
│ o c87fe1ae405f draft 'b'
│ │
│ o c604726e05fb draft 'a'
├─╯
o d20a80d4def3 draft 'base'
Use histedit to graft an extra commit into current history
$ hg up -q 'desc(c)'
$ hg histedit 'max(desc(a))' --commands - 2>&1 << EOF | fixbundle
> pick c604726e05fb
> pick c87fe1ae405f
> graft 581a2eefdc84
> pick f9d2e574dc58
> EOF
$ tglogp
@ fc9a25c1b8af draft 'c'
o efc3ff9af0d1 draft 'e'
│ o 1eb7eda15cd7 draft 'f'
│ │
│ x 581a2eefdc84 draft 'e'
│ │
│ o 331acda6ee00 draft 'd'
│ │
o │ c87fe1ae405f draft 'b'
│ │
o │ c604726e05fb draft 'a'
├─╯
o d20a80d4def3 draft 'base'
Try to use histedit to graft a non-existent commit
$ hg histedit 'max(desc(a))' --commands - 2>&1 << EOF | fixbundle
> pick c604726e05fb
> pick c87fe1ae405f
> graft abcdefabcdef
> pick fc3ff9af0d1c
> pick fc9a25c1b8af
> EOF
hg: parse error: unknown changeset abcdefabcdef listed
Try to use histedit to graft a commit from the set of commits being edited
$ hg histedit 'max(desc(a))' --commands - 2>&1 << EOF | fixbundle
> pick c604726e05fb
> pick c87fe1ae405f
> graft fc9a25c1b8af
> pick fc3ff9af0d1c
> pick fc9a25c1b8af
> EOF
hg: parse error: graft "fc9a25c1b8af" changeset was an edited list candidate
(graft must only use unlisted changesets)