sapling/tests/test-smartlog-inhibit.t
Arun Kulshreshtha 50c7f6c256 fbamend: add automatic restacking to split and fold
Summary: Automatically rebase unstable commits left behind after a split or fold in the middle of a stack. Previously, users had to run `hg restack` to fix their stacks after the fact. This change also fixes the issue identified in t14560234 whereby the old stack (entirely obsolete) stack would be left visible after splitting or folding a head commit due to the inhibit extension not correctly deinhibiting the old stack.

Test Plan: Create a stack of commits and perform `hg split` or `hg fold` on a commit (or set of commits) that have descendants. After the operation these commits should be rebased, preserving the linearity of the stack. See unit tests for specific test cases.

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4432833

Tasks: 14560234, 15266009

Signature: t1:4432833:1484880689:1e07e421c8871dfef8bd016454aaed5a88a4a7d1
2017-01-20 00:24:45 -08:00

53 lines
1.3 KiB
Perl

$ . $TESTDIR/require-ext.sh directaccess evolve inhibit
$ extpath=`dirname $TESTDIR`
$ cp $extpath/hgext3rd/smartlog.py $TESTTMP # use $TESTTMP substitution in message
$ cp $extpath/hgext3rd/fbamend.py $TESTTMP
$ cat >> $HGRCPATH << EOF
> [extensions]
> directaccess =
> evolve=
> fbamend=$TESTTMP/fbamend.py
> inhibit=
> rebase=
> smartlog=$TESTTMP/smartlog.py
> [experimental]
> evolution = createmarkers
> evolutioncommands = prev next split fold
> EOF
Test that changesets with visible precursors are rendered as x's, even
with the inhibit extension enabled.
$ hg init repo
$ cd repo
$ hg debugbuilddag +4
$ hg book -r 3 test
$ hg up 1
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg amend -m "amended"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
$ hg smartlog -T '{rev} {bookmarks}'
warning: there is no master changeset locally, try pulling from server
@ 4
|
| o 3 test
| |
| o 2
| |
| x 1 59cf2bc6d22f.preamend
|/
o 0
$ hg unamend
$ hg up 2
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg smartlog -T '{rev} {bookmarks}'
warning: there is no master changeset locally, try pulling from server
o 3 test
|
@ 2
|
o 1 59cf2bc6d22f.preamend
|
~