mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
99386e40fd
Summary: debuginhibit was removed since we no longer have a separate inhibit state. smartlog hack about changing "o" to "x" was removed since "obsolete()" revset is correct and the hack is unnecessary now. directaccess was removed from tests since inhibit does not depend on it. `- obsolete()` was added to some revsets to avoid divergence and other surprises. Use `inhibit.revive` API in infinitepush and reset to revive changesets properly. Remove various hacky code that mangle inhibit state in corner cases. Most test changes are `o` changed to `x` in output since we draw `obsolete()` state correctly now. `test-infinitepush-backup-remotefilelog.t` change was because output could be `bytes/sec` instead of `KB/sec`. Test Plan: arc unit Reviewers: #mercurial, kulshrax Reviewed By: kulshrax Subscribers: kulshrax, medson, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D5391361 Signature: t1:5391361:1499722618:d3c1cf629f0c59ecdf1dfd5e653c1eb6176646b8
86 lines
1.8 KiB
Perl
86 lines
1.8 KiB
Perl
Set up test environment.
|
|
$ cat >> $HGRCPATH << EOF
|
|
> [extensions]
|
|
> fbamend=$TESTDIR/../hgext3rd/fbamend
|
|
> inhibit=$TESTDIR/../hgext3rd/inhibit.py
|
|
> rebase=
|
|
> strip=
|
|
> tweakdefaults=$TESTDIR/../hgext3rd/tweakdefaults.py
|
|
> [experimental]
|
|
> evolution = createmarkers
|
|
> [fbamend]
|
|
> userestack=true
|
|
> EOF
|
|
$ 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 "{rev} {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 1
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
$ hg amend -m "amended"
|
|
warning: the changeset's children were left behind
|
|
(use 'hg restack' to rebase them)
|
|
$ hg book
|
|
no bookmarks set
|
|
|
|
Test hg amend --fixup.
|
|
$ showgraph
|
|
@ 4 amended
|
|
|
|
|
| o 3 add d
|
|
| |
|
|
| o 2 add c
|
|
| |
|
|
| x 1 add b
|
|
|/
|
|
o 0 add a
|
|
|
|
$ hg amend --fixup
|
|
rebasing 2:* "add c" (glob)
|
|
rebasing 3:* "add d" (glob)
|
|
$ showgraph
|
|
o 6 add d
|
|
|
|
|
o 5 add c
|
|
|
|
|
@ 4 amended
|
|
|
|
|
o 0 add a
|
|
|
|
Test that the operation field on the metadata is correctly set.
|
|
$ hg debugobsolete
|
|
[a-f0-9]* [a-f0-9]* 0 .* {'operation': 'amend', 'user': 'test'} (re)
|
|
[a-f0-9]* [a-f0-9]* 0 .* {'operation': 'rebase', 'user': 'test'} (re)
|
|
[a-f0-9]* [a-f0-9]* 0 .* {'operation': 'rebase', 'user': 'test'} (re)
|
|
|
|
Test hg amend --rebase
|
|
$ hg amend -m "amended again" --rebase
|
|
rebasing 5:* "add c" (glob)
|
|
rebasing 6:* "add d" (glob)
|
|
$ showgraph
|
|
o 9 add d
|
|
|
|
|
o 8 add c
|
|
|
|
|
@ 7 amended again
|
|
|
|
|
o 0 add a
|