Summary:
`test-patchbomb.t` uses named branches and does not look simple to fix.
We don't use email patches internally, and it's not hard to write scripts
around `hg export`. Therefore drop the extension and its tests.
Reviewed By: singhsrb
Differential Revision: D13978577
fbshipit-source-id: 19867ae68c19c996bfce064eb2234705939db9ea
Summary:
In some cases we are mounting ntfs in a linux host using ntfs.3g and we
want to prevent it from writing symlinks that can't be read from Windows.
Some background, ntfs.3g supports symlinks, but it produces IntxLNK which cause
problems when mounted into a real Windows machine. We don't support symlinks on
Windows anyway, so we want to just disable this. Unfortunately it's difficult to
detect if we're on a ntfs.3g fuse mount, so instead we're just going to have the
machine set up the repo with this extension enabled.
Differential Revision: D13964546
fbshipit-source-id: 7545538e51be4c986a50161165d7cc2e64280555
Summary:
D13853115 adds `edenscm/` to `sys.path` and code still uses `import mercurial`.
That has nasty problems if both `import mercurial` and
`import edenscm.mercurial` are used, because Python would think `mercurial.foo`
and `edenscm.mercurial.foo` are different modules so code like
`try: ... except mercurial.error.Foo: ...`, or `isinstance(x, mercurial.foo.Bar)`
would fail to handle the `edenscm.mercurial` version. There are also some
module-level states (ex. `extensions._extensions`) that would cause trouble if
they have multiple versions in a single process.
Change imports to use the `edenscm` so ideally the `mercurial` is no longer
imported at all. Add checks in extensions.py to catch unexpected extensions
importing modules from the old (wrong) locations when running tests.
Reviewed By: phillco
Differential Revision: D13868981
fbshipit-source-id: f4e2513766957fd81d85407994f7521a08e4de48
Summary:
In our linux deployments it was relatively straightforward
to import the mercurial runtime from a python process running the
system python executable. Our macOS deployments are a lot more
complex because they do not use the system python and do not install
the mercurial python packages in the python path of the target
python executable.
It is simpler to move the import helper functional into a mercurial
command that we can invoke instead of our own helper program.
This diff moves the script to be a debug command and adjusts its
argument parsing to match the mercurial dispatcher requirements.
There are some stylistic mismatches between this code and the
rest of mercurial; I'm suggesting that we ignore those as the
medium term solution is that this command is replaced by eden
directly consuming the rust config parsing code and by native
rust code to perform the data fetching that we need.
Reviewed By: pkaush
Differential Revision: D13522225
fbshipit-source-id: 28d751c5de4228491924df4df88ab382cfbf146a
Summary: Add a new command to debug-dump mutation information in commits
Reviewed By: DurhamG, quark-zju
Differential Revision: D9975474
fbshipit-source-id: a9ed1578dffc80da3e375837cede8d8685ee0427
Summary:
The extension was mainly for users `pip install <3rd-party-hg-ext>`, which
usually installs them into `hgext3rd`. Since we no longer search into
`hgext3rd`, this extension can be removed.
Reviewed By: DurhamG
Differential Revision: D13440401
fbshipit-source-id: d67a655ece9a1f6d5feb18d8aeac84852edfdcb9
Summary:
This allows us to expose `arc pull`'s functionality directly from hg.
There are three parts:
- Create a revset that runs a program, reads the stdout and looks up that commit if it exists
- Auto-pulling if the commit doesn't exist
- Supporting an optional argument (target) that's passed to the script
Reviewed By: DurhamG
Differential Revision: D10524541
fbshipit-source-id: 7493c5592e272f9e8a87f109cec1426d44935ecc
Summary: Updated the global help summaries that are displayed for each command when you run 'hg help' and fixed corresponding tests
Reviewed By: markbt, kulshrax
Differential Revision: D12832280
fbshipit-source-id: 950dad1c805feab573d7d0182da523ae12299d3b
Summary:
tweakdefaults renamed core hg's `grep` to `histgrep`, and added a `hg grep` that behaves more like `git grep`, searching the working copy. This diff folds those changes into core.
The config changes from
```
[tweakdefaults]
allowfullrepohistgrep = False
```
to
```
[histgrep]
allowfullrepogrep = False
```
Reviewed By: quark-zju
Differential Revision: D10435279
fbshipit-source-id: ad3d1da5824511a612111715e46119d70066050f
Summary:
Remove extensions that are not used in prodution. These extensions are also
unlikely to be used in the future.
Reviewed By: ikostia
Differential Revision: D10473370
fbshipit-source-id: a936e30acd3ec4370434c583447942c6ee8d9b13
Summary:
Reorganise the top-level help commands to more useful categories, allowing them
to be listed in a custom order.
Reviewed By: phillco
Differential Revision: D10423184
fbshipit-source-id: 17f02ae201493397a448d108e781eca28a7b1d44
Summary: After D10407265 this is no longer needed.
Reviewed By: quark-zju
Differential Revision: D10407826
fbshipit-source-id: 5291981637d940a6d19cda1b814b81b745d9ca92
Summary: Make a few help messages clearer.
Reviewed By: phillco
Differential Revision: D10356915
fbshipit-source-id: 277d4cecbd17b647d6dd01209ff6f93a926d37d4
Summary:
Replace the default help for Mercurial with a curated list of interesting
commands, categorized by their use case.
Reviewed By: phillco
Differential Revision: D10356916
fbshipit-source-id: 65e578a4bfde7b0ad04e7107f4e77d8ea882d78a
Summary:
This extension exposes only the `record` command which can be easily
moved to core. This commit achieves the same.
Reviewed By: ikostia
Differential Revision: D10360759
fbshipit-source-id: 25f0c46aa3fa9b19ab8ba03a6b4e8598bc003c7a
Summary:
The extension only offers one command i.e. `show` which can move into
core.
Reviewed By: ikostia
Differential Revision: D10302192
fbshipit-source-id: 9473ec8c80e52506e1b7de62b2c90a51c29419c1
Summary:
The functionality we care about is provided by the `fbshow` extension.
Therefore, lets replace the `show` extension with the `fbshow` extension.
Reviewed By: ikostia
Differential Revision: D10302193
fbshipit-source-id: e6d137f52427d5e6f124714d06b5b55ef0db7c3c
Summary:
The bug:
This happens because `repo['']` resolves to a `wctx`. This might be undesirable
in its own right, but before we fix that, we can work it around here.
Reviewed By: singhsrb
Differential Revision: D10261261
fbshipit-source-id: 8cb0e96762ffba24030f9e6bae8b0d0c108e3938
Summary:
The functionality we care about is provided by the `fbamend`
extension. Therefore, lets replace the `amend` extension with the `fbamend`
extension.
Reviewed By: farnz
Differential Revision: D10320739
fbshipit-source-id: 5700d39f488777fcc4033f60ce0a51cda15ef2ad
Summary:
The logic we care about has been moved to core so we can delete the
`inhibit` extension.
Reviewed By: markbt
Differential Revision: D10276448
fbshipit-source-id: 44cabe5d561344cf8f196127ce52491e4654b598
Summary:
Parts of the treedirstate implementation were left in the extension. Since
treestate is now in core, and the two are intertwined, treedirstate should be
in core, too.
In doing so:
- Change the garbage collection behaviour to match that of treestate.
- Use the treestate config options for configuring repacking and garbage
collection.
- Make more of the code common.
Reviewed By: quark-zju
Differential Revision: D10258265
fbshipit-source-id: 89e82bc7662a3d1251fa9886751897cfc46cd66a
Summary:
The age extension provides a couple of revsets relating to commit ages. Move
these to core.
Differential Revision: D10239000
fbshipit-source-id: 6ebf3aa263b72e4bbbe25bd516f77b17145e6e7f
Summary:
These are no longer necessary. Callers should use the sharedvfs to access the
shared repo's .hg directory.
Reviewed By: quark-zju
Differential Revision: D9699163
fbshipit-source-id: 9b9cd584d721c174a7eab06f6abcedc3a943233b
Summary:
When entering the critical section (creating a transaction), hgsql might wait
for SQL lock for a long time (minutes). And it currently does nothing during
that wait time. If the lock was acquired after a long time, the work of
catching up with what the database already has might be too much. That is a
waste within the precious hgsql lock held critical section.
Instead of waiting for the lock for N seconds and doing nothing, wait for k
(k < N) seconds and also try to sync with SQL periodically. This makes the
repo closer to what the database has and can reduce work needed to pull from
the database in the critical section.
This adds CPU pressure to the MySQL tier. I added a config option to control
it. Worse case, we can change `hgsql.syncinterval` to make the sync less
frequent.
As we're here, try document the configs.
Reviewed By: phillco
Differential Revision: D10002578
fbshipit-source-id: bd72d8225c919aa2bc62743de1e1d3f27cba606a
Summary:
Recently there are a trend of questions about repo being locked. People usually
don't have enough debugging skills to find out what's going on. So let's add a
debug command to help them.
The implementation uses `osqueryi`, which perfectly solves the cross-platform
process handling headache. Note the well-known `psutil` Python library does not
seem to provide parent process information on Windows.
The `_rapply` function was backported from upstream mercurial.
Reviewed By: markbt
Differential Revision: D9443601
fbshipit-source-id: d26b3adfde1045ebd5bca1c6b1c93f0db147f9b0
Summary:
mq is already somehow problematic at D8907646. Without bandwidth supporting
it, let's remove it.
Alternative to mq would be rebase, shelve, unshelve, histedit.
Maintain "--config extensions.mq=" compatibility by marking it builtin so hg4idea
won't break by this change.
Reviewed By: phillco
Differential Revision: D9039741
fbshipit-source-id: a3a1e48a2a982ff8e8b6a6ce659c906a4e2b2b36
Summary:
It's similar to acl and notify - not used and can be done using hooks
externally.
Note the bugzilla extension actually works with the Rust config parser,
unlike acl and notify.
Reviewed By: DurhamG
Differential Revision: D8953126
fbshipit-source-id: 43b12666e4d9c03f800395613eed06783aac48b3
Summary:
Similar to the acl extension, notify is not used here and can be implemented
as hooks.
The direct motivation is, it uses weird key in config names that get rejected
by the Rust config parser:
```
hg: parse error: ".../.hgrc":
--> 61:4
|
61 | */a#branch(test) = will_no_be_send@example.com
| ^---
|
= expected equal_sign
```
Although the pest syntax can be updated to support this case, by using
different `name`s for sections, and config names. It seems cleaner to
just drop notify, as it's the only trouble maker.
Reviewed By: DurhamG
Differential Revision: D8953127
fbshipit-source-id: fc7760a32b6ea538cb207c860aadac7b4b58027f
Summary:
It's rarely used here and feels like a burdern to continue support.
It only restricts write access. A well-designed commit hook API should be the
superior solution here.
The direct motivation of the removal is becuase it does not work well with the
Rust config parser. Namely it's the unique extension that treats an empty
section differently from an section that isn't set. That does not play well
with the Rust config parser. While it can be worked around like D8887670, it's
not a very clean soution, and there are other issues making test-acl.t fail.
Therefore, instead of trying to find the remaining weirdness of acl, I figured
it's probably the right call to drop it and redirect users to hooks instead.
Reviewed By: DurhamG
Differential Revision: D8953125
fbshipit-source-id: 209f04423ccdf182b0ba4021b59d26525173d73c
Summary:
With the `globalrevs` extension enabled, Mercurial starts adding a
strictly increasing revision number to each commit which is accessible through
the `globalrev` template.
Reviewed By: DurhamG
Differential Revision: D8364387
fbshipit-source-id: 84bd43f56b9cb1c775cffb875501dd64d10ffa42
Summary:
Similar to chg. Add flags to run tests with watchman. This is mostly moving
features from `fsmonitor-run-tests.py`. The blacklist is converted to
`#require no-fsmonitor`.
Reviewed By: phillco
Differential Revision: D8434518
fbshipit-source-id: a8512cd71c1171e9037f36dbef195f1e6210f27e
Summary:
Previously, there are 2 configs: `treedirstate.useinnewrepos` and
`format.usetreestate`. They are both related to dirstate format and conflict
with each other. This patch unifies them into a single config
`format.dirstate`.
As we're here, merge `test-fb-hgext-treedirstate-x.t` to `test-dirstate-x.t`
if they were previously copied from `test-dirstate-x.t`
Reviewed By: markbt
Differential Revision: D8393878
fbshipit-source-id: 57abeea22ce732d93205e4d4308923afa90693f4
Summary:
Add a config option `format.usetreestate`, which would turn on the new
treestate for new repos.
Treestate does not need manually maintaining "copymap", "otherparentset",
"nonnormalset". The one single tree is the source of truth of everything.
So some code like `copymap.pop` etc. are disabled on treestate path.
Reviewed By: markbt
Differential Revision: D7909175
fbshipit-source-id: 96a405fccd4099cefc152ec17204cb5407efbe7e
Summary:
Split the infinitepush backups code into a separate module.
The infinitepush extension is responsible for providing scratch pushes, as well
as the server-side implementation for storing scratch bundles.
The infinitepushbackup extension uses this feature to provide automatic backup
support. It is an alternative to the commitcloud extension, and the two will
be mutually exclusive.
Reviewed By: DurhamG
Differential Revision: D8204418
fbshipit-source-id: 9279c426da35d451a5e7b39a72f2c91d364e3fd4
Summary: The recent reformat caused a few test failures, this should fix them.
Differential Revision: D8207359
fbshipit-source-id: ced37aff3038715e5876fe27b58a60ebe45e4097
Summary:
Add a new debug command to check whether any of the provided files
casecollide with any file in a revision's manifest.
Reviewed By: quark-zju
Differential Revision: D8165659
fbshipit-source-id: 9315ff052c9996888202961d168d20b834c22834
Summary:
This splits out the logic in the `fsmonitor` extension that is responsible for
publishing `hg.filemerge` and `hg.update` state changes to Watchman into
its own extension, `hgevents`. This is because we want the behavior of
`hgevents` when Hg is running in Eden, but we do not want the remaining
behavior of `fsmonitor` when Hg is running in Eden, so splitting the logic
into separate extensions is the most straightforward way to achieve that.
To achieve the split, we move some more logic that is common to both
`fsmonitor` and `hgevents` out of `hgext/fsmonitor/__init__.py` and into
`hgext/extlib/watchmanclient/__init__.py`. Then we move these lines
out of `extsetup()` in `fsmonitor` to create `extsetup()` in `hgevents`:
```
extensions.wrapfunction(merge, 'update', wrapupdate)
extensions.wrapfunction(filemerge, '_xmerge', _xmerge)
```
We also have to pull all of the transitive dependencies for this logic
into `hgevents`.
Finally, we also have to define a `reposetup()` function in `hgevents`
that does a subset of what `reposetup()` does in `fsmonitor`. Specifically,
it ensures that a Watchman client is created for a `repo`, as appropriate,
so that it can be used to dispatch state changes to Watchman in
`state_filemerge` and `state_update`.
Note that the utility functions `createclientforrepo()` and
`getclientforrepo()` have been added to ensure that only one
Watchman client is created (and shared) when both `fsmonitor`
and `hgevents` are enabled.
Today, when an Hg repo is created in Eden, we set `extensions.fsmonitor=!`
in the `.hg/hgrc`:
diffusion/FBS/browse/master/fbcode/eden/hooks/hg/post-clone.py$69
Therefore, to get existing repos (both Eden and non-Eden) to pick up
the `hgevents` extension automatically, we add it to the list of
`[extensions]` in `common.rc`:
diffusion/FBS/browse/master/fbcode/scm/hg/fb/staticfiles/etc/mercurial/repo-specific/common.rc$53-60
as this is where `fsmonitor` is configured. We do not enable it in
`scm/hg/fb/staticfiles/etc/mercurial/facebook.rc` because
there is no reason to enable `hgevents` on Hg servers. Therefore, we
also decline to add `hgevents` to the set of `DEFAULT_EXTENSIONS` in
`scm/hg/mercurial/extensions.py`.
Reviewed By: quark-zju
Differential Revision: D8003628
fbshipit-source-id: 4f23881f8c25f4638f5475c292537b0352ae8d15
Summary:
Add generalised support for subcommands. This is similar to the monkey-patched
version in `fbsparse`, but fully supported by the command infrastructure.
Subcommands are the same structure as normal commands, but are attached to a
table in the `subcommands` attribute of the main command. Normally, if no
subcommand is provided, the normal command function is called. This can be
made into an error by setting `subonly` on the top-level command.
In order to make `fbsparse` continue to work, I've temporarily hacked how it
handles help text. This will be fixed in a later diff that switches fbsparse
to use this infrastructure.
Reviewed By: mjpieters
Differential Revision: D7849476
fbshipit-source-id: b988edabb17da77bf91a278e0faa2feecd0c1db9
Summary:
This would make tests run on treedirstate.
To avoid issues with Eden pulling from a non-eden treedirstate repo,
treedirstate is changed to be "always on" and disables itself on an eden repo.
The extension list is changed to a set for efficient `__contains__` test.
Reviewed By: phillco
Differential Revision: D7769804
fbshipit-source-id: d328fe51ef67c4730cfc53f43bdfc48c2765c541
Summary:
This allows people to silence hints as they like. It's done by modifying
user hgrc.
Reviewed By: markbt
Differential Revision: D7392133
fbshipit-source-id: 1365294217db92dfb3a0c81332a9fefd164795d4
Summary: This script can be used to generate a large number of commits.
Reviewed By: DurhamG
Differential Revision: D7363243
fbshipit-source-id: 1a1e3ba7fca29dc695446eeffb715474ea2943ad