2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2020-06-11 03:33:43 +03:00
|
|
|
$ configure mutation-norecord
|
2017-10-13 14:05:55 +03:00
|
|
|
$ . "$TESTDIR/histedit-helpers.sh"
|
|
|
|
|
2020-01-20 13:42:49 +03:00
|
|
|
$ enable fbhistedit histedit rebase
|
2017-10-13 14:05:55 +03:00
|
|
|
|
|
|
|
$ 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
|
2020-10-08 21:06:31 +03:00
|
|
|
$ hg up -q 'desc(base)'
|
2017-10-13 14:05:55 +03:00
|
|
|
$ for x in d e f ; do
|
|
|
|
> echo $x > $x
|
|
|
|
> hg add $x
|
|
|
|
> hg commit -m $x
|
|
|
|
> done
|
2018-08-16 20:37:29 +03:00
|
|
|
$ tglogp
|
2020-10-09 06:30:01 +03:00
|
|
|
@ 1eb7eda15cd7 draft 'f'
|
2017-10-13 14:05:55 +03:00
|
|
|
|
|
2020-10-09 06:30:01 +03:00
|
|
|
o 581a2eefdc84 draft 'e'
|
2017-10-13 14:05:55 +03:00
|
|
|
|
|
2020-10-09 06:30:01 +03:00
|
|
|
o 331acda6ee00 draft 'd'
|
2017-10-13 14:05:55 +03:00
|
|
|
|
|
2020-10-09 06:30:01 +03:00
|
|
|
| o f9d2e574dc58 draft 'c'
|
2017-10-13 14:05:55 +03:00
|
|
|
| |
|
2020-10-09 06:30:01 +03:00
|
|
|
| o c87fe1ae405f draft 'b'
|
2017-10-13 14:05:55 +03:00
|
|
|
| |
|
2020-10-09 06:30:01 +03:00
|
|
|
| o c604726e05fb draft 'a'
|
2017-10-13 14:05:55 +03:00
|
|
|
|/
|
2020-10-09 06:30:01 +03:00
|
|
|
o d20a80d4def3 draft 'base'
|
2017-10-13 14:05:55 +03:00
|
|
|
|
|
|
|
Use histedit to graft an extra commit into current history
|
|
|
|
|
2020-10-08 21:06:31 +03:00
|
|
|
$ hg up -q 'desc(c)'
|
|
|
|
$ hg histedit 'max(desc(a))' --commands - 2>&1 << EOF | fixbundle
|
2017-10-13 14:05:55 +03:00
|
|
|
> pick c604726e05fb
|
|
|
|
> pick c87fe1ae405f
|
|
|
|
> graft 581a2eefdc84
|
|
|
|
> pick f9d2e574dc58
|
|
|
|
> EOF
|
|
|
|
|
2018-08-16 20:37:29 +03:00
|
|
|
$ tglogp
|
2020-10-09 06:30:01 +03:00
|
|
|
@ fc9a25c1b8af draft 'c'
|
2017-10-13 14:05:55 +03:00
|
|
|
|
|
2020-10-09 06:30:01 +03:00
|
|
|
o efc3ff9af0d1 draft 'e'
|
2017-10-13 14:05:55 +03:00
|
|
|
|
|
2020-10-09 06:30:01 +03:00
|
|
|
| o 1eb7eda15cd7 draft 'f'
|
2017-10-13 14:05:55 +03:00
|
|
|
| |
|
2020-10-09 06:30:01 +03:00
|
|
|
| x 581a2eefdc84 draft 'e'
|
2017-10-13 14:05:55 +03:00
|
|
|
| |
|
2020-10-09 06:30:01 +03:00
|
|
|
| o 331acda6ee00 draft 'd'
|
2017-10-13 14:05:55 +03:00
|
|
|
| |
|
2020-10-09 06:30:01 +03:00
|
|
|
o | c87fe1ae405f draft 'b'
|
2017-10-13 14:05:55 +03:00
|
|
|
| |
|
2020-10-09 06:30:01 +03:00
|
|
|
o | c604726e05fb draft 'a'
|
2017-10-13 14:05:55 +03:00
|
|
|
|/
|
2020-10-09 06:30:01 +03:00
|
|
|
o d20a80d4def3 draft 'base'
|
2017-10-13 14:05:55 +03:00
|
|
|
|
|
|
|
Try to use histedit to graft a non-existent commit
|
|
|
|
|
2020-10-08 21:06:31 +03:00
|
|
|
$ hg histedit 'max(desc(a))' --commands - 2>&1 << EOF | fixbundle
|
2017-10-13 14:05:55 +03:00
|
|
|
> 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
|
|
|
|
|
2020-10-08 21:06:31 +03:00
|
|
|
$ hg histedit 'max(desc(a))' --commands - 2>&1 << EOF | fixbundle
|
2017-10-13 14:05:55 +03:00
|
|
|
> 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)
|
|
|
|
|