Commit Graph

10 Commits

Author SHA1 Message Date
Jun Wu
99386e40fd inhibit: update existing code to work with the rewritten version
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
2017-07-10 15:45:31 -07:00
Therin Irwin
66b64d8fb6 fbamend: change hint text to suggest running restack
Summary: Instead of referencing `hg rebase` --restack option, just reference the `restack` subcommand.

Test Plan:
1. Make a few commits 1, 2, 3, 4 on any branch
2. `hg update 1`
3. Try to amend commit 1
4. Warning message should appear about children left behind
expected: Hint text does not mention `hg rebase --restack`

Reviewers: durham, kulshrax

Reviewed By: kulshrax

Subscribers: medson, mjpieters, kkrewink

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

Tasks: 19601780

Signature: t1:5313108:1498249314:98f31f4424341ef51997687293bf99b7297b6cd0
2017-06-26 07:31:28 -07:00
Jun Wu
3d461ae600 check-ext: make checks stricter
Summary:
Enhance check-ext script to be more strict:

 - Only one foreign extension is allowed: `remotenames`
 - Require explicit path for in-repo extensions to avoid wrong extensions
   being tested

This would make the test more predicatable since system extensions
will be less likely to be imported. Explicit path is better than
setting `PYTHONPATH` since `hgext/name.py` could override
`hgext3rd/name.py` regardless of `PYTHONPATH`.

Test Plan: arc unit

Reviewers: phillco, durham, ikostia, #mercurial, stash

Reviewed By: stash

Subscribers: medson, mjpieters

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

Signature: t1:5271430:1497861776:7dd35ec7c522cd9b26aa0871cb4306b4f1b8993a
2017-06-19 08:02:38 -07:00
Jun Wu
be7ac42b50 codemod: replace evolve by fbamend
Summary:
Now that fbamend has most of the features we want. Replace evolve
used by tests.

Minor changes are made to some extensions to make test pass:
- reset: drop commit reviving support (was provided by "hg touch")
- smartlog: do not assume who provides "allsuccessors" revset
- fbamend: return 1 on "nothing changed"
- fbamend: write operation data for split and fold
- fbamend: do not print incompatibility notice
- fbamend: do not disable itself when rebase is not enabled
- inhibit: remove `bookmark -D` option - use `prune -B` instead

Test Plan: arc unit

Reviewers: #mercurial, stash

Reviewed By: stash

Subscribers: stash, mjpieters, medson

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

Signature: t1:5258813:1497604051:0c7334f9a6554cf31aaaaa2a4995b17d4e445847
2017-06-16 15:50:01 -07:00
Jun Wu
f1b6191c18 fbamend: move to a package
Summary: `fbamend.py` is already long. It will become more complex so let's move it.

Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

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

Signature: t1:5209475:1497260957:e84aec4a2f90c8dd1d247b2b0caef48cfbb59c55
2017-06-13 17:08:20 -07:00
Jun Wu
01a471b159 codemod: use vendored directaccess and inhibit extension in tests
Summary:
This diff makes the tests use the vendored directaccess and inhibit instead the
foreign ones.

Test Plan: arc unit

Reviewers: #mercurial, sid0

Reviewed By: sid0

Subscribers: mjpieters

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

Signature: t1:5142981:1496173851:3a8f3a1c689711dbef517c893bf72c90ab144761
2017-05-30 12:56:40 -07:00
Arun Kulshreshtha
9df08f6f42 fbamend: ensure that restack obsmarkers have correct metadata
Summary: Previously, we were relying on the `allowunstable` extension to wrap various instability-inducing commands and set the appropriate config option to cause the `tweakdefaults` extension to write the correct operation metadata into the obsmarkers produced by each respective command, causing commits to show up as "amended as", "rebased as", etc, in `hg sl`. Since the operation name was based on the command being run, if a user ran `hg amend --fixup` instead of `hg restack`, for example, smartlog would say "amended as" instead of "rebased as". This diff fixes the problem by always setting the operation to "rebase" during a restack.

Test Plan:
1. Create a stack of two commits.
2. Amend the bottom one without `--rebase`.
3. Run `hg amend --fixup` with the `fbamend.userestack` config option enabled.
4. Run `hg sl --hidden` and observe that the rebased commit is marked as "rebased".

See test file for an example.

Reviewers: #mercurial, simonfar

Reviewed By: simonfar

Subscribers: mjpieters

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

Tasks: 16529478

Signature: t1:4670066:1488991076:58c139c50a1aab2aa4fc7e28b1efd57a67bdfb08
2017-03-08 11:30:14 -08:00
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
Arun Kulshreshtha
041eae0180 fbamend: edit hint to mention hg restack instead of hg amend --fixup
Summary: To encourage people to learn about and use `hg restack` (which is a more general fixup tool), tell users about it instead of `hg amend --fixup`. I wasn't sure whether to advertise it as `hg rebase --restack` or just `hg restack`, so I've included both.

Test Plan: Do an amend in the middle of a stack and observe the new wording. Unit tests reflect changed wording.

Reviewers: durham, #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Signature: t1:4390111:1483962208:46951c8f5e4c499840b0b4b0ee8ac1e1b6c14ca9
2017-01-09 11:09:02 -08:00
Arun Kulshreshtha
0943b06da1 fbamend: add config option to use restack instead of preamend bookmark
Summary: Added a configuration option to make fbamend use the functionality from `hg rebase --restack` instead of the previous bookmark-based approach in `hg amend`.

Test Plan: Enable the `fbamend.userestack` config option and attempt to use `hg amend`, `hg amend --fixup`, and `hg amend --rebase`. These should all work just as before, except that `hg amend` will no longer create .preamend bookmarks.

Reviewers: #sourcecontrol, quark, durham

Reviewed By: durham

Subscribers: mjpieters

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

Tasks: 13839177

Signature: t1:4062925:1477359251:0ece10599987d6b8e39384e9530866ffb2e50e58
2016-10-25 11:10:47 -07:00