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
Summary:
Add a method of tracking explicit visible heads. Rather than using the
implicit set of commits that are not obsoleted (which may differ between repos
that are connected to a single commit cloud workspace), we instead track commit
visibility explicitly.
This is more like the git model, where only commits that are reachable from
refs are considered for most operations, except that we keep track of the heads
automatically, and use obsmarkers to keep track of the obsoleted commits,
rather than garbage collecting them.
Reviewed By: DurhamG
Differential Revision: D9560361
fbshipit-source-id: 07dabfc04415f2ecb97d57c4e3944c071579ee50
Summary:
Disable the various templates that attempt to determine the fate of a
particular commit based on obsmakers when mutation is enabled. The old
templates were either insufficiently generic (e.g. `amendsuccessors`), or
leaked internal implementation (e.g. `succsandmarkers`).
With mutation enabled, callers should use the `mutations` template to get a
list of a commit's mutations.
Reviewed By: DurhamG
Differential Revision: D12980772
fbshipit-source-id: 920d47f7c61ad52f562cd90f1cb405250c14bc25
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
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
Summary:
Include mutation records for all predecessors of the pushed commits in
infinitepush bundles.
When received from infinitepush, store these additional records in the local
store. This allows us to bridge any gaps in mutation that are omitted from the
local commits when they are received from infinitepush.
Reviewed By: DurhamG, quark-zju
Differential Revision: D12980777
fbshipit-source-id: b1535ca29c0fca3e6cb0f563d78c4c60d4aef58e
Summary:
The debugmutation command should also show information about mutation entries
in the mutation store.
Reviewed By: DurhamG, quark-zju
Differential Revision: D12980785
fbshipit-source-id: 06c3ec2cb9c42edf43729ba3b7c471b1bf8dfb96
Summary:
When traversing mutation entries, if we don't have any information for a
commit, then look instead in the store to see if we have a cached entry
from a non-local commit there.
There aren't any ways of putting entries there, yet. Those will come in
later commits.
Reviewed By: DurhamG
Differential Revision: D12980776
fbshipit-source-id: 63ff12382eb9294aa43ff100a4fe19b7c05f9e61
Summary:
We will be making looking up entries for complex by adding a secondary store of
the information. Make accesses to this information common through lookup
functions.
Reviewed By: quark-zju
Differential Revision: D13279986
fbshipit-source-id: a30084b548762e69cb354c3760d7ec66027a24e1
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
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
Summary:
Add a mutationcache to the repo. This computes the following information:
* The successor sets for all predecessors of visible commits - these are the
sets of immediate successors for each commit.
* A map from commits which are the results of splits to the final split commit.
* The set of public commits that have visible draft successors.
* The set of draft commits that have multiple sets of visible eventual successors.
* The set of obsolete commits - draft commits with visible eventual successors.
* The set of orphan commits - commits with obsolete ancestors.
* The set of extinct commits - obsolete commits with no orphaned descendants.
These sets will be used later on to replace the obsmarker-based equivalents.
Reviewed By: DurhamG
Differential Revision: D13279988
fbshipit-source-id: 3f063bb68aaba2f19da257efdf79b485b947b7b1
Summary:
Original commit changeset: af43d4cce555
D14338313 didn't trigger the main `.t` tests. A lot of things actually
depend on `zstd` APIs returning `bytes`. Therefore back out the change.
Reviewed By: DurhamG
Differential Revision: D14372351
fbshipit-source-id: d8daa7d1d2a49d9d0c4d48de22ed0567d1d953a7
Summary:
Make them zero-copy to reduce overhead. A side effect is the types become
`bytearray`, instead of `bytes`. It seems fine for zstd use-case.
Reviewed By: ikostia
Differential Revision: D14338313
fbshipit-source-id: af43d4cce5559fe877373737a71e1e1678a17ca7
Summary:
If an executable filenode was reused from p2 and mode hasn't been
changed (i.e. a filenode was executable and it is still an executable after a
merge) and and p1 didn't have this file at all then file will still be listed as
changed just because manifest1.flags(fname) returns ''.
After this diff if a filenode is reused then file will be listed as changed
only if it's a parent from where this filenode was reused have different flags.
So if filenode was reused from p1/p2 and p1/p2 has same flags and new
filenode, then file is not listed. But if filenode was reused from p1 and p1
has different flags, then filenode won't be reused.
It's possible that both new filenode is equal to both p1 and p2. In that case
we'll compare only with p1's mode.
Note that it's only get triggered during pushrebase, because during local
commits `fctx.filenode()` is None
Reviewed By: DurhamG
Differential Revision: D14300214
fbshipit-source-id: 1bf6c4802cfce5db6654da673333a56389432617
Summary: Allow file data/history packs to be fetched via HTTP when the Eden API is enabled.
Reviewed By: quark-zju
Differential Revision: D14257368
fbshipit-source-id: 8b6823a57a6fdef546a596df20387b3fc1ccdd4a
Summary: This diff adds a new `hg debuggethistory` command that takes filenode/path pairs from stdin, fetches the history of the files from the API server, and writes the results to a historypack in the hg cache.
Reviewed By: quark-zju
Differential Revision: D14248082
fbshipit-source-id: 8014a758abd3a578ea213d8d3177812629b2fd51
Summary: The Eden API client in Mercurial should be a singleton. This diff assigns the client to `repo.edenapi` so that it is accessible throughout the code.
Reviewed By: quark-zju
Differential Revision: D14233314
fbshipit-source-id: 8e0ed22c32611e8f6e7d4461c3e31870d47a0e95
Summary:
When using the `debugedenimporthelper` subcommand that is part of `hg` itself
it is much more important to make sure that we don't try to use `stdout` as
the import communication mechanism.
The old `hg_import_helper.py` script more carefully set up its own `UI` object
to try and avoid ever printing any messages to `stdout`. However it isn't
easily possible to do this as part of the normal `hg` program. Therefore
abort the command if `hg debugedenimporthelper` is ever run without an
`--out-fd` argument.
This also helps avoid potentially confusing users by printing binary data to
stdout if they invoke accidentally `hg debugedenimporthelper` interactively in
a terminal.
Reviewed By: chadaustin
Differential Revision: D14222372
fbshipit-source-id: 7e0829dff41b2bca28c7f4539b90c6c354f8c79f
Summary:
This starts to fix some of the `hg debugedenimporthelper` behavior and make it
work more like most other hg subcommands with respect to how it finds the hg
repository.
Previously the code was copied into hg largely as-is from an external script
that took the repository path as a separate argument. This resulted in
confusing behavior as it completely ignored the normal repository object
opened by `hg`.
This makes `debugedenimporthelper` honor the normal hg repo object if the
extra repository path argument is not specified.
Reviewed By: chadaustin
Differential Revision: D14222323
fbshipit-source-id: 57048178b588dd1dd7150184665d6c13427d6b56
Summary:
Fix lint errors involving unused imports and variables. In some cases we are
relying on the side effect of importing, so tag these with the appropriate
noqa flag.
Reviewed By: ikostia
Differential Revision: D14241398
fbshipit-source-id: b639af47c563f914a54188af48f1f9100442d08f
Summary:
`push --new-branch` is very rarely used and it does not make much sense with
checkheads removed (D14179861). Remove it everywhere.
There is still [one user](https://fburl.com/t5hmcxrp) of the
`push --new-branch` flag. Do not remove it just yet.
Reviewed By: singhsrb
Differential Revision: D14212180
fbshipit-source-id: 18f80576ab6464fc36b047a8a35b339231ee9d8e
Summary:
Move the strip extension to core. Rename the command to `hg debugstrip` as it
is not intended for use by users. Users should use `hg hide` instead.
Reviewed By: quark-zju
Differential Revision: D14185822
fbshipit-source-id: ef096488cb94b72a7bb79f5bf153c064e0555b34
Summary:
They're no longer used. Drop them. The `branchcache` is still somehow used,
although it's basically equvilent to `{"default": heads}`.
We can probably clean it up further after detached from subversion.
Reviewed By: singhsrb
Differential Revision: D14180592
fbshipit-source-id: 45230d486f203bf3f55e89ce9eb89e6855e14e54
Summary: It's a no-op already. Drop it.
Reviewed By: singhsrb
Differential Revision: D14180595
fbshipit-source-id: 9f904b818bcf56b9d12405ca9894baa9c786801b
Summary:
All commits belong to `default` branch. Therefore `branch(x)` can be seen as
just `all()`, assuming `x` is a valid name.
This removes the only user of `repo.revbranchcache`.
In a later step, branch related features will be moved to an extension so the
code becomes separate and features are optional.
Reviewed By: sfilipco
Differential Revision: D14180594
fbshipit-source-id: 9dc52743f1b69a1838114c8c0de5fc69383dc41e
Summary:
This hardcodes several perftweaks configs that have been enabled for major FB
repos for months:
[perftweaks]
disablebranchcache = True
disablebranchcache2 = True
disableresolvingbranches = True
disableupdatebranchcacheoncommit = True
Practically, this means the branchmap is now just `{'default': heads}`. (i.e.
there are no named branches other than `default`), and branchcache is removed
(i.e. `.hg/cache` does not exist without clindex or in-repo tags).
This diff only makes easy-to-verify logic changes by assuming the configs and
removing dead code. Things can be further cleaned up. They will be done by
upcoming changes.
Most test changes are due to the fact that `.hg/cache` is no longer created.
Reviewed By: singhsrb
Differential Revision: D14179858
fbshipit-source-id: 479f7427168eb1d9614a973e273a229e50f5620a
Summary:
The CVS branch support will break with the upcoming branchcache removal.
CVS repos are rare. Let's just remove the code.
Differential Revision: D14179863
fbshipit-source-id: 890ce34958d2efe4f2ef02b1d72cf92f6269378c
Summary:
We had `ui.checkheads=false` set for a long time. Let's remove the feature
entirely and update the tests.
This is necessary before killing the branch cache, as some tests still use
different branches and there would be suddently more "heads" that cause
test issues.
Reviewed By: sfilipco
Differential Revision: D14179861
fbshipit-source-id: 0de76566799a9560b45e823cc5f49cfda9e3dd30
Summary:
Context: in pushrebase replay job we run on Mononoke we also want to test our
hooks i.e. replay pushrebase requests that were denied on mercurial because of
a hook failure. The problem is that at the moment the only error message we have
is `prepushrebase.driver hook failed` (see xdb table `xdb.mononoke_production`,
query `select * from pushrebaserecording where pushrebase_errmsg like '%hook%'
limit 10;`). This error message tells us nothing, not even what hook failed.
To change it I suggest to make it possible for python hooks to raise HookAbort
and provide more information in the `hook_failure_reason` field.
Reviewed By: quark-zju
Differential Revision: D14131359
fbshipit-source-id: 69a2b51b30c78efadf3ba0d3332f46a777022568
Summary:
Alias documentation can now include multiple lines, however for the output
of `hg help commands`, only the first line should be used.
Reviewed By: quark-zju
Differential Revision: D14149607
fbshipit-source-id: 84992078c9bc4659532350b47694c562f4dc1983
Summary:
Remove:
- log --only-branch
- pull --branch
- push --branch
- record --close-branch
- incoming --branch
- outgoing --branch
Currently, `log --branch` is kept since some arcanist code still uses it.
We can probably remove it after the next arcanist release.
Differential Revision: D14116320
fbshipit-source-id: 50960ae8700200b322f615c4defd9c05353c2435
Summary:
CommandError happens if there is an unknown command flag, or a required
argument is missing. The old behavior is to print an error message to
stderr, then start the pager with the command help printed to stdout.
There are 2 problems with that approach:
1. When using mosh, a long help text might flush the actual error to out of the
screen. The error message will be missed.
2. When captured in shell scripts, the help text printed to stdout would be
captured, which is almost always undesirable.
The actual motivation of this change is for 2. Zsh themes like bullet-train [1]
uses `hg id -b 2>/dev/null` and we'd like to remove `id -b` support. After that,
the command should not polluate stdout with help text.
[1]: bd88ade263/bullet-train.zsh-theme (L102)
Differential Revision: D14151200
fbshipit-source-id: edd38e91115f96929438379aa2e40edfba560b41
Summary:
It's possible that the non-mergedriver code path decides to create ("get") a
file, because it only exists in one side of the merge parents, while
mergedriver decides to remove that file. That makes the file exist in both
"g" (get, aka. create) and "r" (remove) lists and result in incorrect
dirstate state.
Fix it by detecting the case and remove the conflicted files from the "g" list.
Reviewed By: DurhamG
Differential Revision: D14145990
fbshipit-source-id: f4e5d9787dca5cda6cae270f8a84296ecddf553c
Summary: Add the current clock value to the output of `hg debugstatus`
Reviewed By: quark-zju
Differential Revision: D14150641
fbshipit-source-id: 917ac3095bc933c042c0f057d0dbda38ef710844
Summary:
This is a perf optimization. `unbundlereplay.respondlightly` instructs the
server to not produce the pushback parts regardless of what `replycaps` part
of the incoming bundle says. This is important, since the mononoke-hg sync will
send all the bundles in a searialized way, so we want to optimize time where
possible.
Reviewed By: StanislavGlebik
Differential Revision: D14131575
fbshipit-source-id: afec15347d43fa52b1ec64b4ac8ece5b227ccf7d
Summary:
Add a `pager.stderr` config option that when set to false, disables the
redirection of stderr to the pager.
This means progress bars will be rendered, and other information will appear
synchronously, rather than buffered by the pager, but also that Mercurial will
start outputting stderr over the top of any output that the pager produces,
potentially corrupting the pager display.
Reviewed By: simpkins
Differential Revision: D14130965
fbshipit-source-id: eba8e31fdad05c935eae13e1900c5f7e5af7ecbc
Summary:
This is to be used from Mononoke->hg sync.
Currently expects only `pushrebase` bundles, e.g. one head and one book to
move.
Reviewed By: StanislavGlebik
Differential Revision: D14116130
fbshipit-source-id: 959a6e51f51e21da5592c84188e294a33057ffaa
Summary:
In order to move the types in `edenapi-types` (containing types shared between Mercurial and Mononoke) to the `types` crate, we need to move a few types from the `revisionstore` crate into this crate first, because `revisionstore` depends on `types`, which would create a circular dependency since `edenapi-types` uses types from `revisionstore`.
In particular, this diff moves the `Key` and `NodeInfo` types into their own modules in the `types` crate.
Reviewed By: quark-zju
Differential Revision: D14114166
fbshipit-source-id: 8f9e78d610425faec9dc89ecc9e450651d24177a
Summary:
There are still users of "hg id -b", namely shell prompt scripts.
However, it seems fine to remove "branch" from the formatted (JSON or other
formats) output.
Reviewed By: ikostia
Differential Revision: D14076296
fbshipit-source-id: a77f4b9e73161d322da3f1bdec993082ac463939
Summary: Without named branch, it is not meaningful to close a branch.
Differential Revision: D14076295
fbshipit-source-id: 527ae457cb14f9415fa7269b7dc123252e7d6867
Summary:
Unfortunately, there are still users of the "hg branch" command so we cannot
remove it right now. But I'm updating internal tools to not call it.
Reviewed By: ikostia
Differential Revision: D14076300
fbshipit-source-id: a5322d9c9ce8148c6ad0800653bd829736556386
Summary:
It seems nobody uses it from dev_commands logging. Search for "allowbranches"
in all internal repos suggests nobody turned it on. The tests were also
migrated to not use the command so let's just remove it.
Reviewed By: ikostia
Differential Revision: D14076298
fbshipit-source-id: a1cb03b2da289c01b15f0580ffe77531941be213
Summary: This would make the test runner run tests with named branch disabled.
Reviewed By: phillco
Differential Revision: D14059835
fbshipit-source-id: 9fbad5688bd8c69d32016b2ec1f931102638da68
Summary:
"st_size" returned by watchman is sometimes 0. We suspect it's incorrect.
It could be the file on disk is actually empty, or the kernel made it
look empty to watchman in the past, or there is something wrong with
serialization, etc. Let's first add a real os.stat to test if the file
is really empty.
Reviewed By: phillco
Differential Revision: D14090851
fbshipit-source-id: bd75cf86bfd117285658ad0dd7fb28d0e8b5585c