Summary:
This removes a warning:
scm3/edenscm/mercurial/thirdparty/selectors2.py:39: DeprecationWarning: Using
or importing the ABCs from 'collections' instead of from 'collections.abc' is
deprecated since Python 3.3, and in 3.9 it will stop working
Reviewed By: markbt
Differential Revision: D19581179
fbshipit-source-id: d311b4df4cdb35527c8ab9d4a41ae306ddb2ab03
Summary:
D18213028 made amend and metaedit use a transaction around the
dirstate. This appears to have broken some auto-restack flows (T61073763). Let's
back it out for now then I'll debug later.
Reviewed By: quark-zju
Differential Revision: D19581912
fbshipit-source-id: cce32efdc91be9ca301da26a0e26b50aa6aa92d4
Summary:
In Python 3 this causes problems trying to mix bytes with str. This does not
appear to be used anywhere, so delete it.
Reviewed By: farnz
Differential Revision: D19591564
fbshipit-source-id: 42b8720e440e8e7c901b325aecb1343d5b79b7cc
Summary:
These call sites are hit during initialization. They all appear to be
small-ish dictionaries so the performance hit of having this iteration be
non-lazy in Python 2 should not matter much.
Reviewed By: farnz
Differential Revision: D19591565
fbshipit-source-id: 324844d64ba63f6e379aab270e453d44a02063e9
Summary:
Our plan for switching to Python 3 is to update many types to use Unicode
strings when appropriate. In particular, we should just go ahead and use
Unicode for environment variables, since this is the Python 3's default
behavior.
This drops the check-code.py check that warns developers against using
`os.environ` directly, and converts several call sites to use `os.environ`
directly instead of using `encoding.environ`
Reviewed By: markbt
Differential Revision: D19591566
fbshipit-source-id: e4ac44dcd5f19cd0bf65ac904fc85edad95a9aed
Summary:
We won't need it as we're going straight to dual-compatible code instead of
transforming it.
Reviewed By: quark-zju
Differential Revision: D19588132
fbshipit-source-id: 100f19b3e29874de9e8d48692c42cb2d5856bf5a
Summary:
Disallowing instabilities is a feature of evolution. For mutation tracking
there is no problem with instabilities.
Reviewed By: quark-zju
Differential Revision: D19502221
fbshipit-source-id: c21a5021bf1a8b29abb6635928da50895e2cec33
Summary:
Rebase with `--collapse` should behave like `fold` and set all the rebased
commits as predecessors of the new commit.
Reviewed By: quark-zju
Differential Revision: D19502223
fbshipit-source-id: a903ee5647bb4ee947a6cc68d8ca791fe0f1299d
Summary:
When cloning a repo, ensure the store requirements and visibleheads files are
included in the clone.
Reviewed By: quark-zju
Differential Revision: D19502224
fbshipit-source-id: e3ead586fb1fe10def02d55e33810643c0c78bc8
Summary:
`hg clone` can hardlink store files if the repos are on the same device. This
means we need to write out the legacy files using an atomic temp file, so that
the hardlink is broken. This also makes sure anyone watching the file sees the
change atomically.
Reviewed By: quark-zju
Differential Revision: D19502222
fbshipit-source-id: 3e9fb35846111c9d924de3c6b6861ce5e295e035
Summary:
The visibleheads file should be journaled like the other state files, so that
it is rolled back if a transaction aborts.
Reviewed By: quark-zju
Differential Revision: D19502226
fbshipit-source-id: c2b8d926ce97211411ca01f05e83e62cb77625b9
Summary:
The `incoming` command works by creating a bundlerepo and then updating the
commits as if a pull occurred. This means the visibleheads can get updated,
which was previously assumed impossible.
We can just accept the new set of visibleheads as-is. There may be some
unnecessary heads that are covered by other heads, but since the bundlerepo
is short-lived, this isn't a problem.
Reviewed By: quark-zju
Differential Revision: D19502219
fbshipit-source-id: ce9e98c6a40f96f5305bc7580efb476d5264fc88
Summary: It's possible for the workingctx to be queried for obsolescence. Make sure it is not considered to be obsolete.
Reviewed By: quark-zju
Differential Revision: D19502225
fbshipit-source-id: a1a37afd39a0fc16f95b4eb917372f193ac3fe82
Summary:
The Rust Manifest is deployed practically everywhere.
Removing the C++ code from being compiled in Mercurial along with all of the cstore extension.
Reviewed By: quark-zju
Differential Revision: D19543248
fbshipit-source-id: d632e171175e6866563c1aa0808a099b67bd937d
Summary: Revision numbers are deprecated, let's not print them in the bisect output.
Reviewed By: DurhamG
Differential Revision: D19539678
fbshipit-source-id: 29bca3ee38cb390bdef8dd88cb912aa3dc452065
Summary: Revision number are deprecated, remove it from the user output.
Reviewed By: DurhamG
Differential Revision: D19539679
fbshipit-source-id: 7fc618e832e0e5bb3464d2ed04967b062b6f182a
Summary: The converter has many anonymous tuples being passed around, and it leads to typing error and pain figuring out which field has which data. This diff uses named tuples to implement an important tuple in the code that we use to merge repo history into a single unified history.
Reviewed By: tchebb
Differential Revision: D19377226
fbshipit-source-id: cb7d49227752fd7bc98233f6c0d1b2913cb24b05
Summary:
We don't need to it for the initial phases of the conversion. I've seen cases
were exceptions while importing were also hidden and caused weird behavior down
the line.
Reviewed By: DurhamG
Differential Revision: D19539064
fbshipit-source-id: 7415d88ef8fb69c949ed557ab0df7e6f7b39bf86
Summary:
Previously we had infinitepush path which was preferred over a default path when a
specific revision was pulled or updated to (i.e. "hg pull" would use
paths.default, but "hg pull -r HASH" would use paths.infinitepush if this path
is set in the config).
I'd like to have infinitepushbookmark path which will be preferred for all
cases except for a single commit pulls.
Reviewed By: mitrandir77
Differential Revision: D19513490
fbshipit-source-id: 7f8b809f937aa2e082c2e9cd382709c6db619a4f
Summary:
Reading all the sparse profiles can be very expensive.
This changes the format we log to the cloud. It seems nobody is depending on the old format.
Reviewed By: wlis
Differential Revision: D19517306
fbshipit-source-id: 256e78acd4c24aceb533aa4d66b90ecf885fcbcd
Summary:
D19506964 moved the purge extension into core, however purge is still
mentioned in dispatch.py's list of external modules to preimport. This causes hg
to crash as such:
```
Traceback (most recent call last):
File "/data/users/harveyhunt/fbsource/fbcode/buck-out/dev/gen/eden/scm/__hg__/runtime_resources/__default__/eden/scm/hglib/edenscm/__init__.py", line 61, in run
dispatch.runchgserver()
File "/data/users/harveyhunt/fbsource/fbcode/buck-out/dev/gen/eden/scm/__hg__/runtime_resources/__default__/eden/scm/hglib/edenscm/mercurial/dispatch.py", line 335, in runchgserver
_preimportmodules()
File "/data/users/harveyhunt/fbsource/fbcode/buck-out/dev/gen/eden/scm/__hg__/runtime_resources/__default__/eden/scm/hglib/edenscm/mercurial/dispatch.py", line 320, in _preimportmodules
extensions.preimport(extname)
File "/data/users/harveyhunt/fbsource/fbcode/buck-out/dev/gen/eden/scm/__hg__/runtime_resources/__default__/eden/scm/hglib/edenscm/mercurial/extensions.py", line 180, in preimport
mod = getattr(__import__("edenscm.hgext.%s" % name).hgext, name)
ImportError: No module named purge
```
Remove purge from the extmods list.
Reviewed By: ikostia
Differential Revision: D19514862
fbshipit-source-id: 6e16ff160f0bc842038b1481bf23aab9c608685d
Summary:
getManifestEntry has an inefficient implementation. It can result in
multiple round trips to the Mercurial importer process and under heavy
usage it can clog the Thrift worker thread pool. Moreover, it only
provides data that Mercurial already knows. Instead of calling
getManifestEntry, look in the manifest to see if the entry exists.
Reviewed By: quark-zju
Differential Revision: D19426507
fbshipit-source-id: 67bcd7e0ae62f84b313aa6a7203832fb9a10f315
Summary:
wez silenced the messages in D18796291. I think it's still useful to show why
commits get disappeared after pull. Let's just print a summary by default, and
print less or more things depending on flags:
- `-v`: print what commits are marked as landed, similar to pre-D18796291.
- `-q`: print nothing, hide the summary line.
Reviewed By: DurhamG
Differential Revision: D19437916
fbshipit-source-id: 130c5a24f0978674d363227f44089d307f7aff72
Summary:
In www, Phabricator used to return both landed global rev and hg commit hashes.
Now it only returns global revs. The "mark landed" logic ignores global revs
and does not mark them as landed.
This diff changes it so the graphql client translates global revs automatically
so the "mark landed" logic can still work.
Reviewed By: DurhamG
Differential Revision: D19437915
fbshipit-source-id: 0e074bda9a0ee53c594750b2b1fd214f31dec843
Summary: The function assumes binary nodes. Make it aware of GLOBAL_REVs.
Reviewed By: DurhamG
Differential Revision: D19437914
fbshipit-source-id: aa36b81be2f8e4c38c51667b4cf7048eeb7250da
Summary:
Scanning through the plain git mapfile is slow. Use the nodemap to speed it up.
To avoid unnecessary risks, this only replace the "lookup" feature of the mapfile,
other features used by the hggit extension or wire-protocols are unaffected.
Reviewed By: singhsrb
Differential Revision: D19458406
fbshipit-source-id: 665184637d3e62590cc5d12ea3aa2563af4351d1
Summary:
This unbreaks the watchman/hg integration tests in a more
sustainable and holistic way than the workaround in D19415053.
The issue is that the explicit fsmonitor sockpath configuration option didn't
take into account that the environment needs to take precedence in order for
the appropriate watchman instance to be used by the set of processes in a given
process tree. It is not feasible to have them all pass `--config` options to
mercurial because that would require teaching several layers about the
fsmonitor extension, and then later to update them as we evolve how mercurial
works.
Reviewed By: quark-zju
Differential Revision: D19415252
fbshipit-source-id: 5872d0462e466bfb5d70f809c3c433d92fb78567
Summary: This diff addresses the unreleased mapped pack files in the old datapack code.
Reviewed By: chadaustin
Differential Revision: D19399737
fbshipit-source-id: 86a6254a2939fd69e1ce2b25b8bfcb36b0deb16b
Summary:
There was a typo in the name of the parameter; this commit
makes this code consistent with the upstream pywatchman code.
Reviewed By: fanzeyi
Differential Revision: D19453811
fbshipit-source-id: 033cf30c47ff327913a07e177457a4ac23505bbd
Summary:
This is inteneded to solve multiple problems:
- Mitigate issues where our CI system does not enable remotenames in some
random code paths, which leads to missing or stale `remote/master`.
This further mitigates bad cases with narrow-heads' phase calculation
where a stale `remote/master` can cause many commits to become draft
incorrectly.
- Mitigate issues in `remotenames` where race condition can happen for
pushrebase (remotenames does a "listnames" after the push operation).
See D18601035 for a hacky workaround.
Reviewed By: DurhamG
Differential Revision: D19380940
fbshipit-source-id: 4481ff114d35be37c331c72ac561c2a0894206cb
Summary:
We recently saw a high rate of build failures on MacOS.
They all fail with compiler errors like:
In file included from edenscm/mercurial/cext/osutil.c:1326:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:39:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h:29:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h:43:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/Security.framework/Headers/Security.h:38:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h:28:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h:158:19: error: missing ',' between enumerators
kTLSProtocol12 CF_ENUM_DEPRECATED(10_2, 10_15, 5_0, 13_0) = 8,
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h:158:20: error: redefinition of enumerator '__AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_15'
kTLSProtocol12 CF_ENUM_DEPRECATED(10_2, 10_15, 5_0, 13_0) = 8,
^
It's unclear whether this is a compiler configuration issue, or the Apple SDK
being buggy.
The only user of ApplicationServices is `isgui()` when `$SSH_CONNECTION` is not
set on MacOS.
It seems to me that if we just replace `isgui()` to `True`, very few if nobody
will notice the difference. Therefore let's remove the problematic
ApplicationServices as an attempt to stabilize the build.
FWIW Git does not seem to have any sort of GUI detection. It seems to solely
rely on (static) user configuration.
This reverts part of https://www.mercurial-scm.org/repo/hg/rev/16118b4859a1.
Reviewed By: singhsrb
Differential Revision: D19441351
fbshipit-source-id: f1bfbaf0d015e8d577a83112b5ea0a4be6367156
Summary:
This makes it safer to do revlog-fallback -> server-fallback switch in the
future, because the server might not know all the draft commits.
Reviewed By: DurhamG
Differential Revision: D19416287
fbshipit-source-id: 8d69c1c5465b50710110370d84d5fb7c8ba6a6c4
Summary: The only reason `HgImporter` still holds a pointer to LocalStore is for looking up proxy hashes. We can directly pass in the Mercurial hash and path instead.
Reviewed By: chadaustin
Differential Revision: D19049039
fbshipit-source-id: 45d1e1f363ed73dca447b22e5891495cf9ad202b
Summary:
Right now, we check if extras contain `convert_revision` (and tolerate it not
being there), but if we don't have extras at all, we crash. Let's instead treat
"no extras" and "convert_revision not in extras" as the same thing.
Reviewed By: DurhamG, farnz
Differential Revision: D19428698
fbshipit-source-id: 74268dd3bde0f9cdb1b8164d2c2d322837803eaa
Summary:
There are few cases where we need to prefetch data that is already present in
the local store, but the server holds more up-to-date data. For instance, after
pushing a change to a pushrebase server, the linkrev for the just pushed commit
is no longer valid, and the history data is re-fetched from the server to fix
it.
For now, let's keep the fix for this contained in Python as we will move away
from linkrev altogether in the future, by then, this change will be unecessary
and can be reverted.
I'm overall not a big fan of the hacks needed here, suggestions are welcomed for
a cleaner way to achieve this :)
Reviewed By: DurhamG
Differential Revision: D19412620
fbshipit-source-id: 331f3e4dbb51bcd687149370a62c60c325534f60
Summary:
Previously the mutation commit extras were the source of truth for mutation
information, and the mutation store served as a kind of cache. This turned out
to be less useful than expected, as oftentimes commits are missing, and the
store is better indexed, so in practice using the store as the source of truth
is better.
This change makes the mutationstore the (sole) source of truth for mutation
data. The extras are kept, but they are now only useful as human-readable
debug information, and to ensure the commit hash is unique.
Collecting the mutation information during commit creation is now done through
a new `mutinfo` object. This is a dict with the same keys as the mutation
extras, for simplicity, but it is now passed through the `committablectx` and
used to generate the mutation store entry directly.
The `mutation.enabled` config option is now used to control all aspects of
enabling mutation.
The `mutation.record` config option is now only used to indicate whether the
mutation extras should also added to the commit. Generally this should be set
to `true`, however the option is retained so that mutation extras can be
stripped by running `hg amend --config mutation.record=false`, which no longer
has the side-effect of not recording mutation information to the store.
The "remote commit" mutation record origin is now obsolete, and won't be
generated anymore.
Pushrebase now relies on the obsmarker information coming back from the server
in order to correctly generate mutation information. We will need to change
this so that the server returns mutation records before we can fully deprecate
obsmarkers.
Reviewed By: DurhamG
Differential Revision: D19410650
fbshipit-source-id: 8d7094e4bfd8d8e97916898d899a8debd339485f
Summary: Begin logging the common directory path for the commit's updated files.
Reviewed By: DurhamG
Differential Revision: D19399717
fbshipit-source-id: d47994f573eac6e7cd1596b0b102cb9577e1eea1
Summary: When I was first prototyping the converter, I used a prefix to make it clear which commits represented merged commit history. This commit removes that prefix so the commit messages are an exact match.
Reviewed By: tchebb
Differential Revision: D19404075
fbshipit-source-id: 73b4aab39b30ce1dcff917e40d459f9615896fca
Summary:
The linknode is part of the history, not the data, no need to force prefetch
the blobs.
Reviewed By: quark-zju
Differential Revision: D19394351
fbshipit-source-id: 2e63d82928ebd5cf8e3a0d1b87d115b45d1428a7
Summary:
The error message and the exception type are slightly different between the
Rust and Python ContentStore. For now, let's just fix this up manually.
Reviewed By: quark-zju
Differential Revision: D19394350
fbshipit-source-id: e432094a9dfcf605568a1890c0303b733e98d203
Summary:
This is part of proof-of-concept to test Watchman over TCP, a means
to accelerate hg workflows for the ASIC teams within Facebook.
For more context, refer to master task T55191832
Reviewed By: xavierd
Differential Revision: D18482107
fbshipit-source-id: 08ba3641854d81fe2a1cd8739bb4e9abcbc700ed
Summary: Copied changes from watchman dev area to hg
Reviewed By: wez
Differential Revision: D18574426
fbshipit-source-id: 6c360e42621cef373c5c1d4af34011d80eafc7bf
Summary:
Without this change, the next diff will fail tests with metalog programming
errors (write outside transaction).
Some test changes are caused by the being deprecated `rollback` command.
Reviewed By: DurhamG
Differential Revision: D19380939
fbshipit-source-id: 7c893d3025bb697102835670b8a38f8fb9a624c8
Summary:
Reverts https://www.mercurial-scm.org/repo/hg/rev/eb586ed5d8ce.
The colon syntax (x:y) is deprecated and is unsupported by segmented changelog.
Reviewed By: DurhamG
Differential Revision: D19394101
fbshipit-source-id: 8c66756f1035ab7660180716a2afa052879f384e
Summary:
As part of requiring transactions for the dirstate, let's wrap its use
in gpg.
Reviewed By: quark-zju
Differential Revision: D18213029
fbshipit-source-id: b05afa6d465e8d2a7b1637fa1c1903e1625a7104
Summary:
As part of making the dirstate require transactions, let's wrap
histedits dirstate changes in transactions.
Reviewed By: quark-zju
Differential Revision: D18213045
fbshipit-source-id: 49baf87e8f8abfe500409f0f79a52eeae09f8ada