Commit Graph

12 Commits

Author SHA1 Message Date
Jun Wu
18c17ec9f1 tweakdefaults: use hint framework for prev
Summary:
A side effect is, the hint won't be printed out if fbamend is not enabled,
which is more "correct".

Reviewed By: markbt

Differential Revision: D7392130

fbshipit-source-id: 5b7aa4cc3083b03546c54965ce51040fab958b87
2018-04-13 21:51:49 -07:00
Jun Wu
213feff513 amend: use hint framework for auto rebase
Reviewed By: markbt

Differential Revision: D7392128

fbshipit-source-id: b502ac1d7595bd072b6bd4e96de69cde6cca1878
2018-04-13 21:51:49 -07:00
Jun Wu
238cda6c14 amend: use hint framework for restack
Summary: This allows people to silence the hint.

Reviewed By: markbt

Differential Revision: D7392127

fbshipit-source-id: ac16f952a178d567ce13e22946127456972ebe85
2018-04-13 21:51:49 -07:00
Jun Wu
10bf57de39 prune: use hint framework
Summary:
This allows users to silence the "hide" advice.

In the future, we might want to change "hide/unhide" to only affect visibility
without changing obsolesce. So "strip" is not fully deprecated yet.

Reviewed By: markbt

Differential Revision: D7392131

fbshipit-source-id: 2448d4c91dffce31d29e2dd99078cb555c9a8f8c
2018-04-13 21:51:49 -07:00
Andrew Breckenridge
892836abd7 trivial: Improves documentation for hg fold
Summary: Reimplements D7340879

Reviewed By: kulshrax

Differential Revision: D7473425

fbshipit-source-id: 42df99bd00092be8e517f2af50bf9ae9fc4d5027
2018-04-13 21:51:43 -07:00
Jun Wu
af8ecd5f80 obsolete: copy obsmarkers from old commits automatically
Summary:
Rewriting a set of commits where there are replacement relationship among the
commits do not have an optimal UX today. For example, `rebase -s A -d Z` or
`metaedit A` in the below graph. B1, B2, C will all be replaced. But the new B1
and B2 replacement won't have the B1 -> B2 relationship, and the "new B1"
appears to be revived.

```
  o C
  |
  x  B1 (amended as B2)
  |
  | o B2
  |/
  o  A    o  Z
```

One solution is to avoid rebasing `obsolete()::`, as implemented in D7067121
for metaedit. That would result in

```
  o C
  |
  x  B1 (amended as B2) o new B2
  |                     |
  x  A                  o new A
```

The stack of A, B1, C is forced to break into two parts. This is fine for
power users. But n00b users would wonder why C is left behind. Per discussion
with simpkins at an internal post about the metaedit case, we think a more
linear history is more user-friendly. That is:

```
  o new C
  |
  x  new B1 (amended as *new* B2)
  |
  | o new B2
  |/
  o new A
```

The stack stays in a same shape.

This diff implements the "copying obsmarkers" behavior at the "createmarkers"
level so everything using that API would get the feature for free, including
metaedit and rebase.

D7067121 is reverted since the new UX is preferred. The test added is for
`metaedit` command, changes to rebase will be added in a later patch.

Differential Revision: D7121487

fbshipit-source-id: fd3c8a96ab434b131fb86d9882ccbdff8f63f05e
2018-04-13 21:51:23 -07:00
Mateusz Kwapich
1ba076f3c1 metaedit: auto-rebase only non-obsoleted commits
Summary:
metaedit when metaediting a commit with obsolete & visible children did
autorebase all of them causing a divergence (which broke the restack)

Reviewed By: ryanmce

Differential Revision: D7067121

fbshipit-source-id: 679bc7acecde1cd648adcdddc9c8ac3ecc101208
2018-04-13 21:51:15 -07:00
Phil Cohen
de4ccf5688 restack: remove old pre-obsolesence fixup
Summary:
Per discussion with @[100000771202578:kulshrax] [1], the new behavior is enabled everywhere, and is also vastly preferable. Let's nuke the old code, as well as the config declaration and all places that manually enabled it.

[1]

> also, it looks like the pre-restack logic is still in that function, and the modern restack code path is still gated by a config option
> we should probably remove that

Reviewed By: kulshrax

Differential Revision: D7031365

fbshipit-source-id: dcc620c292bac03fdc0aa144546d4628bb673046
2018-04-13 21:51:13 -07:00
Phil Cohen
613890a88f restack: don't run rebase within a transaction
Summary:
Per discussion with @[100000771202578:kulshrax] [1], this isn't necessary anymore. This complicates the code, and prevents `amend --fixup` from using IMM, so let's remove it.

[1]
```
Haha, so at first I was like "wtf why does it do that"
then I remembered that inhibit used to be a thing
I'm pretty sure it does that to cause inhibit's post-transaction hook to fire in the right spot
which is now irrelevant since inhibit is gone
I can't really think of a reason why that transaction needs to be there (unless there's something else going on that's subtle)
```

Reviewed By: quark-zju

Differential Revision: D7031379

fbshipit-source-id: 73fdeec845c61af7e3bbaf17c7f42c8ab70588c2
2018-04-13 21:51:13 -07:00
Mainak Sen
20bcf91c66 fbamend: a config flag for skipping autorebase for hg amend
Reviewed By: quark-zju

Differential Revision: D6947242

fbshipit-source-id: cf22cf5f514825d7e09aade90f1c9efdc7f73fa1
2018-04-13 21:51:11 -07:00
Durham Goode
8103079702 imports: import from hgext instead of hgext3rd
The only reason these worked is because they were in the system python path.
Which means the in-repo code wasn't actually being tested.
2018-01-09 15:23:52 -08:00
Kostia Balytskyi
e75b9fc1b1 fb-hgext: move most of hgext3rd and related tests to core
Summary:
This commit moves most of the stuff in hgext3rd and related tests to
hg-crew/hgext and hg-crew/test respectively.

The things that are not moved are the ones which require some more complex
imports.


Depends on D6675309

Test Plan: - tests are failing at this commit, fixes are in the following commits

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675329
2018-01-09 03:03:59 -08:00