Commit Graph

1077 Commits

Author SHA1 Message Date
Durham Goode
5ad8e5d836 py3: fix Windows tests
Summary:
Windows tests were failing to execute hg clone ssh://user@dummy/... lines because setconfig ui.ssh=C:/foo/bar was being translated to ui.ssh=c;c:\\foo\\bar by mingw, since it detected /foo/bar as a unix-style path. This seems to be caused by this one line reversing the slashes. I'm not sure why it exists, but deleting it makes the tests pass.

My guess is this has been broken for about a year.

Reviewed By: quark-zju

Differential Revision: D26639206

fbshipit-source-id: d89cae1ea3dd055b90ec6ee8f7cdbee2ae08b228
2021-02-25 09:59:55 -08:00
generatedunixname89002005287564
dafcfcd0bf Daily arc lint --take BLACK
Reviewed By: zertosh

Differential Revision: D26660579

fbshipit-source-id: 2a6f2ff37e6509a59f4927ad5dfa2a84f3d4dc15
2021-02-25 04:29:50 -08:00
Mark Juggurnauth-Thomas
03301d0d96 templates: add case expressions
Summary:
Add case expressions to the templating language that allow selection of a value based on
a single determinator.  The expression `case(expr, case1, then1, case2, then2, else)`
will expand to `then1` if `expr` matches `case1`, etc.  If it matches none of the cases
then it expands to `else`.

This can be used to simplify long `ifeq` chains in templates.

Reviewed By: quark-zju

Differential Revision: D26631539

fbshipit-source-id: 7543e6f7baa5599c96cac75da17db73e03b918f9
2021-02-25 02:56:17 -08:00
Stanislau Hlebik
ed2669e33f phrevset: allow specifying multiple callsigns
Reviewed By: DurhamG

Differential Revision: D26604669

fbshipit-source-id: 1bd0fa2b4715fd2de19658265ebf8a4bd960b21a
2021-02-24 00:46:01 -08:00
Jun Wu
62ba7447f6 ui: switch to Rust IO for default fout, ferr
Summary:
The Rust IO handles progress and streampager stuff. Switch to it so we don't
need to changing the `fout`, `ferr` when handling streampager in Python.

The chgserver logic is updated to just set raw fd 0, 1, 2 to update stdio,
since `fileno` is no longer exposed from Rust.

Manually tested the following commands, both without chg and with chg:
- lhg log -r . (no pager)
- lhg log (with streampager)
- lhg log --config pager.pager=less (with less pager)
- lhg commit (spawns pager)
- lhg debugprogress -s 100 --sleep 100 --with-output --pager=off (progress in stderr)
- lhg debugprogress -s 100 --sleep 100 --with-output --pager=on --config pager.interface=fullscreen (progress in streampager)
- lhg debugprogress -s 100 --sleep 100 --with-output --pager=on --config pager.pager='LESS= less' (progress is disabled with external pager)

Reviewed By: sfilipco

Differential Revision: D26612487

fbshipit-source-id: 8b4e36b614a0c080b93e41474f9a8fc33f890083
2021-02-23 22:33:48 -08:00
Jun Wu
a6e3b948c9 chgserver: replace the raw stdio fds (0, 1, 2) directly
Summary:
Previously those fds were obtained via `fp.fileno()`. We're going to replace
the `fp` with something backed by Rust that does not have `fileno()`. Update
chg to replace the raw fds (0, 1, 2) directly. This is enough to affect both
Python and Rust's stdio so there is no need to replace `ui.fout`, `ui.ferr`
again.

Reviewed By: sfilipco

Differential Revision: D26612484

fbshipit-source-id: 5cd89e5955a1dcaad3d3132730354ee67c016bf0
2021-02-23 22:33:48 -08:00
Genevieve Helsel
f2d6906665 fix dictionary changed size during iteration in run_tests.py
Summary:
We shouldn't delete from a dictionary while iterating over it, instead we should iterate over a copy and then delete from the original.
`.keys()` returns a view of the dict, while wrapping it in `list` makes a deep copy.

Reviewed By: StanislavGlebik

Differential Revision: D26618782

fbshipit-source-id: 234503aab0a0a2151ae0818282651b547f414016
2021-02-23 16:55:07 -08:00
Mark Juggurnauth-Thomas
0ef99947cc color: add combined effects in fallback chains
Summary:
Allow color effects to be joined with `+`, e.g. `blue+bold`.  Unlike effects
separated by spaces, these effects must all be available in order for the
effect to apply.  If any of the effects are not available, then the combined
effect is not valid.

This is useful in fallback chains, where some of the fallbacks are combined
effects, for example: `brightred:red+bold`.

Use these to improve the fallback chains for sparse profiles, so that the
profile names are not shown in black on 8 color terminals.

Reviewed By: quark-zju

Differential Revision: D26580365

fbshipit-source-id: 8e204c901566ac03fb4af066ab1a09142750a9fb
2021-02-23 04:47:01 -08:00
Johan Schuijt-Li
2c0b490179 fix tests
Summary: D26543635 (1536917be2) changed the output for some tests, update accordingly

Reviewed By: singhsrb

Differential Revision: D26580674

fbshipit-source-id: dc8062cf614268a71440f6e2fe3556339d168601
2021-02-22 14:16:14 -08:00
Liubov Dmitrieva
1ed10dd9c6 cleanup code
Summary: This code has been used to transfer an existing repo to remotenames. After D26460435 (84280e36c3) it doesn't work as designed and should be removed as well.

Reviewed By: quark-zju

Differential Revision: D26544739

fbshipit-source-id: 34c08d4b9997c0b1f298ee1ecd0e8af24f4d8a39
2021-02-22 06:15:48 -08:00
Liubov Dmitrieva
b2f442982b hide: support for scratch remote bookmarks
Summary:
Support for unsubscribing from a scratch remote bookmarks in `hg hide` command.

This is support if you hide via a revision. Hiding by its name will be another change.

Reviewed By: quark-zju

Differential Revision: D26544305

fbshipit-source-id: d10372513dda88903e2cc031ff16883a001c8e34
2021-02-22 06:15:47 -08:00
Mark Juggurnauth-Thomas
2b8d5ab75d undo: expand heuristics for uncommit/unamend hint
Summary:
The `commit` or `amend` command might not have been the first item in the
command list (e.g. there could have been a custom config option).  Expand the
heuristics for detecting the `commit` and `amend` cases to account for this.

Reviewed By: quark-zju

Differential Revision: D26545339

fbshipit-source-id: a5b1fc8ccc87989e742fce1fa79273266892ed79
2021-02-22 02:46:53 -08:00
Andrey Chursin
987e6426fc checkout: print removed cwd warning in nativecheckout
Summary:
This warning was printed by old checkout, keeping it in nativecheckout too
The warning tells user that current working directory was removed during checkout

This diff also makes test-update-names.t to use nativecheckout. Otherwise last test fails on remote repo, because pyworker does not emit the deleted cwd warning

Reviewed By: quark-zju

Differential Revision: D26558188

fbshipit-source-id: 1f6ea2ea1ac7358ce2f06fed25069656481b30e6
2021-02-20 01:29:11 -08:00
Andrey Chursin
d8e40c89a0 tests: test-update-names.t to use remoterepo
Summary: After this update, test-update-names.t tests are using native checkout when congfig is set

Reviewed By: quark-zju

Differential Revision: D26558186

fbshipit-source-id: f70f65344b5f2209f313e3edd5fd7f541318459a
2021-02-20 01:29:10 -08:00
Andrey Chursin
78f7bab434 tests: add newremoterepoto tinit.sh
Summary: Those shortcuts can be used to setup remote repo via single line

Reviewed By: quark-zju

Differential Revision: D26558187

fbshipit-source-id: c6fd48ed38cc4dbaad4db714c4dfd76ec26bf608
2021-02-20 01:29:10 -08:00
Liubov Dmitrieva
84280e36c3 remove accessed bookmarks feature
Summary:
Remove selectivepullaccessedbookmarks feature because it contains bugs and causes many undesired issues.

This was added to migrate existing repos to selective pull and is not needed anymore.

Main effects are:

* if you enable selectivepull for an existing repo, it won't reduce number of subscribed bookmarks.
* some operations like `hg push` or `hg pull -r` in their underlying implementation update all subscribed bookmarks, not just accessed like before.
This drives changes to the tests. Reminder, the bookmark has been marked as "accessed" if the repo has been ever updated to that bookmark.

All tests fixed accordingly.

Reviewed By: markbt

Differential Revision: D26460435

fbshipit-source-id: f839b9f207bfc478a0336ec807b720d35a0bb12e
2021-02-18 04:02:06 -08:00
Durham Goode
4b2ec1b3cc tests: fix test on osx
Summary:
Sort works differently on OSX. Let's set the locale in this case to get
consistent sorting across platforms.

Reviewed By: quark-zju

Differential Revision: D26438678

fbshipit-source-id: 80a5c758795fd9675b8b2b658521c0e9d6807366
2021-02-16 10:09:04 -08:00
Durham Goode
7ab09f1e5f tests: fix broken test
Summary:
The push-pull test was broken by my recent change to make indexedlog
the default. It wasn't caught because the test is disabled in Python 3. It now
passes with Python 3 so let's enable it.

The repack-remove fix is just some flakiness I've seen lately.

Reviewed By: singhsrb

Differential Revision: D26412998

fbshipit-source-id: be4b648f31bd6dfbf6a6e5d2e382acb084461974
2021-02-12 11:38:43 -08:00
Adam Simpkins
8907208651 update dirsync to allow matching individual files
Summary:
Update the dirsync code to allow mirror and exclude rules to match individual
files rather than just directory prefixes.

This simply appends `/` to all filenames when looking for rule matches.  This
allows us to efficiently match individual filenames in addition to directory
prefixes.

Reviewed By: quark-zju

Differential Revision: D26294583

fbshipit-source-id: 83b283f344f6e0bc0fe53b9068e7e0170f53504b
2021-02-11 15:54:28 -08:00
Durham Goode
9c1b611dff indexedlog: make writing to indexedlog the default
Summary:
We've rolled both of these out to 100%. Let's make this the default so
we can delete those configs.

Reviewed By: quark-zju

Differential Revision: D26233645

fbshipit-source-id: cd7a08c404483f78ab714763870f5bf0fa801e7a
2021-02-11 09:34:55 -08:00
Durham Goode
8c08a42d22 dynamicconfig: introduce configs.allowedconfigs
Summary:
In our upcoming migration away from chef/static rc files, we'll be
marking certain files as "allowed". Our hope is that that list only includes
things like .hg/hgrc, ~/.hgrc, etc.

There are cases however where it's convienent to continue to use chef, for
instance when we condition on machine type. To support this, let's add an
allowed_config option, which will allow configs from non-supported locations.

This will also be useful when remediating issues that come up when we start
enforcing allow_location, without rolling back the entire thing.

Reviewed By: quark-zju

Differential Revision: D26233451

fbshipit-source-id: 71789e0361923a6f80de4aef7f012afc0269440d
2021-02-10 19:30:35 -08:00
Sean Kamath
ae5db40fdd Changing commit hash length to 9 in hg prompt
Summary:
Copied from D17312417 (e1f4dbeb3d), because that did what I needed done, but incremented by 1.

I would like to change the length of the displayed hash in scm-prompt
to 9. Why such an impactful diff? Because hg sl shows 9 characters, and I
always get confused when the hash in my prompt doesn't match hg sl

Reviewed By: kulshrax

Differential Revision: D25934253

fbshipit-source-id: 15f2bc8bc7d666de1a077d2bafd74ab3c9753341
2021-02-10 17:07:35 -08:00
Jun Wu
9579b11d7f tests: remove broken test-setdiscovery-t84623377.t
Summary:
The test wasn't meant to be committed. The feature it wants to test was not
easily testable (requires streamclone and pull to have different master,
which is true on Mononoke but false on local hg servers).

Reviewed By: sfilipco

Differential Revision: D26380544

fbshipit-source-id: 6fa720058df8b88ace704d186caa4213d9cd62c9
2021-02-10 14:42:39 -08:00
Jun Wu
334ff0a4ca setdiscovery: include tip in localheads if it's empty
Summary:
Previously we include tip in sample. But that is problematic for fast paths
like:

    if set(commonsample).issuperset(set(localheads) - {nullid}):
        ui.note(_("all local heads known remotely\n"))
        return localheads, True, remoteheads

If `localheads` is empty, then the returned "common heads" are empty, causing
downloading the entire repo inefficiently.

Fix the issue by moving `tip` from `sample` to `localheads` so the common
heads will include tip in the fast path.

Reviewed By: DurhamG

Differential Revision: D26374303

fbshipit-source-id: 45a2a44e4db4c4ec2a341522a257d46a62b058d5
2021-02-10 14:08:16 -08:00
Jun Wu
bc803f49de tests: fix test-fb-hgext-treemanifest-prefetch.t
Summary:
The test is broken in master.  I might be using a stale binary running that
test in D26245424 (1392673a95). Revert the test to before D26245424 (1392673a95) fixes it.

Reviewed By: sfilipco

Differential Revision: D26321855

fbshipit-source-id: 4ada61211d3b354ae6f94f7fc8364f4550e9aeb8
2021-02-08 13:09:33 -08:00
Meyer Jacobs
ef00b68647 newstore: minimal proof of concept trait & edenapi implementation
Summary: Introduce a minimal version of an async, typed `ReadStore` trait and corresponding `EdenApi` implementation, along with a debug command, `debugnewstore` to exercise it.

Reviewed By: DurhamG

Differential Revision: D26050641

fbshipit-source-id: 2c14c3715e7067f9ecd1e649e6ca146a1ce249bf
2021-02-08 10:39:31 -08:00
Liubov Dmitrieva
a6c8d12c47 do not print warning about repo locking if the wait below the default threshold
Summary:
The warning is noisy if the wait is short and can make users dislike commit cloud.

Make sure we don't print the warning earlier than defaultlockwaitwarntimeout.

This is a follow up on D25587459 (18b8c66439) that doesn't fully work if warntimeout is passed equal to zero.

The default threshold has been introduced earlier in D25587459 (18b8c66439). This is just a fix.

A new test has been added. Also, the api should allow to pass value 0 meaning to show the warning always.

Reviewed By: quark-zju

Differential Revision: D26251321

fbshipit-source-id: c3beb5fec6a65f1816f667df70c1a39dd65ef083
2021-02-08 03:16:55 -08:00
Jun Wu
01b0122b0b revset: optimize x~n using Rust fast path
Summary:
Optimize the `x~n` revset function using Rust.

Note: This changes the behavior a bit, `x~n` no longer returns `null`.

Reviewed By: sfilipco

Differential Revision: D26142683

fbshipit-source-id: d6a45b7e67352d74986274e52002a769bbae772e
2021-02-05 11:37:51 -08:00
Jun Wu
1392673a95 smartset: add nameset fast paths
Summary:
For `nameset OP baseset` or `baseset OP nameset`, convert baseset to nameset
automatically for fast paths. This is motivated by a slow query in pushrebase:

    # pushrebase/__init__.py:validaterevset
    if onto != donotrebasemarker and onto in repo:
        rebased = list(repo.set("(successors(%r) & ::%s) - %r", revset, onto, revset))
        if rebased:
            raise error.Abort(
                _("commits already rebased to destination as %s")
                % ", ".join(str(c) for c in rebased)
            )

Depending on the complexity of `revset`, `successors(revset) & ::onto` might
generate a filterset that is very inefficient - iterating through a large set `::%s`.

Optimize them by using the Rust nameset for calculations.

Before:

  In [4]: repo.revs("(successors(1001) & ::1000) - 1000")
  Out[4]: <filteredset <filteredset <baseset+ [1001]>, <nameset- <spans [06b96ec2a8b60d984606f36c30d3dbc899d804df:e890940eb1c34a06967bb9e38a0317ad7a0eb518+0:1000]>>>, <not <baseset [1000]>>>

After:

  In [1]: repo.revs("(successors(1001) & ::1000) - 1000")
  Out[1]: <nameset+ <spans []>>

This can change the ordering of sets. Therefore some test changes.

Reviewed By: DurhamG

Differential Revision: D26245424

fbshipit-source-id: 2e3ab891c586bb80cf947fff4bbdcd453c01ae70
2021-02-05 10:50:14 -08:00
Liubov Dmitrieva
9deba0b16e introduce temporarily workaround to filter public heads from visible heads in CC code
Summary: The function is used in many places and I noticed there are some issues with commit cloud due to the bug that visible heads can contain public commit.

Reviewed By: quark-zju

Differential Revision: D26250556

fbshipit-source-id: e57e447dee803719fcf38cf376ad5af569d8020d
2021-02-05 02:23:08 -08:00
Jun Wu
e4c5f94935 discovery: reduce exchanged heads
Summary:
Reduce local heads from unfiltered raw heads to visible heads.  Reduce remote
heads from all heads to selected heads, plus those explicitly specified via
`-r`, `-B`, or via `repo.pull`.

This should speed up both pull and push for repos with lots of heads (ex.
fbsource), and make fastdiscovery less necessary.

Reviewed By: DurhamG

Differential Revision: D26207588

fbshipit-source-id: b64485566e0651ad47a5d1ee47e68301ba371e57
2021-02-03 20:32:43 -08:00
Jun Wu
98547dd626 remotenames: do not list all bookmarks for --to, --delete check
Summary:
Previously, remotenames lists all server-side bookmarks to check flags
like --delete, --create, --non-forward-move. That is inefficient. This
diff makes it use the listkeyspatterns API to reduce overhead.

Reviewed By: DurhamG

Differential Revision: D26213969

fbshipit-source-id: 2e51433829e80ebe685755049339c2dc03158717
2021-02-03 20:32:42 -08:00
Jun Wu
5ba3eac2a4 discovery: add debug message for size of initial heads
Summary: This makes it easier to reason about changes in reducing heads exchanged.

Reviewed By: DurhamG

Differential Revision: D26207589

fbshipit-source-id: 49c0c0dc25355a321c1aa4c9edfb5c43d2f23fd8
2021-02-03 20:32:42 -08:00
Durham Goode
88900aaf93 dynamicconfig: remove legacylist and disallowedlist deprecation logic
Summary:
The original migration strategy with dynamicconfig was to fix configs
one by one until the dynamicconfig values matched the chef/static ones, then we
can turn off chef/static configs. This looks to be too much work, so we're going
to try a different strategy of just turning off all chef/static configs on a
small number of hosts and seeing what breaks.

The legacylist and disallowlist configs were part of the old strategy, and they
make it more complicated to fix dynamicconfig mismatches, so let's get rid of
them.

Reviewed By: quark-zju

Differential Revision: D26208548

fbshipit-source-id: 63171f1f16aa0498c0eefa994dffaeb8e0cc0d72
2021-02-03 09:53:00 -08:00
Jun Wu
855122ad66 gracefully ignore invalid JSON in app_samples data
Summary: This would allow us to ignore bogus data and still get something useful for logging.

Reviewed By: DurhamG

Differential Revision: D20343844

fbshipit-source-id: 763d294bc44bb203c1f206ca80e0839396e8de6e
2021-02-02 16:28:21 -08:00
Durham Goode
13de9f801a doctor: repair treemanifest indexedlogs as well
Summary: Previously we only repaired the file indexedlogs.

Reviewed By: xavierd

Differential Revision: D26202423

fbshipit-source-id: b1c673ae69a357d66ab2baf5c36985a3b0597427
2021-02-02 16:21:01 -08:00
Jun Wu
59f4d938b4 revset: remove branchpoint()
Summary:
It is already broken with segmented changelog (it assumes 0..len(repo) are
valid revs). It is super slow and cannot be optimized efficiently. The _only_
non-zero-exit-code usage in the past month is like:

  hg log -r 'reverse(children(ancestors(remote/master) and branchpoint()) and draft() and age("<4d"))'

which takes 40 to 100s and can be rewritten using more efficient queries like `parents(roots(draft()))`.

Reviewed By: singhsrb

Differential Revision: D26158011

fbshipit-source-id: 7957710f27af8a83920021a228e4fa00439b6f3d
2021-01-29 20:21:29 -08:00
Jun Wu
358466ee0f transaction: record transaction name to metalog
Summary:
For `repo.transaction("tr-name")`, this records `Transaction: tr-name` to
metalog commit description.

It can be helpful to narrow things down for commands with multiple
transactions.

In the future we might want to attach more data to the logging (ex. what the
commit cloud local, remote states at the time of syncing). However I didn't
do it now since metalog is designed to hold repository data, not too much
logging data. With a better logging infra we might want to move `config` out
from metalog, associated with metalog root ids.

Reviewed By: DurhamG

Differential Revision: D25984805

fbshipit-source-id: 59c074272cff555c6ff11dd755f7e3ce9a292eb6
2021-01-29 12:36:08 -08:00
Durham Goode
7f555d2d06 http: improve error messages from http failures
Summary:
Currently the data layer eats all errors from remote stores and treats
them as KeyErrors. This hides connection issues from users behind obscure
KeyErrors. Let's make it so that any non-key error reported by the remote store
is propagated up as a legitimate error.

This diff makes Http errors from EdenApi show up with a nicer error message,
suggesting that the user run fixmyserver.

Further fixes will probably be necessary to categorize other errors from the
remote store more nicely.

Reviewed By: quark-zju

Differential Revision: D26117726

fbshipit-source-id: 7d7dee6ec101c6a1d226185bb27423d977096050
2021-01-29 09:40:19 -08:00
Liubov Dmitrieva
339788a95e fix tests
Summary: Fix tests broken by the deprecation notice D26073439 (14a0d96b04)

Reviewed By: johansglock

Differential Revision: D26099594

fbshipit-source-id: 65b973c4f1dcc7a032e747c12ce59a1d0c04091e
2021-01-27 05:12:09 -08:00
Liubov Dmitrieva
14a0d96b04 add deprecation notice for pullbackup related set of commands
Summary:
this is needed to remind users to use the commands related to the Commit Cloud Workspaces

This is also needed to avoid confusion - the current error is not very informative:

```
connected to twshared9522.24.frc3.facebook.com session Wfq9tGuoPSBJH8nc
abort: 'listkeyspatterns' command is not supported for the server ssh://hg.vip.facebook.com//data/scm/fbsource?infinitepush_write
```

Reviewed By: markbt

Differential Revision: D26073439

fbshipit-source-id: 58ee477bc021a0796e22cc18610225ee003e06be
2021-01-26 08:21:07 -08:00
Liubov Dmitrieva
2c15a29f0f fix unit test that was broken by D19803760
Summary: fix unit test that was broken by D19803760 (8e35bcc49d) to unblock release

Reviewed By: krallin

Differential Revision: D26073002

fbshipit-source-id: 88da60f5806ef5cb2f832922e503309836542e09
2021-01-26 04:33:47 -08:00
Jan Mazur
d1b291d72a flush stream to always print out interactive prompt
Summary: Suddenly prompt stopped appearing for me. Flush the stream to be sure that it's printed out.

Reviewed By: HarveyHunt

Differential Revision: D25956018

fbshipit-source-id: 83419037fa6ce672e203385b71f1403a738d0c90
2021-01-22 07:46:11 -08:00
Liubov Dmitrieva
a1dd7229e6 dynamic config: remove unnecessary option from the dynamic config
Summary: this infinitepush option is true by default

Reviewed By: DurhamG

Differential Revision: D25995928

fbshipit-source-id: 0c1d50a96dc16ee4d8c45da4f4a213baa49bb8a4
2021-01-22 06:24:23 -08:00
Liubov Dmitrieva
9bd3235f3f deprecate owner_team option in favour of ui.supportcontact
Summary:
The both options have basically the same value.

This is my next step for resolving mismatches between CC dynamic config and the current configuration and generally improving CC configuration.

Reviewed By: DurhamG

Differential Revision: D25973556

fbshipit-source-id: aae21efcd5174ed58efcb9e5d8c85831d35777ea
2021-01-20 14:15:54 -08:00
Jun Wu
f11d555a3a fsmonitor: add threshold of nonnormal files to update
Summary:
Previously, the fsmonitor state update logic will skip updating treestate if the wlock
cannot be obtained. D17468790 (8d4d0a66a2) made it wait for wlock for the painful "watchman fresh
instance" case. But things can still suck if it's not a "fresh instance" but there are just
too many nonnormal files.

This diff makes it that exceeding a threshold of nonnormal files will trigger a fsmonitor
state write as an attempt to to reduce the number of nonnormal files. In additional,
`--debug` was changed to print more internal states for debugging.

This would hopefully address issues where people have a large "nonnormal"
treestate, suffers from the bad performance issue and cannot recover from it
automatically.

Reviewed By: DurhamG

Differential Revision: D25794083

fbshipit-source-id: 741426cf31484d9318f9cfcab11d38da33ab5067
2021-01-12 16:26:48 -08:00
Stefan Filip
a9a2610cf8 tests: remove test-hgext-repogenerator.t
Summary: Unstable test.

Reviewed By: quark-zju

Differential Revision: D25879146

fbshipit-source-id: 09e41fc1e43644bba50f713a095e8a4b8c4f520a
2021-01-11 17:58:02 -08:00
Jun Wu
027709fa36 pull: use the new repo.pull API if possible
Summary:
The `pull` commmand has a lot of tech debt (with issues like inefficiency, race
conditions, named branches, etc). The new `repo.pull` API isn't designed to
support all legacy usecases.

This diff switches a subset of `pull` command that the new API can support to
the new API. It should solve race condition or `visibility.add` inefficiency
issues (ex. 20s on addgroup, 187s on visibility.add - P154836357).

Logic related to remotenames was ported from the remotenames extension.
The selectivepull tests seem strong enough to check their behaviors.

The new pull API is used by commit cloud for many months. So I turned the
new code path on by default. It can be turned off by changing
`commands.new-pull`.

There are a few test changes. The new behavior seems more correct overall:
- test-commitcloud-switch-workspace.t
  - "M/F" swap is caused by rev number: both are correct
  - "S: public remote/stable" is more correct than "S: draft"
- test-commitcloud-sync-rb-deletion.t
  - "draft1: draft remote/scratch/draft1" is more correct because
    "remote/scratch/draft1" is listed in the "book --list-subs"
    command above.
- test-commitcloud-sync-rb-enabling.t
  - "public1: draft" not showing up is more correct.
- test-fb-hgext-remotefilelog-lfs-prefetch.t
  - Difference seems to be caused by rev order.

Reviewed By: markbt

Differential Revision: D25562089

fbshipit-source-id: ac22b2f0492ab53517d580d706dfbc823fd0e0cc
2021-01-11 13:28:15 -08:00
Thomas Orozco
9d7b0267dd revisionstore: pass client correlator
Summary:
We used to get those in the old (Python) LFS extension, but didn't have them in
the new one. However, this is helpful to correlate requests to LFS with data in
hg logs. It's also convenient to be able to identify whether a set of requests
are part of the same session or not.

This diffs threads the client correlator through to the LFS store from the
Python, similarly to how it's done in EdenAPI.

Reviewed By: DurhamG

Differential Revision: D25804930

fbshipit-source-id: a5d5508617fa4184344834bbd8e3423816aa7668
2021-01-11 10:46:20 -08:00
Mark Juggurnauth-Thomas
a7e8a2c5c2 crdump: add manifest_node to crdump output
Summary:
Add `manifest_node` to the crdump output, which is the root manifest node of the commit.

This is useful for detecting commits that have the same tree content but
different metadata (e.g. if only the commit message has been edited).

Reviewed By: singhsrb

Differential Revision: D25782674

fbshipit-source-id: dfdf426833533140b676eee82e123a0cba23c77a
2021-01-11 07:30:35 -08:00