Commit Graph

1095 Commits

Author SHA1 Message Date
Jun Wu
4afd737525 hide: cleanup non-essential remote bookmarks automatically
Summary: Trigger the cleanup logic automatically if there are too many remote bookmarks.

Reviewed By: sfilipco

Differential Revision: D26802251

fbshipit-source-id: 1ab40c7be98c507865ea17001dc9775b6edf4446
2021-03-03 18:30:08 -08:00
Jun Wu
01035df3a4 hide: make --cleanup remove non-essential remote bookmarks
Summary: This is handy to make the `sl` output cleaner.

Reviewed By: sfilipco

Differential Revision: D26802250

fbshipit-source-id: 1b74f3d9a42ab6b0780f07bec59b03a5cd0ea6a9
2021-03-03 18:30:08 -08:00
Jun Wu
e33255b67d remotenames: add a command to clean up remote bookmarks
Summary: Add API and command to remove non-essential remote bookmarks

Reviewed By: sfilipco

Differential Revision: D26802252

fbshipit-source-id: bf715905f146f31aac19dccb90022bea31392323
2021-03-03 18:30:07 -08:00
Jun Wu
4abfeb66e8 remotenames: raise if key bookmarks point to unknown commits
Summary:
Previously remotenames pointing to unknown commits are just ignored.
If key remotename like master is ignored, it can cause very slow operations
in pull, etc. Let's just raise an exception in this case.

Reviewed By: DurhamG

Differential Revision: D26800236

fbshipit-source-id: 13be4af5499da1b9098b4ff1a6ef41c54092824a
2021-03-03 18:20:05 -08:00
Jun Wu
7a759b6075 visibility: remove public heads
Summary:
Remove public heads when using Rust changelog backends. This should address
some issues seen in commit cloud sync.

This is done at the metalog commit time so we get the latest "remotenames" data for
accurate "public()" set calculation.

Reviewed By: singhsrb

Differential Revision: D26792731

fbshipit-source-id: 00b894fee9804740d664dad0ac47be564820da33
2021-03-03 18:06:08 -08:00
Jun Wu
7f2e472696 dirsync: add a test about in-memory rebase
Summary: Now dirsync works with IMM rebase. Add a test for it.

Reviewed By: DurhamG

Differential Revision: D26726478

fbshipit-source-id: 6712538d7e903ddb0e3c3df44f7dde638276e99d
2021-03-02 18:12:35 -08:00
Jun Wu
82b71b144c dirsync: add a test about absorb
Summary: Now dirsync works with absorb. Add a test for it.

Reviewed By: DurhamG

Differential Revision: D26726477

fbshipit-source-id: 4505ad6c1e1fd03bfb2cf12b46bd07c98f2bcc2b
2021-03-02 18:12:35 -08:00
Jun Wu
5ceeb5311d dirsync: improve in-memory commit compatibility
Summary:
Previously, dirsync wraps `repo.commit`, requires an on-disk working copy,
and dirstate to work properly. This diff updates dirsync to wrap
`repo.commitctx` instead, do commit edits purely in memory, then sync the
commit back to disk. It makes dirsync compatible with absorb and in-memory
rebase (and potentially other things like drawdag, if drawdag's context APIs
are improved).

To sync the changes made in-memory back to the filesystem, a dirstate callback
is added to write back mirrored files from commit to disk. This works for both
amend and absorb so the special wrapper about amend is dropped. It is
also optimal for absorb, because it only writes the mirrored files once for
the "final" commit, instead of writing the files for each commit in the stack.

Some `O(N^2)`s (N: len(status)) complexities were avoided:
- `applytomirrors` was called N times.
- `allchanges = set(status.modified + status.removed + status.added)` in
  `applytomirrors` was O(N).
- `sourcepath in status.removed` in `applytomirrors` was O(N).
- `mirrorpath in status.removed` in `applytomirrors` was O(N).

Note there is still a suboptimal complexity of `getmirrors` called per changed
path, `O(N*M)` (N: len(status), M: len(dirsync_conig)). That will be addressed
in a later diff.

Reviewed By: DurhamG

Differential Revision: D26726479

fbshipit-source-id: 482c6c830ab65cc0d9cd569a51ec610a1dac49cc
2021-03-02 18:12:34 -08:00
Durham Goode
752c5ccff5 tests: remove test environment when running system hg
Summary:
dynamicconfig has logic to avoid loading remote configs during tests,
by checking the TESTTMP variable. Unfortunately, the tests currently run system
hg with that environment set, which causes it to generate incorrect
configuration for the real repository (i.e. fbsource).

Let's get rid of all test specific environment variables when running the system
hg. There's a comment in the code saying this breaks some tests (from 2017
03a31be593db), but as far as I can see they still work.

Reviewed By: quark-zju

Differential Revision: D26758364

fbshipit-source-id: 945cbd36f7eccc98149772a42421cbc51b157c5b
2021-03-02 12:53:57 -08:00
Durham Goode
6451219968 tests: fix test-doctor.t on OSX
Summary:
The new test case failed on Mac because it didn't want to copy over a
symlink or something. Didn't dig too deep because 'rm -rf' works around it.

Reviewed By: sfilipco

Differential Revision: D26758985

fbshipit-source-id: 22ad7e23813bd6bfe86b91535d46c21ee59dfcd1
2021-03-02 11:47:30 -08:00
Durham Goode
2fc16ce279 tests: fix test-unicode-inputs-t.py on Windows
Summary: This was broken by D26702166 (373d9ade0a).

Reviewed By: sfilipco

Differential Revision: D26736392

fbshipit-source-id: 8bae1599922c05193eba529d7f74c585f20d6f91
2021-03-01 22:23:14 -08:00
Andrey Chursin
c8871fd796 checkout: support sparse profile update in python binding
Summary:
This diff integrates CheckoutPlan::with_sparse_profile_change into python code
It also updates test-update-over-sparse-profile-change.t to use native checkout, as this test now passes

Reviewed By: DurhamG

Differential Revision: D26670414

fbshipit-source-id: 73011217b4a0d80ef643b778cdaf75bbada5dcf2
2021-03-01 20:25:17 -08:00
Andrey Chursin
340f8b70f0 checkout: support fixed sparse profile
Summary:
This diff introduces support for fixed sparse profile into native checkout.
Sparse profile change is not yet supported.
This also updates test-sparse.t to use native checkout

Reviewed By: DurhamG

Differential Revision: D26648490

fbshipit-source-id: 516308dba096189e4657715214ad2a5b61816c49
2021-03-01 20:25:17 -08:00
Jun Wu
bb8212e827 tests: fix test-import-merge.t
Summary:
With Rust IO, `hg` is more willing to report "broken pipe" issues:

       $ hg export 'desc(2)' | head -7 > ../a.patch
    +  abort: The pipe is being closed. (os error 232)
       $ hg export tip > out

Fix the test by using a temporary file.

Reviewed By: sfilipco

Differential Revision: D26730868

fbshipit-source-id: 8446528cad72713329b173eaa10ee109e8dfa956
2021-03-01 11:49:57 -08:00
Andrey Chursin
88712f0cd5 tests: switch test-update-{reverse, issue1456}.t to use native checkout
Summary: Switching couple more .t tests to use native checkout

Reviewed By: quark-zju

Differential Revision: D26621668

fbshipit-source-id: 029513fb3b1807e55e1d17769edd6beea5c3db41
2021-03-01 10:41:07 -08:00
Jun Wu
deafa7e539 doctor: fix master pointing to unknown commit
Summary: This should fix issues where master points to an unknown commit somehow.

Reviewed By: DurhamG

Differential Revision: D26648623

fbshipit-source-id: 63f7a4b834bf19a7849a1c3771921e6b1e5919d3
2021-02-26 18:05:08 -08:00
Durham Goode
373d9ade0a py3: fix hg status with unicode characters in OSX
Summary:
hg status was throwing an error on Py3 OSX because a fallback path
returned bytes instead of string. This fixes that.

Reviewed By: sfilipco, singhsrb

Differential Revision: D26702166

fbshipit-source-id: fa32e5b312377a899b6af16f40bca051f44ed6c3
2021-02-26 16:31:45 -08:00
generatedunixname89002005287564
cb2cc4ddb1 Daily arc lint --take BLACK
Reviewed By: zertosh

Differential Revision: D26686094

fbshipit-source-id: e382675ff1c32f63467d464bce28f54024af35b9
2021-02-26 03:57:20 -08:00
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