Commit Graph

4 Commits

Author SHA1 Message Date
Arun Kulshreshtha
4a81b50bc3 fbamend: return early on split/fold error
Summary: Although the split and fold commands usually abort on error, in some cases they simply write to stderr and return a nonzero exit status. Previously, the wrappers in fbamend would expect failures to result in an abort, and therefore didn't return early. This resulted in restack errors when this was not the case -- notably in the case of folding a commit with itself. This diff fixes the problem by returning early on error.

Test Plan: Attempting to fold a commit with itself (i.e., `hg fold --exact . .`) fails with an error message instead of crashing.

Reviewers: #mercurial, simonfar

Reviewed By: simonfar

Subscribers: mjpieters

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

Tasks: 15704338

Signature: t1:4493029:1485986404:17186b47786cf79c735b33adbb19de79ac75a5be
2017-02-01 15:14:17 -08:00
Arun Kulshreshtha
37e275d052 fbamend: move bookmarks after split/fold
Summary: Previously, if a user ran split or fold on commits with bookmarks on them, those bookmarks would remain on the original commit instead of the new split or folded commits. This behavior was unexpected and confusing because it meant the obsolete commit would remain visible and the user would be forced to manually move the bookmark. This change makes split and fold automatically move any bookmarks on the old commits onto the newly created commits.

Test Plan: Run `hg split` or `hg fold` on a commit or set of commits with one or more bookmarks, and observe that the bookmarks are updated to point to the newly created commits. See tests for examples.

Reviewers: #mercurial, simonfar

Reviewed By: simonfar

Subscribers: mjpieters

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

Tasks: 15595449

Signature: t1:4490655:1485986009:858f099d3f95c6a45fe8b119d4f8d376b87652b7
2017-02-01 15:14:17 -08:00
Mateusz Kwapich
0a89353310 fb-hgext: fix test to match upstream fold changes
Summary: fold doesn't work without --from or --exact anymore

Test Plan: all tests are passing now

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Signature: t1:4441874:1484922064:1616827e2308b4b9d43e3ef1bd90f51c35a2a513
2017-01-20 06:23:56 -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