2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2014-10-12 07:47:31 +04:00
|
|
|
$ . "$TESTDIR/histedit-helpers.sh"
|
|
|
|
|
2020-06-11 03:33:43 +03:00
|
|
|
$ configure mutation-norecord
|
2020-01-20 13:42:49 +03:00
|
|
|
$ enable fbhistedit histedit rebase
|
2014-10-12 07:47:31 +04:00
|
|
|
|
|
|
|
$ initrepo ()
|
|
|
|
> {
|
|
|
|
> hg init r
|
|
|
|
> cd r
|
|
|
|
> for x in a b c d e f ; do
|
|
|
|
> echo $x > $x
|
|
|
|
> hg add $x
|
|
|
|
> hg ci -m $x
|
|
|
|
> done
|
|
|
|
> }
|
|
|
|
|
|
|
|
$ initrepo
|
|
|
|
|
|
|
|
log before edit
|
|
|
|
|
|
|
|
$ hg log --graph
|
2020-07-21 03:23:52 +03:00
|
|
|
@ commit: 652413bf663e
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test
|
|
|
|
│ date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
│ summary: f
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: e860deea161a
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test
|
|
|
|
│ date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
│ summary: e
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 055a42cdd887
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test
|
|
|
|
│ date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
│ summary: d
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 177f92b77385
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test
|
|
|
|
│ date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
│ summary: c
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: d2ae7f538514
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test
|
|
|
|
│ date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
│ summary: b
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: cb9a9f314b8b
|
2014-10-12 07:47:31 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: a
|
|
|
|
|
|
|
|
|
|
|
|
exec & continue should not preserve hashes
|
|
|
|
|
|
|
|
$ hg histedit 177f92b77385 --commands - 2>&1 << EOF| fixbundle
|
|
|
|
> pick 177f92b77385 c
|
|
|
|
> pick 055a42cdd887 d
|
|
|
|
> pick e860deea161a e
|
|
|
|
> exec echo "this should be printed to stdout"
|
|
|
|
> exec echo "this should be printed to stderr" >&2
|
|
|
|
> pick 652413bf663e f
|
|
|
|
> EOF
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
this should be printed to stdout
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
this should be printed to stderr
|
|
|
|
|
|
|
|
$ hg log --graph
|
2020-07-21 03:23:52 +03:00
|
|
|
@ commit: 652413bf663e
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test
|
|
|
|
│ date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
│ summary: f
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: e860deea161a
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test
|
|
|
|
│ date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
│ summary: e
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 055a42cdd887
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test
|
|
|
|
│ date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
│ summary: d
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 177f92b77385
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test
|
|
|
|
│ date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
│ summary: c
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: d2ae7f538514
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test
|
|
|
|
│ date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
│ summary: b
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: cb9a9f314b8b
|
2014-10-12 07:47:31 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: a
|
|
|
|
|
|
|
|
ensure we are properly executed in a shell
|
|
|
|
$ hg histedit 177f92b77385 --commands - 2>&1 << EOF| fixbundle
|
|
|
|
> pick 177f92b77385 c
|
|
|
|
> pick 055a42cdd887 d
|
|
|
|
> pick e860deea161a e
|
|
|
|
> exec echo "foo" >/dev/null && exit 0
|
|
|
|
> pick 652413bf663e f
|
|
|
|
> EOF
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
a failing command should drop us into the shell
|
|
|
|
|
|
|
|
$ hg histedit 177f92b77385 --commands - 2>&1 << EOF| fixbundle
|
|
|
|
> pick 177f92b77385 c
|
|
|
|
> pick 055a42cdd887 d
|
|
|
|
> pick e860deea161a e
|
|
|
|
> exec exit 1
|
|
|
|
> pick 652413bf663e f
|
|
|
|
> EOF
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
Command 'exit 1' failed with exit status 1
|
|
|
|
|
|
|
|
continue should work
|
|
|
|
|
|
|
|
$ hg histedit --continue
|
|
|
|
|
|
|
|
$ hg log --template '{node|short} {desc}' --graph
|
|
|
|
@ 652413bf663e f
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o e860deea161a e
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o 055a42cdd887 d
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o 177f92b77385 c
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o d2ae7f538514 b
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o cb9a9f314b8b a
|
|
|
|
|
|
|
|
|
|
|
|
abort should work
|
|
|
|
|
|
|
|
$ hg histedit 177f92b77385 --commands - 2>&1 << EOF| fixbundle
|
|
|
|
> pick 177f92b77385 c
|
|
|
|
> pick 055a42cdd887 d
|
|
|
|
> pick e860deea161a e
|
|
|
|
> exec exit 1
|
|
|
|
> pick 652413bf663e f
|
|
|
|
> EOF
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
Command 'exit 1' failed with exit status 1
|
|
|
|
|
|
|
|
$ hg histedit --abort
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ hg log --template '{node|short} {desc}' --graph
|
|
|
|
@ 652413bf663e f
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o e860deea161a e
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o 055a42cdd887 d
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o 177f92b77385 c
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o d2ae7f538514 b
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o cb9a9f314b8b a
|
|
|
|
|
|
|
|
|
|
|
|
Multiple exec commands must work
|
|
|
|
|
|
|
|
$ hg histedit 177f92b77385 --commands - 2>&1 << EOF| fixbundle
|
|
|
|
> pick 177f92b77385 c
|
|
|
|
> pick 055a42cdd887 d
|
|
|
|
> exec exit 0
|
|
|
|
> pick e860deea161a e
|
|
|
|
> exec exit 0
|
|
|
|
> exec exit 0
|
|
|
|
> exec exit 0
|
|
|
|
> pick 652413bf663e f
|
|
|
|
> EOF
|
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ hg log --template '{node|short} {desc}' --graph
|
|
|
|
@ 652413bf663e f
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o e860deea161a e
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o 055a42cdd887 d
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o 177f92b77385 c
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o d2ae7f538514 b
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o cb9a9f314b8b a
|
|
|
|
|
|
|
|
|
|
|
|
amend should just work fine
|
|
|
|
|
|
|
|
$ hg histedit 177f92b77385 --commands - 2>&1 << EOF
|
|
|
|
> pick 177f92b77385 c
|
|
|
|
> pick 055a42cdd887 d
|
|
|
|
> pick e860deea161a e
|
|
|
|
> exec echo "NEW" > NEW && hg add NEW && hg commit --amend
|
|
|
|
> pick 652413bf663e f
|
|
|
|
> EOF
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ hg log --template '{node|short} {files} {desc}' --graph
|
|
|
|
@ 3cc63bf64c8d f f
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o 8a564dc5ed88 NEW e e
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o 055a42cdd887 d d
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o 177f92b77385 c c
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o d2ae7f538514 b b
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2014-10-12 07:47:31 +04:00
|
|
|
o cb9a9f314b8b a a
|
|
|
|
|