Commit Graph

13 Commits

Author SHA1 Message Date
Mark Thomas
4f8aadb257 hide: pluralize messages
Reviewed By: quark-zju

Differential Revision: D15562714

fbshipit-source-id: 54bb2526fce470ebfe8f0f29baab3c4d823f74c1
2019-06-03 08:48:25 -07:00
Mark Thomas
3584341a18 visibility: use x graphnode for invisible commits
Summary:
The `-` graphnode can be confusing as `-` is also used for horizontal graph lines.

There are no good ASCII characters to use for invisible commits, so revert to
just using `x` so that they match obsolete commits.

Reviewed By: quark-zju

Differential Revision: D15293717

fbshipit-source-id: 5d1f327ddd8c3f104a99f494309a79b10ad71401
2019-05-16 02:35:48 -07:00
Mark Thomas
104261775b visibility: add unamend support
Summary:
Add support for the `unamend` command.  It should use the mutation predecessors
if mutation is enabled, and update the visibility of the commits.

Reviewed By: quark-zju

Differential Revision: D15146976

fbshipit-source-id: e9ee4d26f45ba9e5c3c05a7bca80c8ac326adb9c
2019-05-02 04:06:26 -07:00
Mark Thomas
ccab681822 visibility: support undo after split
Summary:
Undo removes visibility of commits one by one, starting at the bottom of the
stack.  This doesn't work, as the bottom of the stack is kept visible by the
commits above it.

Remove them all in one go.

Reviewed By: mitrandir77

Differential Revision: D15079353

fbshipit-source-id: 52335b6dd1bd91c7f87d1a8ee2dbefa8aff7d24b
2019-04-26 01:07:30 -07:00
Mark Thomas
af2e53abb0 visibility: add shelve support
Summary:
Shelve uses hidden commits to store shelved changes.  These need to be made
invisible, too.

Differential Revision: D15079352

fbshipit-source-id: 6063270d18df81d9b4af7823542a38c5feb45e3a
2019-04-26 01:07:30 -07:00
Mark Thomas
5e64071333 visibility: use graphnode '-' for all invisible commits
Summary:
Use the graphnode `-` for all invisible commits, even obsolete ones.

Users will only see them in their logs if:
- they run log with `--hidden`.
- they have invisible commits that are temporarily unhidden (e.g. they've checked it out).

Reviewed By: mitrandir77

Differential Revision: D15061894

fbshipit-source-id: 86873bd86cb15cef72dae248b8e2a636378cc547
2019-04-24 12:04:09 -07:00
Mark Thomas
90b12d41f4 mutation: use tglogm in all tests
Summary:
The `tglogm` test function displays a graph log with mutation information.
Use this common function in all tests.

Differential Revision: D14876688

fbshipit-source-id: 2eb29a45b6267d448d292ac13dbfb0135d6fc8e4
2019-04-11 07:49:20 -07:00
Mark Thomas
d562032896 mutation: improve performance of obsolete check
Summary:
The computation of whether a commit is obsolete or not can be improved.

We can cache which commits are known to not be obsolete.

We can also have a cache for each filter type so that we only need to compute
obsolete nodes that match the filter.

Finally, when we need to compute all obsolete commits, we can start by looking
for commits which are made obsolete by only their closest successors, and then
filling back obsolescence to the predecessors of these obsolete commits.

Reviewed By: DurhamG

Differential Revision: D14858655

fbshipit-source-id: 1d03e214ad878ecb6ae548f80373702e2a184146
2019-04-11 02:45:16 -07:00
Mark Thomas
07f5225572 visibility: don't let hiddenoverride pin commits visible
Summary:
With explicit visibility tracking, the hiddenoverride feature of the amend
extension is no long necessary.  When upgrading to explicit visibility,
include the pinned visible commits, however after that point, hiddenoverride
should have no effect.

Users can permanently reveal obsoleted commits using `hg unhide`.

Reviewed By: DurhamG

Differential Revision: D14851269

fbshipit-source-id: b516fa97ed1545d39b51baaf9c574cb73a571645
2019-04-11 02:45:15 -07:00
Mark Thomas
d803ebb3c7 visibility: make enabling or disabling of tracking a command
Summary:
Rather than implicitly upgrading or downgrading a repo based on the
`visibility.tracking` config option, add a new `hg debugvisibility` command to
do this explicitly.

Reviewed By: DurhamG

Differential Revision: D14871231

fbshipit-source-id: 73f4648408b3eca9ac12bd77e54d2d37ee342069
2019-04-11 02:45:15 -07:00
Mark Thomas
275ab15494 visibility: add undo support
Summary:
Add basic support for `undo` by updating visibility according to what the undo
extension would normally do with obsmarkers.

A future enhancement would be to use the `draftheads` directly as the new
visibleheads, however:

* `undo` currently uses `heads(draft())` which doesn't take into account
  secret commits.
* In order to support the `--branch` flag, we would need to make significant
  changes.  The flag is marked as ADVANCED and isn't used very much, so we may
  consider removing it.

Reviewed By: quark-zju

Differential Revision: D14603196

fbshipit-source-id: 5b8c91b4d8fa2b28cf9ad5726d88a3735aca50ad
2019-03-27 04:49:14 -07:00
Mark Thomas
d6cf315f8f mutation: prefix predecessor hashes with hashing scheme
Summary:
To support future alternate hashing schemes, predecessor identities should be
prefixed with the hashing scheme in use.

Currently there is only one hashing scheme: `hg`, which is the Mercurial
hashing scheme.

Reviewed By: quark-zju

Differential Revision: D14566778

fbshipit-source-id: baaaf2f078886a1cc7ac20d12923a63b4da09db6
2019-03-27 04:49:12 -07:00
Mark Thomas
d7375d7397 visibility: update visibility when commits are modified
Summary:
When commits are added or modified, update the set of visible heads if
visibility tracking is enabled.

Reviewed By: DurhamG

Differential Revision: D12980779

fbshipit-source-id: 8f44045159c86a374ae530fa4327ee0807b4320d
2019-03-08 03:05:58 -08:00