Commit Graph

808 Commits

Author SHA1 Message Date
Arun Kulshreshtha
fa95cf8c21 hgcommands: rewrite hg debughttp in Rust
Summary: As an example of using EdenAPI in a pure-Rust context, reimplement `hg debughttp` in Rust.

Reviewed By: quark-zju

Differential Revision: D18156042

fbshipit-source-id: 19a4ad10d276b413f87fd41e569e271e3e243449
2019-10-28 11:13:06 -07:00
Mark Thomas
9c0c4b66bd phabstatus: make graphql calls robust to SSLErrors
Summary:
GraphQL calls have been observed to fail with an `SSLError` due to a timeout.
When this happens, the phabstatus extension causes the log command to abort,
rather than handling it gracefully as is done for other error types.

Extend this graceful handling to `ssl.SSLError`.

Reviewed By: fanzeyi

Differential Revision: D18169468

fbshipit-source-id: c10fc19076ecf31eeecbd7da57d63c347b1cb65a
2019-10-28 08:36:29 -07:00
Jun Wu
834edf5811 rage: exclude remotefilefetchlog logs from blackbox
Summary: They are noisy

Reviewed By: sfilipco

Differential Revision: D18140437

fbshipit-source-id: 699925fbfcfcaf2f0abb637dfc47b0be805f9c9a
2019-10-25 13:45:39 -07:00
Jun Wu
194279af4b commitcloud: rewrite helptext to reduce support burden
Summary:
Contacting Source Control @ FB does not scale. Let's provide some commands
that people can try before contacting us.

Reviewed By: markbt

Differential Revision: D18000421

fbshipit-source-id: 1edfb5f22414e38ea2f0a41e5689539284065435
2019-10-25 08:50:54 -07:00
Zeyi (Rice) Fan
714ffea977 phabstatus: add option to disable signal status fetching
Summary: This diff adds a Mercurial option (`ssl.signal_status`) to disable signal fetching in `hg ssl`.

Reviewed By: quark-zju

Differential Revision: D18120435

fbshipit-source-id: 2cf01d83b9c5737f8b116a9c3447f32a0abd5d9a
2019-10-24 15:12:18 -07:00
Xavier Deguillard
2d515eb910 litemmap: remove it
Summary: It is no longer used, no need to keep it around.

Reviewed By: singhsrb

Differential Revision: D18101161

fbshipit-source-id: 92d4b4947d232fddb347257473203ec1f3469335
2019-10-24 09:51:54 -07:00
Saurabh Singh
5bb4418d4a hgsubversion: remove the extension
Summary:
This commit removes the `hgsubversion` extension and associated code
because it should no longer be used.

Reviewed By: quark-zju

Differential Revision: D18088850

fbshipit-source-id: 9da2790c89427c8bbe4e02165f484628718b130c
2019-10-23 12:55:08 -07:00
Durham Goode
f44a5d73cf crdump: add config gate for commitcloud backup
Summary:
This had performance implications. Let's gate it so we can roll it out
more carefully.

Reviewed By: quark-zju

Differential Revision: D18063673

fbshipit-source-id: 7911753f9a91bd9224e59d774fcec59e9007434c
2019-10-22 15:12:22 -07:00
Zeyi (Rice) Fan
3e42ddb869 phabstatus: increase default timeout to 10
Summary: Increase default for `ssl.timeout` from 5 to 10 seconds.

Reviewed By: quark-zju

Differential Revision: D18056114

fbshipit-source-id: 77b7204e2b2ede48731a0d15ed31f57ee117dc69
2019-10-22 11:05:14 -07:00
Michael Devine
0f7ff848c2 Convert repo source: Fix getchanges() and some cleanup
Summary: We've had a known problem with importing merge commits in the currently landed version of the repo converter source. The problem is that the specification of the source interface is misleading (or perhaps just wrong). We've updated the function to generate changes against all of the parents, not just the first one, and that seems to have fixed our ability to show the head commit of branches.

Reviewed By: tchebb

Differential Revision: D17964281

fbshipit-source-id: 90ae5df7dabaf133612c44d2a41b37200bcdb15f
2019-10-21 12:12:28 -07:00
Jun Wu
e925225f16 tweakdefaults: remove op-aware wrapping
Summary:
The operation-aware feature is in core. It does not need extra wrapper.

This change was made because the following code will break by function
wrappers:

    origargs = inspect.getargspec(origcmd)
    try:
        repo_index = origargs.args.index("repo")
        ...

Reviewed By: ikostia

Differential Revision: D17972044

fbshipit-source-id: 863fd2bb37c677d4c7de8955538da551084eeb14
2019-10-18 14:50:26 -07:00
Jun Wu
e1808b45e6 rage: try to make "sl (unfiltered)" section shorter
Summary:
The "sl (unfiltered)" section can be very long. To make it less noisy, let's
only show commits that are predecessors of the current visible draft. This
removes commits that are landed (and became hidden), and is more friendly
in the narrow-heads=true world.

Reviewed By: singhsrb

Differential Revision: D18000596

fbshipit-source-id: e7ed773fee10c5dc26b810356dd3d25e61da522b
2019-10-18 07:52:27 -07:00
Jun Wu
6a80791e72 rage: remove noise from "local config" section
Summary:
`/default.d/` configs were moved to hard-coded `<builtin>` config string in
D15307750. Change logic in `rage` so we don't list `<builtin>` configs as
"local config".

Reviewed By: singhsrb

Differential Revision: D18000595

fbshipit-source-id: b3ff0bce6dbb3fae442dc07d7453fa63bc624f7b
2019-10-18 07:52:26 -07:00
Jun Wu
18008a9576 rage: remove fsmonitor state section
Summary:
The fsmonitor state section does not work with treestate or edenfs. Replace it
with `debugtree` and `debugstatus` that works with treestate.

Reviewed By: singhsrb

Differential Revision: D18000597

fbshipit-source-id: 4a4e7434f9d340bd3b44f9a8d19b66ed7b6fa3a6
2019-10-18 07:52:26 -07:00
Xavier Deguillard
7014e34633 amend: fix unamend with no predecessors
Summary:
When mutation is enabled, and no precessors exists, the predecessors can be
None, leading to hg crashing due to:
  TypeError: object of type 'NoneType' has no len()

Reported by sas: P118684245

Reviewed By: quark-zju

Differential Revision: D17960775

fbshipit-source-id: 05488dbc52edbc32c323612ea86fe9e94076a126
2019-10-17 09:02:42 -07:00
Xavier Deguillard
2cd333f0f7 remotefilelog: remove low-level getancestors
Summary:
The getancestors is handled by the metadatastore via the getnodeinfo method,
thus the lower level stores don't need to implement it.

Reviewed By: quark-zju

Differential Revision: D17946853

fbshipit-source-id: b516fdad15c96882f1898eb2e94b6ddff353d2bf
2019-10-17 08:57:36 -07:00
Xavier Deguillard
b5b835c87c remotefilelog: use getnodeinfo in getancestors
Summary:
The store.getancestors is really just a wrapper over getnodeinfo, let's just
use getnodeinfo instead, which would allow us to remove the getancestors from
all the store code.

Reviewed By: quark-zju

Differential Revision: D17946854

fbshipit-source-id: 4cf6b607464f42d573a5911e3975bdd388592c75
2019-10-17 08:57:35 -07:00
Jun Wu
65fad5e812 rebase: do not crash rebasing -s secret-commit
Summary: Replace the assertion to an actionable error message.

Reviewed By: sfilipco

Differential Revision: D17932927

fbshipit-source-id: e9522a02be9901a9451f1505df6a19d8e35298a6
2019-10-16 18:22:09 -07:00
Durham Goode
376162f3d3 filesystem: move lookup yielding to a batched location
Summary:
In a future diff we'll move lookup resolution into the filesystem
later. To do so, we need to refactor the lookup reporting logic to batch all
lookup reporting into a single place so that later we can insert remotefilelog
prefetches for those files.

This diff moves lookup detection to put them in a list before yielding them. The
next diff will resolve them instead of yielding lookup.

Reviewed By: quark-zju

Differential Revision: D17749375

fbshipit-source-id: 93f383031600525f137039dc955b5e46346754c5
2019-10-16 17:40:13 -07:00
Xavier Deguillard
66213fa0f2 remotefilelog: remove python repack
Summary:
With loosefiles being gone, we no longer need to repack loosefiles, let's get
rid of the code.

Reviewed By: quark-zju

Differential Revision: D17923874

fbshipit-source-id: 9bc3390d448df4576e4567447a00446d1d1ff717
2019-10-16 14:21:58 -07:00
Xavier Deguillard
5840de16ef remotefilelog: remove format.noloosefile
Summary: This is now dead code.

Reviewed By: quark-zju

Differential Revision: D17923872

fbshipit-source-id: 9a65d13d43f0caa7b25516a7de3bcd7d558dda92
2019-10-16 14:21:57 -07:00
Xavier Deguillard
5132ddaa2c remotefilelog: remove remotefilelog.fetchpacks from the code
Summary:
All the repos, and all the tests have this config enabled, we have no plans of
turning it on again, let's kill it.

Reviewed By: quark-zju

Differential Revision: D17923873

fbshipit-source-id: fb5b16ede63918d9e89dc437dfb5cc3e5aa778bd
2019-10-16 14:21:57 -07:00
Xavier Deguillard
4cdbc8d9f8 remotefilelog: enable format.noloosefile by default
Summary: Loosefiles are dead, no need to test them anymore.

Reviewed By: quark-zju

Differential Revision: D17919277

fbshipit-source-id: 83386f49711d34e42a82b61ff2bb206a4f5afb12
2019-10-16 14:21:57 -07:00
Xavier Deguillard
3ad04bbd86 remotefilelog: make fetchpacks the default
Summary:
This has been enabled for a while now. We won't be going back to using
loosefiles, so let's make fetchpacks the default in the code. A future step
will remove the code paths that are no longer exercised.

Reviewed By: quark-zju

Differential Revision: D17919275

fbshipit-source-id: 0614f5710b630690de92cdb43ec07d3a2888aa1e
2019-10-16 14:21:57 -07:00
Xavier Deguillard
7869cc7b17 remotefilelog: remove hg gc
Summary:
The `hg gc` tries to cleanup old loosefiles from the hgcache, since loosefiles
are no longer being generated, there is no need to keep the code around. The
command is kept around to inform users.

Reviewed By: quark-zju

Differential Revision: D17919276

fbshipit-source-id: bd0adc628fda0f72dacb432c859ef827511e7a69
2019-10-16 14:21:56 -07:00
Durham Goode
5d5d6c679d fsmonitor: don't return generator for pendingchanges
Summary:
Because fsmonitor needs to be able to fallback, we need to consume the
entire pendingchanges list upfront so we can detect a fallback case. Previously
we just returned a generator and would never fallback, which resulted in an
exception for the user.

Reviewed By: quark-zju

Differential Revision: D17961313

fbshipit-source-id: ca11a074631b59e9226936d33f2176894203c29b
2019-10-16 14:16:29 -07:00
Xavier Deguillard
8ed08b321f rebase: remove rev number from rebase output
Summary:
Revision numbers are deprecated, let's not print them in the rebase output.

The tests were automatically fixed with run-tests.py -i

Reviewed By: quark-zju

Differential Revision: D17936451

fbshipit-source-id: a8f0403b6af4573421ca874e9311f26931eba697
2019-10-15 16:29:51 -07:00
Durham Goode
69bf56c75d crdump: fix index error
Summary:
The previous diff that added branch metadata tried to use [0] on a set,
which doesn't work. This fixes it.

Reviewed By: xavierd

Differential Revision: D17913449

fbshipit-source-id: d26a101fb21edf8440b7f6e7f5c355a018df36fc
2019-10-14 14:03:12 -07:00
Durham Goode
639fdd2509 crdump: silence stdout from commitcloud backup
Summary:
The diff that added commitcloud backup to crdump didn't take into
account that backups print to stdout, which interferes with parsing the json
from crdump. Let's silence it.

Reviewed By: singhsrb

Differential Revision: D17910359

fbshipit-source-id: 7ed3de8d9c2f9a8a2706f5e9783860fd2cfa2b67
2019-10-14 11:04:38 -07:00
Jun Wu
182ec6ae49 directaccess: disable itself if narrow-heads is enabled
Summary:
If narrow-heads is enabled, commits can all be accessed directly without
using the "directaccess" extension. So let's disable it in that case.

Reviewed By: sfilipco

Differential Revision: D17888725

fbshipit-source-id: 0e316ab86fd5f4eaeb674854619f685058d11ded
2019-10-11 16:55:24 -07:00
Jun Wu
c65364ff95 remotenames: restore "remotenames" on transaction abort
Summary:
Register `remotenames` as "files to backup" so they got restored by the
transaction framework on transaction abort.

Reviewed By: xavierd

Differential Revision: D17888017

fbshipit-source-id: 81e923a250ef8fd95d76d57961ff535d18a81d50
2019-10-11 15:25:37 -07:00
Jun Wu
c0ebd84d24 remotenames: put expull in a transaction
Summary:
This makes sure post-transaction hooks get a consistent view of the repo
(instead of updated changelog, but lagging remtoenames).

Reviewed By: xavierd

Differential Revision: D17888015

fbshipit-source-id: b318b7d26fc8c2b2c85364135ee6a101d47a2778
2019-10-11 15:25:37 -07:00
Jun Wu
5f4b6264c1 remotenames: invalidate revsets after updating remotenames
Summary:
With narrow-heads enabled, remotenames decide public phases. So updating
remotenames should invalide the phase cache.

Reviewed By: xavierd

Differential Revision: D17888016

fbshipit-source-id: 01c2210bf0022c6ad139a4c4453d9920ef5cbb83
2019-10-11 15:25:37 -07:00
Jun Wu
85fcc7aff3 amend: define aliases for amend
Reviewed By: xavierd

Differential Revision: D17871306

fbshipit-source-id: 72816cdcf6c07e14da66289fb0b9d6369e4f1db3
2019-10-10 19:18:11 -07:00
Stefan Filip
b8ee984807 manifest: add caching for trees in treemanifestlog
Summary:
Manifestlog is the object that is often passed around in mercurial as the proxy
to manfiests. Commits that need to check various information on manifests will
will recreate trees for every file that goes into the commit. This is a lot of
churn. Caching the manfiests in the manfiestlog is an easy fix right now.

This codepath was hitting the Rust manifest code path more than the C++ code
path because Rust will eagerly parse entries. Among parsing the highest cost
is to convert the hex Node to a binary Node - an operation that would not
be performed by C++.

Reviewed By: xavierd

Differential Revision: D17859964

fbshipit-source-id: 44341c1cd4e9b70d80d864065f234cb906a8d76b
2019-10-10 16:47:01 -07:00
Aleksei Kulikov
d6c110ebf7 snapshot: support redirection of hg checkout for snapshots
Summary:
When checking out on a snapshot, we want to make sure that:
1) it gets downloaded with the infinitepush's wrapper;
2) it checks out using the snapshot extension command.

Also changes `--force` flag for `snapshot checkout` cmd to `--clean` for better compliance.

Reviewed By: mitrandir77

Differential Revision: D17762185

fbshipit-source-id: 4cc3b829cba5f6ea9a33daed0367b34225a77dbf
2019-10-10 05:06:37 -07:00
Arun Kulshreshtha
49b379acdc remotefilelog: perform EdenAPI FFI calls in a new thread
Summary:
The Python interpreter is unable to respond to signals during FFI calls. This means that if there is a long-running FFI call (such as an HTTP tree prefetch via EdenAPI), the user will not be able to interrupt the process with Ctrl-C, leading to frustrating user experience.

To allow the interpreter to handle signals during FFI, let's wrap all EdenAPI FFI calls with a decorator that simply runs the operation in a separate Python thread and then busy-waits for the duration of the call (to avoid blocking in an uninterruptible way).

Reviewed By: quark-zju

Differential Revision: D17844316

fbshipit-source-id: baa4f489567105cfccdc314644ac1ae9e1c82a08
2019-10-09 19:12:17 -07:00
Aleksei Kulikov
8f5f268c00 snapshot: extract common logic into getsnapshotctx method
Reviewed By: mitrandir77

Differential Revision: D17830502

fbshipit-source-id: bd426bd10a4d252ca1b7bdc5afe946194b4ff11c
2019-10-09 11:11:04 -07:00
Aleksei Kulikov
cd16041cb0 snapshot: properly delete the untracked files
Summary: Use the new `filesystem.purge` method.

Reviewed By: mitrandir77

Differential Revision: D17830420

fbshipit-source-id: 43b340b8c54b5f50db0f2aa0ba318b7cfa00b405
2019-10-09 11:11:04 -07:00
Aleksei Kulikov
61d1f746ea snapshot: remove unnecessary todos
Reviewed By: mitrandir77

Differential Revision: D17829891

fbshipit-source-id: 8ff98858183bfdeb04c3f82af4f02916d40a44a1
2019-10-09 11:11:04 -07:00
Aleksei Kulikov
711d2c0082 snapshot: bugfix: fix missing attribute during rebundle behavior
Summary:
There might be cases when `bundlerepo` doesn't have a `_snapshotbundlestore`.
Let's check that directly.

Reviewed By: mitrandir77

Differential Revision: D17793227

fbshipit-source-id: c2312fcf9c3d4de5af2c6e487e594d6338989fbf
2019-10-09 11:11:04 -07:00
Aleksei Kulikov
880b3618e9 snapshot: show snapshot special state in changeset_templater too
Reviewed By: mitrandir77

Differential Revision: D17792870

fbshipit-source-id: 25caa6f886397167cbc80ab07f13c8a55847abf1
2019-10-09 11:11:03 -07:00
Jun Wu
a091d7352b dispatch: remove command prefix matching
Summary:
Remove command name prefix matching to make things much easier.

This breaks command completion.

Reviewed By: sfilipco

Differential Revision: D17644675

fbshipit-source-id: c8a866bf0649c4644c8e5630acdceb459a22deb4
2019-10-09 11:08:18 -07:00
Durham Goode
43d7a832fb crdump: add branch to debugcrdump
Summary:
There are situations where it's useful for Phabricator to know what
branch a commit was created on. For instance, it may allow Phabricator to
suggest which branch to land a commit too.

Let's add the downstream branch to the crdump output, so jf can report it to
Phabricator.

Caveat: In Mercurial it's impossible to know for certain which remote bookmark a
local commit was made against. The best we can do is a heuristic.  The heuristic
is as follows:

1. For a given commit, find the first public ancestor.
2. For that ancestor commit, find all descendant commits that have remote
bookmarks.
3. If the descendant remote bookmarks contain "master", return that.
4. If the descendant remote bookmarks contain just one bookmark, return that.
5. Otherwise, return an empty string.

Reviewed By: mitrandir77

Differential Revision: D17814487

fbshipit-source-id: 1e37f57e18af55d4085fba27111b642a406c81af
2019-10-09 10:52:38 -07:00
Thomas Orozco
1147c48791 clienttelemetry: log peer name to blackbox
Summary:
This updates clienttelemetry to log the peer name to the hg blackbox (on every
connection). This might make it easier to understand which host a given hg is
connecting to even if we can't get to its logs (e.g. in our external sync
processes, we are capturing output to match it for errors, so it's not trivial
to get the remote hostname even with clienttelemetry.announceremotehostname.

It's possible to retrieve the peer name with e.g.: ` hg blackbox --pattern '{"clienttelemetry": "_"}'`

Reviewed By: ikostia

Differential Revision: D17808834

fbshipit-source-id: 5c8afca6bd8b3bbbf14ec8d8efb3f9b1f6b25986
2019-10-09 06:19:44 -07:00
Durham Goode
cc3ea5bf66 fsmonitor: convert fsmonitor to use new filesystem abstraction
Summary:
The new filesystem abstraction hides the complexity of fsmonitor behind
a single "pendingchanges" call, which only takes a matcher and a boolean for
listing ignore files. This diff refactors the fsmonitor logic to work with this
new API instead of the old walk api.

Reviewed By: quark-zju

Differential Revision: D17142419

fbshipit-source-id: d068ec684668df4fe3ff07a95fc3134ddc5cb4dc
2019-10-08 16:45:09 -07:00
Durham Goode
a0ec26e501 purge: move purge into filesystem layer
Summary:
Eden wants to be able to perform the purge itself, so Mercurial doesn't
have to walk over the whole tree and so it can do it in bulk. Let's start by
refactoring purge to be implemented within the filesystem layer, and moving the
current implementation down.

Reviewed By: quark-zju

Differential Revision: D17142418

fbshipit-source-id: 13b2dc892756ab79c12b62071930264dc99ee511
2019-10-08 16:45:08 -07:00
Durham Goode
cd744f29f6 commitcloud: add commitcloud status to debugcrdump
Summary:
We eventually want to depend on all commits being uploaded to commit
cloud, instead of passing bundles to other services. To start this process,
let's make hg debugcrdump (which is used by jf submit) force the upload of the
given commits.

This required a minor refactor the backup.backup to make it more usable by logic
other than the backup command. I applied the same pattern to sync as well,
though it wasn't strictly necessary.

In a future diff we'll add logging to track how many jf submits send commits
that are not uploaded to commit cloud.

Reviewed By: mitrandir77

Differential Revision: D17721168

fbshipit-source-id: d191cfe3356a9bb2956a33921e13d317f7ed4ee5
2019-10-08 16:10:55 -07:00
Jun Wu
c2f9d6c20a hiddenoverride: disable itself if visibility is enabled
Summary:
`hiddenoverride` was a hack to override visibility.  So if visibility is
tracked explicitly, there is no need to enable hiddenoverride.

This breaks the visibility upgrade feature, but we have shipped visibility for
a long time.

Reviewed By: sfilipco

Differential Revision: D17812491

fbshipit-source-id: 58d70165be9265de1beb9600ae5ec72f6db22e6a
2019-10-08 16:05:11 -07:00
Jun Wu
5307cbf7ab cmdutil: remove i18n for afterresolvedstates
Summary:
Commands like `hg rebase --continue` shouldn't be translated, because if the
user does type the translated command, their shell is unlikely to execute it
correctly.

Reviewed By: kulshrax

Differential Revision: D17768761

fbshipit-source-id: 4b995382db12397424ef4391e4515bd7933818dd
2019-10-08 14:20:55 -07:00