Commit Graph

27 Commits

Author SHA1 Message Date
Mark Thomas
465e91bbe5 debugmutation: don't use the unfiltered repo by default
Summary:
The `debugmutation` command uses the unfiltered repo to resolve the
user-provided revs.  It shouldn't do this unless the user passes `--hidden`.

Reviewed By: mitrandir77

Differential Revision: D17156722

fbshipit-source-id: 5ab7704acc598cf8b7c1640a3096ba0ce6ac73e9
2019-09-06 00:44:13 -07:00
Mark Thomas
8dc0110c6d debugmutation: improve format and render successors
Summary:
Update the debugmutation format to collapse long chains.  Add
`hg debugmutation -s` to follow the successor relationship (printing what the
commit became) instead of the predecessor relationship.

Reviewed By: mitrandir77

Differential Revision: D17156463

fbshipit-source-id: 44a68692e3bdea6a2fe2ef9f53b533199136eab1
2019-09-06 00:44:12 -07:00
Mark Thomas
013aa19333 mutation: don't allow divergence when rebasing
Summary:
In general, mutation tracking doesn't care about divergence.  However, in the
case of rebase, it doesn't make sense to allow divergence to occur if we can
avoid it by omitting some of the commits to rebase.

This makes rebase behaviour more like old obsmarker-based behaviour.  This
breaks a test for mutation copying markers, so update those to use metaedit,
which has the copying behaviour for both obsmarkers and mutation.  At some
point we should make rebase behave better in these cases.

Reviewed By: quark-zju

Differential Revision: D17136480

fbshipit-source-id: 9e465b7fc8bda33e7a746e4df68410713e2be37e
2019-09-02 03:13:51 -07:00
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
Durham Goode
ad813edcbd treemanifest: enable treemanifest by default in tests
Summary:
Now that all our repos are treemanifest, let's enable the extension by
default in tests. Once we're certain no one needs it in production we'll also
make it the default in core Mercurial.

This diff includes a minor fix in treemanifest to be aware of always-enabled
extensions. It won't matter until we actually add treemanifest to the list of
default enabled extensions, but I caught this while testing things.

Reviewed By: ikostia

Differential Revision: D15030253

fbshipit-source-id: d8361f915928b6ad90665e6ed330c1df5c8d8d86
2019-05-28 03:17:02 -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
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
a5207547aa mutation: add absorb support
Summary: The `absorb` command should also record mutation information when it modifies commits.

Reviewed By: DurhamG

Differential Revision: D14871232

fbshipit-source-id: 46bc95b7f5781f0b5f5e057a34c755fcfe653f7e
2019-04-11 02:45:16 -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
38930fd664 pullcreatemarkers: also create synthentic mutation entries and update visibility
Summary:
The pullcreatemarkers extension creates fake markers for landed commits by comparing
the differential revision of draft commits with those of landed commits.

In the future, mutation records will handle lands correctly, however until that stage,
replicate the pullcreatemarkers behaviour.

Reviewed By: DurhamG

Differential Revision: D14834746

fbshipit-source-id: e196ee28645270ccab1775ea896f0e453740c03e
2019-04-11 02:45:15 -07:00
Mark Thomas
ab9eb302f2 mutation: record mutation entries inside transactions
Summary:
Record mutation entries inside transactions.  This ensures that they only get
written when the transaction completes.

Indexedlog doesn't have support for pending writes, so mutation entries are not
visible to hook scripts.

Reviewed By: quark-zju

Differential Revision: D14566781

fbshipit-source-id: eb4c7bbd3878df82e8e7096a69509525f9fb93c0
2019-03-27 04:49:13 -07:00
Mark Thomas
6d84ff8825 mutation: create mutation store entries for local commits
Summary:
Computing mutation entries for all local commits is expensive when there are
lots of local draft commits.  Ideally we would have an indexed changelog that
would make these lookups fast, but until we have that, put entries in the
mutation store for these commits to take advantage of the fast lookup there.

Reviewed By: quark-zju

Differential Revision: D14566782

fbshipit-source-id: cc3a05715337a510a65d8ff436c59d16d0f0447e
2019-03-27 04:49:12 -07:00
Mark Thomas
4cef0e2f38 mutation: remove instabilities revsets
Summary:
The computations for instabilities revsets (`orphan`, `contentdivergent` and
`phasedivergent`) are complex, and aren't really necessary for the way we use
mutation information.

The `orphan` revset can be implemented as an alias for `obsolete():: -
obsolete()`.  The other conditions can be detected on a case-by-case basis
later if we need them.

Reviewed By: quark-zju

Differential Revision: D14566784

fbshipit-source-id: 60b8443ad4c0c82d8250d8e9a10e73fae770daa8
2019-03-27 04:49:12 -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
Mark Thomas
3b41f2f54c mutation: detect landed commits using synthetic mutation records
Summary:
Add support for detecting landed commits.

Since we don't currently have an index for successor information in the
changelog, we can only detect the successor relationship for predecessors of
draft commits (for which we build a cache).  As a temporary workaround,
make it possible to put mutation records in the mutation store that lead to
landed commits.  These will allow land detection to work until we have a
changelog that supports indexing on predecessor.

Reviewed By: quark-zju

Differential Revision: D12980780

fbshipit-source-id: d7b14fa073d0406990b92731fe66dfe1c73b404c
2019-03-08 03:05:57 -08:00
Mark Thomas
2e67ee0c44 templatekw: add mutations template keyword
Summary:
The `mutations` template keyword expands to a list of the results of mutating
the commit.  Each element of the list has an `operation` field, which is a
string describing the mutation operation, and a `successors` field, which is a
list of the successor commits for this operation.  Sequences of mutations that
result in a single successor are collapsed into a single `rewrite` operation.

Reviewed By: quark-zju

Differential Revision: D12980787

fbshipit-source-id: 82be2f9131832209cc3ab088f587c45f8c45a9ad
2019-03-08 03:05:57 -08:00
Mark Thomas
b059c3a3bf mutation: implement successorssets and foreground
Summary:
Implement successorssets and foreground in terms of mutation records and
replace them when mutation metadata usage is enabled.

Reviewed By: quark-zju

Differential Revision: D10149263

fbshipit-source-id: bbf6d1fc44a9787660147e15936a9ee1951373ca
2019-03-08 03:05:56 -08:00
Mark Thomas
892986d685 mutation: use mutation information for revsets
Summary:
When enabled, use mutation metadata for the `obsolete`, `extinct`, `orphan`,
`phasedivergent` and `contentdivergent` revsets.

Reviewed By: quark-zju

Differential Revision: D10149265

fbshipit-source-id: 5559fa22a6025e1d341538f3eb2257d8efee15e5
2019-03-08 03:05:56 -08:00
Mark Thomas
641d1f8d75 drawdag: add fold and revive support
Reviewed By: quark-zju, ikostia

Differential Revision: D10149264

fbshipit-source-id: 42291bbfe41980764b5fa0a62a9cfc60523a2c50
2018-12-13 10:47:28 -08:00
Mark Thomas
1d3d4047e1 mutation: add drawdag support
Summary:
Update drawdag to generate mutation metadata in commits when mutation recording
is enabled.

In order for this to work, we need to add the mutation relationships as edges
between the commits, so that when walking the DAG the predecessors are already
committed and we can find their hashes.

Reviewed By: ikostia

Differential Revision: D9989024

fbshipit-source-id: 671c1eb6c4ae6e87760efb4d3aa47e5e0585c94d
2018-12-13 10:47:28 -08:00
Mark Thomas
26ee99ef66 mutation: add histedit support
Summary:
Add support for mutation information being added when commits are histedited.

For the most part, the histedit predecessor and successor have a 1:1
relationship.  The special case is for when commits are folded or rolled up.
In this case we act in the same way as a fold.

Reviewed By: quark-zju

Differential Revision: D9975466

fbshipit-source-id: 748040232f49aa87af4e25a97d948995d956f04a
2018-12-13 10:47:28 -08:00
Mark Thomas
4c62f2092c mutation: add split support
Summary:
Add support for mutation information being added when a commit is split.

The top of the final stack is the commit that stores the mutation metadata.
The other commits in the stack are just normal new commits, although the final
commit does record their hashes in its metadata.

Determining when the last commit in the stack happens before it is committed is
a little hard, as the code previously relied on the dirstate ending up clean
to detect a finished split.  Instead we look at the patches that come out of
the filter function and see if they match the original patches that were sent
in.

Reviewed By: DurhamG, ikostia

Differential Revision: D9975469

fbshipit-source-id: acec485f9b561952f4ccdbaaf9491c9d48a70f58
2018-12-13 10:47:28 -08:00
Mark Thomas
ff72745779 mutation: add metaedit and fold support
Summary:
Add support for mutation information being added when a commit is metaedited or
folded.

The folded commit uses the top of the original stack as its predecessor.  The
other commits that are folded are also stored in the metadata.

Reviewed By: DurhamG, quark-zju, ikostia

Differential Revision: D9975471

fbshipit-source-id: 92089d14cd5d65df283bbdc80a8b352b5f3982e9
2018-12-13 10:47:27 -08:00
Mark Thomas
da8491a8bc mutation: add rebase support
Summary: Add support for mutation information being added when a commit is rebased.

Reviewed By: DurhamG, quark-zju, ikostia

Differential Revision: D9975481

fbshipit-source-id: 02a1ace0d6c80d73b1ab76e4d1b23a8d46ab049b
2018-12-13 10:47:27 -08:00
Mark Thomas
c4c48ecac7 mutation: add amend support
Summary: Add support for mutation information being added when a commit is amended.

Reviewed By: DurhamG, ikostia

Differential Revision: D9975472

fbshipit-source-id: 57d51823e709f71a88ad0fb86992a0a38541527c
2018-12-13 10:47:27 -08:00