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
Summary: Otherwise mergedrivers become impossible to debug if they don't import correctly.
Reviewed By: ikostia
Differential Revision: D14071200
fbshipit-source-id: 3e677089e6b008d892158290c392e1f9d68a67ae
Summary:
Since september (D9840431) rcutil.rccomponents is no longer source of truth
about which config files we load. In fact we use it only in the
`hg config --debug`. This leads to situations where the debug command mentions
loading a specific config file and then ignores it completely which is very
confusing.
Let's remove it.
Reviewed By: suitingtseng
Differential Revision: D14083220
fbshipit-source-id: 362fd9bf574e24639f99a1203206184da42d1e24
Summary: Move the edenapi Python bindings into the common `bindings` crate.
Reviewed By: quark-zju
Differential Revision: D13963179
fbshipit-source-id: 76dead82af992615a9e452ee6fbb9f66639c822c
Summary:
Switch from using OpenSSL (via `native-tls`) to [Rustls](https://github.com/ctz/rustls), a pure-Rust TLS implementation based on the `ring` crypto crate.
Unlike `native-tls`, Rustls supports ALPN, which means it can be used along with Hyper to perform HTTP/2 requests over TLS. (OpenSSL also supports ALPN, but older versions of Windows' `schannel` library do not, and as such `native-tls` doesn't support ALPN either regardless of platform.)
Rustls also builds on Windows without any special configuration, sidestepping the issues we've been having with OpenSSL in the Windows build.
Reviewed By: quark-zju
Differential Revision: D14070084
fbshipit-source-id: 25268c58a88177f4708370696d326b4c0bdc89a0
Summary:
Add a new `init` module to the `bindings` crate. This is intended as a place to put global Rust initialization code for Mercurial's Rust extensions. Ordinarily, such code would go at the start of `main()`, but since `hg` doesn't have a Rust main, putting initialization here at least guarantees that it will happen before any of the Rust extension code runs.
Right now, the only thing initialized in the new module is `env_logger`.
Reviewed By: quark-zju
Differential Revision: D14072560
fbshipit-source-id: 0f2770d0a3a6e9c6b7fe68eb62007cc091adad59
Summary: They will be replaced by successors and predecessors.
Reviewed By: singhsrb
Differential Revision: D14000097
fbshipit-source-id: 07f0c97edd7eb16ad665c00886c00212d516ae72
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:
This back ports Yuya's patch from upstream:
changeset: 443029011990c75c533ec0454fd0f5c1060d4690
branch: stable
user: Yuya Nishihara <yuya@tcha.org>
date: Sun, 01 Jul 2018 06:36:53 -0800
encoding: alias cp65001 to utf-8 on Windows
As far as I can tell, cp65001 is the Windows name for UTF-8. I don't know
how different it is from the UTF-8, but Python 3 appears to have introduced
new codec for cp65001, so the alias is enabled only for Python 2.
https://bugs.python.org/issue13216
This patch is untested, but hopefully fixes the following issue.
https://bitbucket.org/tortoisehg/thg/issues/5127/
More context:
Windows 10 Build 17035 (November 2017) introduced a
"Use Unicode UTF-8 for worldwide language support" checkbox, which makes the
"A" flavored APIs use UTF-8 instead of some non-UTF-8 local encoding. With
that checkbox ticked, hg would crash in cmd.exe complaining
"LookupError: unknown encoding: cp65001"
{F150484107}
Reviewed By: phillco
Differential Revision: D14017361
fbshipit-source-id: a648b2a9bc341d796532c6fd2730c083402b3736
Summary:
It would be massy if there are 2 chg servers running: one for fb hg, one for
upstream hg, and they share a same socket path.
Change socket path and the commandserver name so fb-hg chg can only talk to
fb-hg chg servers.
Reviewed By: markbt
Differential Revision: D13869319
fbshipit-source-id: f9d42af9bdfc542207f23c536b478fd5ef8d02a0
Summary:
logexchange was a subset of remotenames, added by:
changeset: 5a62910948d2d4bac5defe305d0ddb22f0fda549 D1547
user: Pulkit Goyal <7895pulkit@gmail.com>
date: Wed, 04 Oct 2017 10:32:02 -0800
summary: remotenames: move function to pull remotenames from the remoterepo to core
Since we use the full remotenames instead, remove logexchange and its test,
which depends on named branch.
Differential Revision: D13954458
fbshipit-source-id: d565c131100ef90f3cf69e9051643ac8e5846f0d
Summary:
`hg status` should show slashes in filepaths standard for the diff format. Now it shows windows' backslash.
More details:
https://fb.workplace.com/groups/scm/permalink/1933867456662865/
Reviewed By: quark-zju
Differential Revision: D13944478
fbshipit-source-id: d34d2c6bc0b9966e1806e36668c21e8abfc83a02
Summary:
On linux, ask /proc/self/mountinfo for the block device information, and then
ask udev for the filesystem type. It works for block devices, and is what
util-linux tools like findmnt, lsblk do.
This detects ntfs-3g mounts of block devices as `fuse.ntfs`.
Reviewed By: DurhamG
Differential Revision: D13982877
fbshipit-source-id: eacea6a949b54d9a6483f2c55c437718eb89c243
Summary:
The constant is not exposed in linux/magic.h, perhaps because fuse is an
optional feature. It's unlikely to be changed. Define it so fuse fstype
can be detected.
Reviewed By: DurhamG
Differential Revision: D13969640
fbshipit-source-id: 5084bdacf193261a187a74546a82995f2dd2d7c6
Summary: In Rust it is typically more idiomatic to have a static method on a struct to produce a builder, since this means the builder doesn't need to be explicitly imported to construct a new instance of the struct.
Reviewed By: DurhamG
Differential Revision: D13925323
fbshipit-source-id: c06d5d42ba941dbbb2c619f9470e79fa23f35f68
Summary: Rename Mononoke API to Eden API, per war room discussion.
Reviewed By: quark-zju
Differential Revision: D13908195
fbshipit-source-id: 94a2fe93f8a89d0c5e9b6a24939cc4760cfaade0
Summary:
The default value is specified in configitems.py. Remove the `default`
argument.
Reviewed By: phillco
Differential Revision: D13909730
fbshipit-source-id: ca45c63be7d48e04e71a6f5b3b682f625a3030f6
Summary:
This reverts the upstream changeset:
changeset: 66ecde8a704d9fa92bd99720923524c4bd3f315b
user: Boris Feld <boris.feld@octobus.net>
date: Wed, 15 Nov 2017 18:52:42 -0800
summary: server: introduce a 'experimental.single-head-per-branch' option
Named branches are going to be removed. Remove experimental dependent feature.
Reviewed By: phillco
Differential Revision: D13909727
fbshipit-source-id: 3baf101e5a038b58bc01506826b631a2a58a7782
Summary:
Lots of places use it to print some thing like "fetched x files in y seconds (1KB/s)".
In tests, these have to be manually replaced to "* (glob)" patterns.
This diff makes test output static without using globs. So `run-tests.py -i` would just fix things.
Reviewed By: phillco
Differential Revision: D13954456
fbshipit-source-id: d139c7c5e268d3bab562c266335d740986780924
Summary:
We're seeing issues where a file show up as "M" while it isn't expected so. When
running "hg status" again, the file disappeared. Existing logs suggest that
watchman does not think anything has changed between the two "status" commands.
Therefore add more logs of the internals to try to get more insights.
Differential Revision: D13954209
fbshipit-source-id: 0b89a6da5e8702e707440ef2e1823eb4968c10be
Summary:
During pushrebase there is code that says 'for each file, do some work
that involves listing the changed files'. Because we reparse the list each time,
this becomes n^2 behavior. Let's cache the list to avoid this.
Reviewed By: singhsrb
Differential Revision: D13944830
fbshipit-source-id: 4fd0dbf26b6cee9d0c01879cafb9837262f7afa0
Summary: Extend the option to disable `incoming` to also disable `outgoing`.
Reviewed By: markbt
Differential Revision: D13877971
fbshipit-source-id: c4f994d536dda5db7c0e9f14656be48fc757c237
Summary: In repositories which change quickly, the incoming and outgoing commands aren't useful. Add an option to disable these commands.
Reviewed By: markbt
Differential Revision: D13859604
fbshipit-source-id: c4784b7eafbe3c4a6cf03686f1431204089b0155
Summary:
Move all Rust bindings to a single python extension, `bindings`. This should
improve compilation time and make things simpler.
Reviewed By: quark-zju
Differential Revision: D13923866
fbshipit-source-id: 560592b5a6c0c4f1b836c755ef123666a1059164
Summary:
We will probably not be supporting secret phase in the future anyway
so lets get rid of it.
Reviewed By: quark-zju
Differential Revision: D13928907
fbshipit-source-id: 7edcd84d2ee3c37124dcf9d3ba92c0610d074157
Summary: Expose `MononokeClient`'s multi-get functionality through the Python bindings using a builder-style API.
Differential Revision: D13893748
fbshipit-source-id: 312e7449eb8300432b1f1de28e0c6fc3e47d1d53
Summary: Give MononokeClient the ability to fetch multiple files concurrently. Right now this functionality is not exposed via the Python bindings, so as far as the Mercurial Python code is concerned, nothing has changed. The multi-get functionality will be used later in the stack.
Differential Revision: D13893575
fbshipit-source-id: c9e514fbeb41bbb37f52f6df3920eb01a66df293
Summary: Add a new `get_file()` method to `MononokeClient` that fetches Mercurial file content from the API server and writes it to a datapack in the cache. This functionality is exposed via the new `hg debuggetfile` debug command, which takes a filenode and file path and fetches the corresponding file.
Differential Revision: D13889829
fbshipit-source-id: 2b68bf114ee72d641de7a1043cca1975e34cf4e6
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:
Follow up to D13853115 to fix test failures:
- Update an `__import__` statement in dispatch.py to use the new
`edenscm.mercurial` package path.
- Make sure the `__version__.py` file is generated at the correct location by
the buck build files.
Reviewed By: quark-zju
Differential Revision: D13858016
fbshipit-source-id: 54ac4a02274cf921397932e9625f422c5f427623
Summary:
Move top-level Python packages `mercurial`, `hgext` and `hgdemandimport` to
a new top-level package `edenscm`. This allows the Python packages provided by
the upstream Mercurial to be installed side-by-side.
To maintain compatibility, `edenscm/` gets added to `sys.path` in
`mercurial/__init__.py`.
Reviewed By: phillco, ikostia
Differential Revision: D13853115
fbshipit-source-id: b296b0673dc54c61ef6a591ebc687057ff53b22e