Commit Graph

2 Commits

Author SHA1 Message Date
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
97ed6a8afa fbamend: add new implementations of hg previous and hg next
Summary:
This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve:

  - Users can now move by multiple commits at a time. Example: `hg next 3`
  - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom`
  - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack)
  - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag.
  - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step.
  - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on.

Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up.

Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected.

Reviewers: quark, #sourcecontrol, durham

Reviewed By: durham

Subscribers: stash, mjpieters

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

Tasks: 14119420

Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-15 18:46:56 -08:00