Commit Graph

672 Commits

Author SHA1 Message Date
Xavier Deguillard
6dadf6fdd9 node: use binascii.Error in Python3
Summary:
In Python3, the error returned from binascii.unhexlify changed, from a generic
TypeError to a binascii.Error. Therefore, wrap the binascii function and catch
the binascii.Error before raising a TypeError.

Reviewed By: DurhamG

Differential Revision: D20924129

fbshipit-source-id: 33f852ea97396af715ef73630e0dd1b4324eb707
2020-04-08 23:46:09 -07:00
Stefan Filip
25fd8b9034 py3: fix test-hint.py
Summary:
I can't say that I understand `mdiff.splitnewlines`. In my test it does not
behave the way it reads and I don't know why. The stripping that it's supposed
to do doesn't happen for some reason. It behaves like splitlines.
I believe that rcutil used '\n' for line termination because it was relying on
Python to do the conversion to system line end. I updated to use os.linesep
now that we encode the contents.

Reviewed By: quark-zju

Differential Revision: D20935377

fbshipit-source-id: 0958fdff03950ab0a4b2da02e4333b5438ac5c70
2020-04-08 22:00:35 -07:00
Stefan Filip
5afca4fadd py3: fix test-manifest.py
Summary:
Bytes and Str usages mostly. __iter__ seems to have been incorrectly
converted to python 3 previously.

Reviewed By: xavierd

Differential Revision: D20933166

fbshipit-source-id: 10e63e90bd83c70a51dd808e9b5073ab8d766e71
2020-04-08 19:14:15 -07:00
Xavier Deguillard
76ecec0e57 bisect: make it python3 compatible
Summary: We should read/write to it via as utf8.

Reviewed By: DurhamG

Differential Revision: D20923404

fbshipit-source-id: 86cdc329395d60c88637f24d3c7c5caedcc7111a
2020-04-08 19:08:51 -07:00
Mark Thomas
c02f38dfb7 mutation: public commits are never obsolete
Summary:
The computation of commit obsolescence is inconsistent.  If we compute the full
set of obsolete commits in `mutation.obsoletecache.obsoletenodes`, then we
correctly ignore public commits as they cannot be obsolete.

However, if we compute the obsolescence state for a single public commit with
`mutation.obsoletecache.isobsolete`, and that commit somehow has a visible
successor, then we will incorrectly consider the commit as obsolete.

Similarly, `allpredecessors` and `allsuccessors` should stop when they hit a
public commit.

Reviewed By: quark-zju

Differential Revision: D20892778

fbshipit-source-id: 223cb8b2bc9f2f08124df6ff51c2eb208bb8eb5f
2020-04-08 06:33:14 -07:00
Jun Wu
4d951d777b util: add more APIs for pytracing
Summary: This makes the tracing features easier to use.

Reviewed By: DurhamG

Differential Revision: D19797703

fbshipit-source-id: fb5cb17cd389575cf0134a708bcd9df3b90e9ab4
2020-04-07 21:35:31 -07:00
Xavier Deguillard
d5793b1796 colors: do not disable colors in the pager
Summary:
Somehow, enabling VT can fail when writing to the pager, but this doesn't
mean that the pager doesn't support VT mode, so let's just ignore the error
when the pager is active.

Reviewed By: DurhamG

Differential Revision: D20906374

fbshipit-source-id: 7cba52817bc8e4dc91d5d50e856ad8af7fc9542c
2020-04-07 19:36:55 -07:00
Jun Wu
5a69be9e70 commands: add debugvisibleheads
Summary:
Add a command to print visibleheads. This was part of my attempt to check if
visibleheads can accidentally include public commits and if there are a way
to remove it. I ended up thinking D20808884 might actualy solve the only case
that visibleheads include public heads.

I also tried to add strong verification so that the visibility layer never
writes public nodes. That's for non-narrow-heads use-cases. However, the
phasescache + repoview layer is kind of messy in a way that inside a
transaction there is only one "repo" that has the right in-memory, dirty
"phasescache" and other repos will load the (stale, wrong) phasescache from
disk. That means if we test phases in visibility before transaction flushes,
we won't be able to access the latest phases information correctly. So I
gave up this approach too.

Anyway, I wasn't able to add a new interesting test, but the utility built for
the test seems useful. Therefore this change.

Reviewed By: sfilipco

Differential Revision: D20829136

fbshipit-source-id: 5ebafefac820ebb4044db63b7892ffaa341c0573
2020-04-07 19:10:45 -07:00
Jun Wu
bd55a2e946 phrevset: improve error message if the commit hash is not found
Summary:
Make the error cleaner and more actionable. We don't autopull the commit
because the revset layer might be not ready for it (ex. it expects commit
graph to be immutable and might have done some calculations based on the
old graph already).

Reviewed By: sfilipco

Differential Revision: D20845159

fbshipit-source-id: c51f2f52c612ff14a88fb891c10d1faad1094635
2020-04-07 19:05:05 -07:00
Jun Wu
a06922ec0f phrevset: rename getdiff, finddiff to graphqlgetdiff, localgetdiff
Summary: This makes it easier to reason about.

Reviewed By: sfilipco

Differential Revision: D20845158

fbshipit-source-id: 4220c7790a2d3bb83380b65d3de469b42846b34d
2020-04-07 19:05:04 -07:00
Jun Wu
67bbd46027 phrevset: add a config to enforce querying Phabricator
Summary:
The old linear changelog search does not scale and does not work with segmented
changelog, which makes commit data lazy. The "forksearch" is also problematic as
it can produce non-deterministic results. Let's disable the linear search by
default with the intention to remove it if nobody complains.

Reviewed By: sfilipco

Differential Revision: D20845161

fbshipit-source-id: 6911035f146e15c88925217ee9940db59ea2d1c1
2020-04-07 19:05:04 -07:00
Jun Wu
42b1577340 context: provide what commit it is when we cannot load the manifest
Summary:
The manifest node is hard for debugging. Attach the commit as the context and
print it out.

Reviewed By: sfilipco

Differential Revision: D20829139

fbshipit-source-id: ff65d902f56bc79c2d5f2c3ec9cf79a620fd70fc
2020-04-07 19:05:03 -07:00
Jun Wu
35659be2a5 error: add a way to provide context to errors
Summary:
This allows providing context about errors, similar to Rust's "context"
features.

Reviewed By: sfilipco

Differential Revision: D20845160

fbshipit-source-id: 789a4c1b7356fd6eb4b1bcb71efd205d2d45e984
2020-04-07 19:05:03 -07:00
Jun Wu
6a09828a7f pager: add "internal:streampager" as an option to use the Rust pager
Reviewed By: DurhamG

Differential Revision: D20887175

fbshipit-source-id: 6b4cec2ce83578fe39bc3058d09cbb42b32a9d78
2020-04-07 15:57:07 -07:00
Jun Wu
9715911327 templatekw: fix predecessors with only mutation enabled
Summary: The template should use mutation instead of obsutil if mutation is enabled.

Reviewed By: markbt, simpkins

Differential Revision: D20901109

fbshipit-source-id: a2b587ddf2a03965886f753e54e075d5d9064f05
2020-04-07 15:11:30 -07:00
Stefan Filip
d1ba21803a version: warn users when they are running an old build
Summary:
Old is defined by being based on a commit that is more than 30 days old.
The build date is taken from the version string.
One observation is that if we fail to release in more than 30 days then all
users will start seeing this message without any way of turning it off. Doesn't
seem worth while to add a config for silencing it though.

Reviewed By: quark-zju

Differential Revision: D20825399

fbshipit-source-id: f97518031bbda5e2c49226f3df634c5b80651c5b
2020-04-07 14:25:38 -07:00
Mark Thomas
5499a6cbfd commitcloud: don't add deleted remotebookmarks to the set of new remote bookmarks
Summary:
When syncing, if the local copy of the remote bookmark is `None` then the
remote bookmark has been deleted, and shouldn't be added to the set of new
remote bookmarks.

Reviewed By: DurhamG

Differential Revision: D20855909

fbshipit-source-id: 84a7a78ec0ab179e4a14d946b37f496f3dbde03a
2020-04-07 09:33:05 -07:00
Thomas Orozco
c6aa2d3125 globalrevs: verify that convert_revision is a svnrev when falling back
Summary:
When falling back to convert_revision to get the svnrev for a commit to return
it as a globalrev, it seems like it would make sense to verify that the
convert_revision is indeed a svnrev (and not, say, a git commit hash from
hggit).

Reviewed By: farnz

Differential Revision: D20891268

fbshipit-source-id: 2451ad787fcce7b10b6a405f2855313ca51f5b3e
2020-04-07 06:47:26 -07:00
Jun Wu
ea0ffd3607 treemanifest: make post-pull prefetch non-fatal
Summary:
Similar to D19957251, failing to prefetch trees post-pull is not a fatal error.
This recently became an issue because with these conditions:

- We're migrating a repo from hg to Mononoke, and Mononoke has lagged
  bookmarks, esp. remote/master.
- We're still using Mercurial to serve infinitepush pulls (ex. scratch
  bookmarks). Mercurial will return bookmarks that are not synced to
  Mononoke yet.
- I made a recent change (D20531121) that moves selectivepull logic that
  changes `pull -r HASH` to `pull -r HASH -B master` to core. The CI
  tier didn't have selectivepull enabled that will pull bookmarks, but
  now they also pull bookmarks.
- The tree prefetch logic uses unpatched paths.default to fetch `master`,
   which can be an unknown commit for Mononoke.

Ideally, the final state is to rely on Mononoke for everything. There is
only `paths.default` which points to Mononoke. For now, as a temporary
fix let's just make post-pull tree prefetch non-fatal. Once this happens,
it will be logged to the cloud table with fatal=false.

Reviewed By: krallin

Differential Revision: D20873599

fbshipit-source-id: 291a2dc41c7c602f004ad8df71e19a48a98e9c5e
2020-04-06 14:04:51 -07:00
Jun Wu
a7c7d37443 sparse: print warnings for sparse profile typos
Summary:
This makes it easier to spot typos.

The config sparse.missingwarning affects everytime a sparse profile is used.
In this case we just want to check at "enableprofile" time. So avoid using
that config option.

Reviewed By: DurhamG

Differential Revision: D20846313

fbshipit-source-id: 79f80d5e01abfe1633f2597074e9acb5cda60fec
2020-04-06 13:57:48 -07:00
Xavier Deguillard
ffc487e2de color: do not try to enable VT mode for tests
Summary:
Tests are redirected, but we still want colors in them (to verify that ANSI
escape code works). Since VT mode will always fail, simply do not try to
enable it in this case.

Reviewed By: DurhamG

Differential Revision: D20875423

fbshipit-source-id: bd6b0046de9558d957e0df082d4392ad00e0b551
2020-04-06 13:07:52 -07:00
Xavier Deguillard
46d13ee650 ui: cache formatted
Summary:
Somehow the constant isatty and config reading shows up in my profile. Since
this is not intended to change, just cache it.

Reviewed By: DurhamG

Differential Revision: D20830511

fbshipit-source-id: de36c0a958f6a6046a05db0abf976994435b9e3c
2020-04-06 11:10:53 -07:00
Xavier Deguillard
d0b63fcd01 color: only warn about VT mode when formatted
Summary: We don't want tests to show this warning.

Differential Revision: D20851847

fbshipit-source-id: bae87a980a2da4088aff6ed0b4a3a85971166817
2020-04-06 08:48:58 -07:00
Thomas Orozco
0565c7e244 hggit: add a external-sync command that does the bare minimum
Summary:
For our HgExternalSync jobs that pull from git, we don't really use most of the
bells and whistles of hggit. Notably, we don't care about bookmarks: we only
ever pull master, we never update to it, we only ever look at `-r tip`.

However, we do care about things that are actually much harder to fit in a
world where we try to pretend the remote git repository is actually a hg
repository we can pull from.

Notably, we'd like to enforce limits on how many commits we pull (and convert)
at a time, so that if we fall behind a little bit, we don't start falling even
more behind by having to convert bigger and bigger batches of commits. If we're
trying to pretend fetching from git and converting commits is actually a pull,
then that seems harder to pull off (we'd need to somehow rewind the remote head
we're pulling before importing it).

So, this adds a new external-sync command to hggit that basically the bare
minimum that we do need. It lets you specify a git remote and a head you care
about, and import up to N commits from it. That's it — no bookmarks are updated
or anything (but the git-mapfile is, of course). The only thing that changes is
your commits.

If you actually want to interact with your git repository on an ongoing basis
as if it were a remote hg repository, this is completely useless, but that
isn't what we actually do, so that should be OK.

As part of this, I've modified a few other parts of git_handler to remove
places where we called a `uri` `remote_name` (which is a bit confusing), and a
place where we were asking for a `remote_name` parameter that I don't have
here, but which we also didn't actually need (in `import_git_objects`).

Reviewed By: farnz

Differential Revision: D20836601

fbshipit-source-id: 96230e6e8269d0472404414948fd2f02aa98d79c
2020-04-06 07:35:36 -07:00
Mark Thomas
5456adefe7 infinitepush: don't create revive obsmarkers if evolution is not enabled
Summary:
Evolution crashes if you try to create obsmarkers in a repo where obsmarkers
are not enabled.  Instead, check before reviving commits with obsmarkers that
it is enabled.

Reviewed By: krallin

Differential Revision: D20868173

fbshipit-source-id: b3a08ef05ddc13e9b78df8ac7c1ca1ef808b7602
2020-04-06 06:43:35 -07:00
Xavier Deguillard
7bcf163d55 color: remove all the win32 terminal handling
Summary:
Let's mandate a 256 color terminal in Windows. We also update less to default
to using VT mode: https://github.com/gwsw/less/pull/29

With this, the colors appears to be working as expected on Windows!

Reviewed By: quark-zju

Differential Revision: D20826922

fbshipit-source-id: 5d2a149e2698b3ccc7bf6388b5cd97da20898eb7
2020-04-03 13:47:32 -07:00
Xavier Deguillard
01e921aa19 crecord: fix windows arrow keys
Summary:
For whatever reason, ncurses doesn't interpret the arrow keys properly... Use
whatever is returned from it instead.

Reviewed By: kulshrax

Differential Revision: D20821432

fbshipit-source-id: 019426a1333538a479fb3dd8d147fb9cb4ba6559
2020-04-03 08:26:26 -07:00
Jun Wu
4ae44e316a remotenames: move repo._accessedbookmarks to core repo._remotenames._accessedbookmarks
Summary:
Move the attribute so it won't cause an AttributeError when remotenames is not
enabled.

As we're here, also move it to repo._remotenames from repo. This makes the repo
object a bit clearner and avoids loading the accessed bookmarks if remotenames
are not accessed at all.

Reviewed By: singhsrb

Differential Revision: D20821070

fbshipit-source-id: b5a01016451ee202f778cadb2dd418400406fa6b
2020-04-02 19:25:33 -07:00
Durham Goode
9976df9010 watchman: keep using watchman even if there are state-enter/leave errors
Summary:
We've seen a number of recent cases where hg stops using watchman for
status because state-enter or state-leave fail because multiple enters or leaves
are called out of order. The root cause needs to be found, but in the mean time
we should not allow such errors to block of from using watchman entirely.

Let's eat these gracefully and just log that the issue happened.

Reviewed By: quark-zju

Differential Revision: D20807004

fbshipit-source-id: 517d9562febc226ce7db836435ca2ca9db1c68fb
2020-04-02 11:42:59 -07:00
Xavier Deguillard
e7c31f21a4 remotefilelog: set umask when creating the rust stores
Summary:
On shared devservers, all users in svnusers should be able to read/write onto
the stores, set the umask to properly reflect this.

Reviewed By: ikostia

Differential Revision: D20817266

fbshipit-source-id: 8a865f499a35313afd3cbeb5f989175862a3549f
2020-04-02 10:42:40 -07:00
Thomas Orozco
d225cb2910 remotenames: don't throw on hidden nodes
Summary:
This updates fastheaddiscovery to use an unfiltered repository when it attempts
to check if the nodes the server sent are present locally.

Reviewed By: quark-zju

Differential Revision: D20792006

fbshipit-source-id: 14ba9605d79ba54f3f4143d6d8ec65357e3d8c07
2020-04-02 08:53:48 -07:00
Jun Wu
2aec2dbcb6 commitcloud: migrate to tech-debt-free repo.pull for pulling
Summary:
The new API does nothing that cloud sync does not want: bookmarks, obsmarkers,
prefetch, etc. Wrappers to disable features are removed.

This solves a "lagged master" issue where selectivepull adds `-B master` to
pull extra commits but cloud sync cannot hide them without narrow-heads. Now
cloud sync just does not pull the extra commits.

Reviewed By: sfilipco

Differential Revision: D20808884

fbshipit-source-id: 0e60d96f6bbb9d4ce02c04e8851fc6bda442c764
2020-04-01 19:40:57 -07:00
Jun Wu
07fc8adad9 commitcloud: sort hashes being pulled
Summary: This makes the upcoming change easier to verify.

Reviewed By: sfilipco

Differential Revision: D20808883

fbshipit-source-id: 5563601125ef5c961785f7275fd82fc3fefe53ff
2020-04-01 19:40:56 -07:00
Jun Wu
e2af876a45 remotenames: fix pull race conditions
Summary:
We have seen one report that the race condition caused lagged remote/master.

The race condition is:
- pull everything: get all commits, but not remotenames.
- expull: get all remotenames. Some point to new commits received by the
  server that are unknown to the client. The client ignores them.

This diff adds a double check to pull again if it sees remotenames pointing
to unknown nodes.

This won't be necessary if we migrate everyone to selectivepull, and clean up
the pull command to use the race-free repo.pull API. Because the new code path
will first query the bookmarks, then pull the heads explicitly.

Reviewed By: DurhamG

Differential Revision: D20703268

fbshipit-source-id: 42bd0201c3c4f709f25ad0fea3a191db9991e4fc
2020-04-01 19:40:56 -07:00
Jun Wu
5730719bd9 revset: automatically pull remote bookmarks prefixed remote/ or default/
Summary:
This makes it possible to do things like `hg up remote/foo` without having to
`hg pull -B foo` first.

Reviewed By: DurhamG

Differential Revision: D20531122

fbshipit-source-id: e95b2f0a49e4b815c136450d1f352a7973cb72ed
2020-04-01 19:40:55 -07:00
Jun Wu
707b7dea42 localrepo: add a tech-debt-free repo.pull API
Summary:
The new `repo.pull` API aims to be tech-debt free. It does:
- Pull nothing instead of everything if nothing is specified.
- Update remote names that are explicitly specified, not everything the server
  has.
- Do not update local bookmarks.

The direct motivation is to implement autopull `remote/foo` behavior while not relying on the pull command.

Reviewed By: DurhamG

Differential Revision: D20531119

fbshipit-source-id: 80c3bdd5556126d81af099a74f1345ecc94904b7
2020-04-01 19:40:55 -07:00
Jun Wu
bd4ac25e5f infinitepush: move listkeyspatterns to core
Summary: This will be used by the next diff.

Reviewed By: DurhamG

Differential Revision: D20661056

fbshipit-source-id: 3b4793bc0737bd64196da5b99c2d4da6f5e48efb
2020-04-01 16:58:33 -07:00
Mark Thomas
04a400b5eb commitcloud: handle missing remotebookmarks in commitcloud lastsyncstate
Summary:
During the roll-out of commitcloud remotebookmarks sync, some clients may have it enabled, and others may have it disabled.

This can result in some clients having an empty set of remotebookmarks in their sync state for a version which actually
does have remotenames in the cloud workspace.

This becomes a problem when those clients start syncing remotebookmarks, for two reasons:

* They are unable to correctly apply the new cloud remotebookmarks, as they do not have the previous state with which to break ties, and the tie-breaking code doesn't work correctly if the old cloud remotebookmark is `None`.

* When they try to send the remotebookmarks delta to the server, they don't have the old state, and so compute the delta incorrectly.  This results in `Duplicate entry for key` errors in the service.

We can handle this as follows:

* When syncing remote bookmarks from the cloud, ensure we correctly apply the remote bookmark updates, even if the old cloud remotebookmark is `None`.

* If the local repo is up-to-date with respect to the workspace, but the last sync state had no remote bookmarks recorded, sync the remote bookmarks again.  This may involve pulling some more commits if the cloud remote bookmarks are ahead of the local remote bookmarks. If there truly were no remote bookmarks then this will be a no-op.

Reviewed By: quark-zju

Differential Revision: D20792360

fbshipit-source-id: cd1ed371d8d5b1be2767c8a8d4836ea870a4467b
2020-04-01 13:26:27 -07:00
Mark Thomas
0d4db87a26 cmdutil: add a hint for the new graph renderer
Summary: Add a hint that points to customization and troubleshooting guides for the new graph renderer.

Reviewed By: xavierd

Differential Revision: D20763338

fbshipit-source-id: ee6d2464ae5955f0f0bf52d1994adfa2b74b3367
2020-03-31 09:57:44 -07:00
Thomas Orozco
250695ba9b rage: disable colors
Summary:
This updates hg rage to disable colors while producing the hg rage. This makes
the pastes a little more readable since they won't contain escape codes.

Reviewed By: farnz

Differential Revision: D20738945

fbshipit-source-id: e323834beb6458083642e34a40afa3d896288b42
2020-03-30 11:31:33 -07:00
Xavier Deguillard
2c052d055d eden: commitpending doesn't exist in ContentStore
Summary:
Instead, it's present in the fileslog. Use that instead.

This is the error I just got while doing a `hg top`:
error updating fbcode/eden/scm/lib/revisionstore/src/contentstore.rs: facebook::eden::HgImportPyError: AttributeError: 'bindings.revisionstore.contentstore' object has no attribute 'commitpending'

Reviewed By: quark-zju

Differential Revision: D20715560

fbshipit-source-id: 59c4b62ae8d0f182824e126e68b174c0ef3cdba0
2020-03-30 09:05:36 -07:00
Jun Wu
9fe0bfd7c8 narrowheads: fix directaccess compatibility
Summary:
Similar to the previous diff.  Sometimes the narrow-heads config is on but the
dependencies are off (ex. remotenames, visibility). In that case narrow-heads
should be considered off. The repo init function takes care of that but code
paths before repo init needs special care.

Reviewed By: simpkins

Differential Revision: D20699684

fbshipit-source-id: befac335bde0be6b8a42a5a9f7cee1edbbef3c55
2020-03-27 12:55:07 -07:00
Jun Wu
ebdc3836b9 narrowheads: fix repo requirements at "hg init" time
Summary:
Some tests fail because `hg init` sets the wrong initial store requirements and
then perform a narrow-head migration down, which prints extra messages. Fix them
by making sure the initial store requirements are the same as what the migration
code path expects.

Reviewed By: simpkins

Differential Revision: D20698637

fbshipit-source-id: 1422a4ea78222617d0e3f9631ad883d5a3fe6bb7
2020-03-27 12:55:06 -07:00
Xavier Deguillard
d404b0a228 revisionstore: revamp repack to ease file format migration
Summary:
One of the main drawback of the current version of repack is that it writes
back the data to a packfile, making it hard to change file format. Currently, 2
file format changes are ongoing: moving away from packfiles entirely, and
moving from having LFS pointers stored in the packfiles, to a separate storage.

While an ad-hoc solution could be designed for this purpose, repack can
fullfill this goal easily by simply writing to the ContentStore, the
configuration of the ContentStore will then decide where this data will
be written into.

The main drawback of this code is the unfortunate added duplication of code.
I'm sure there is a way to avoid it by having new traits, I decided against it
for now from a code readability point of view.

Reviewed By: DurhamG

Differential Revision: D20567118

fbshipit-source-id: d67282dae31db93739e50f8cc64f9ecce92d2d30
2020-03-26 19:02:48 -07:00
Xavier Deguillard
cf650d232a remotefilelog: remove unnecessary argument to the Rust repacks
Summary: There is no need to pass the path twice, once is enough.

Reviewed By: DurhamG

Differential Revision: D20567117

fbshipit-source-id: 169a088aa7558b4c25f8fbdecfe59bdd0d7575ef
2020-03-26 19:02:48 -07:00
Jun Wu
8bd55436a4 pull: automatically pull selective bookmarks unless it's a no-argument pull
Summary:
This enforces certain selective pull logic in core. Namely, rewrite `pull -r X`
to `pull -r X -B master`.

Unlike selectivepull in remotenames, `pull` (pulls everything) won't be
rewritten to `pull -B master` (which pulls less commits and names).

Therefore this change always adds more commits to pull, and therefore should not
break existing users. Eventually we want the "not pulling everything" behavior,
but right now this just fixes `pull -r X` to also update important remote names.

Reviewed By: markbt

Differential Revision: D20531121

fbshipit-source-id: af457b5ddb1265b61956eb2ee6afb7b7208293e0
2020-03-26 10:54:09 -07:00
Jun Wu
e105af5a54 exchange: replace remotenames.important-names with selectivepull names
Summary: Now we have functions to get selectivepull names in core. Use that instead.

Reviewed By: markbt

Differential Revision: D20531118

fbshipit-source-id: a0c20c491baf1b0ad71e80f870703bb4b983f19c
2020-03-26 08:26:27 -07:00
Jun Wu
c7549d5b71 remotenames: move selective pull bookmarks calculation to core
Summary: This makes it possible for core to always pull related bookmarks.

Reviewed By: markbt

Differential Revision: D20531120

fbshipit-source-id: 52f0834b517e03567e240f57616370d79a227abe
2020-03-26 08:26:27 -07:00
Jun Wu
baae0138ff remotenames: move revset and templatekw to core
Summary:
This makes it possible to use template like `{remotenames}` or revset like
`remotenames()` without enabling the remotename extension.

Rarely used revsets like `upstream()` and `pushed()` are not moved.

Reviewed By: markbt

Differential Revision: D20529360

fbshipit-source-id: ea95b3324f974e112909cdd79ce662940a4f9b7c
2020-03-26 08:26:26 -07:00
Jun Wu
cc1b1bd6a9 remotenames: move namespace to core
Summary:
This makes it possible to resolve remotenames without enabling the remotenames
extension.

The config check `if repo.ui.configbool("remotenames", "bookmarks")` is dropped
intentionally as we only use remotenames for bookmarks, not named branches.

Since this only enables resolving more names, without disabling or changing
other features, and the remotename namespace priority is lower than local
bookmarks (ex. if a local `master` exists, then `master` will be using the
local bookmark, not the hoisted remote name), it should not cause breaking
changes.

Reviewed By: markbt

Differential Revision: D20529359

fbshipit-source-id: 4126faee1bb7f43ba547fab05dd6197b2e65c1fc
2020-03-26 08:26:26 -07:00