1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-10-24 01:28:51 +02:00
Commit graph

5 commits

Author SHA1 Message Date
epriestley
41774ba9cc Fix additional Mercurial/Python compatibility issues in "arc land"
Summary:
Ref PHI1805. Under some combination of versions (Python 3.8?), "arc-ls-markers" is running into additional Python runtime issues.

Sprinkle more "b" around to resolve them? Also clean up a couple of plain "arc" issues.

Test Plan:
Landed a change in Mercurial.

Some of this works fine without changes in Python 3.7/2.7 against Mercurial 4.7/5.4, so this may not be exhaustive.

Differential Revision: https://secure.phabricator.com/D21393
2020-07-07 10:20:41 -07:00
epriestley
a28e76b7b3 Allow "hg arc-ls-markers" to run under Python 2 or Python 3
Summary:
Ref T13546. See PHI1805. Currently, the "arc-ls-markers" extension doesn't run under Python 3:

  - some stuff needs "b'...'" to mark it as a byte string;
  - "dict.iteritems()" is gone in Python 3, and "mercurial.pycompat" isn't always available;
  - in Python 3, "json" refuses to print byte strings; and
  - the compiler caching behavior in Python 3 has changed.

Try to get these things working in the same way under Python 2 and Python 3.

Test Plan:
Ran this command (with `python` as Python 2, locally):

```
$ python /usr/local/bin/hg --config 'extensions.arc-hg=/Users/epriestley/dev/core/lib/arcanist/support/hg/arc-hg.py' arc-ls-markers --
```

...and this command:

```
$ python3 /usr/local/bin/hg --config 'extensions.arc-hg=/Users/epriestley/dev/core/lib/arcanist/support/hg/arc-hg.py' arc-ls-markers --
```

..and saw the same output in both cases (previously, `python3 ...` fataled in various ways).

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21392
2020-07-06 15:29:35 -07:00
epriestley
86951ad067 Use a "branchmap" call to identify remote branches in "arc-hg"
Summary:
Ref T9948. Ref T13546. To identify remote branch heads -- not just modified heads -- use "branchmap" like "hg outgoing" does.

I wasn't able to find any other way to get what we want: for example, with a bundlerepo, "peer.heads()" and "peer.changelog.heads()" include local branches which are not present in the remote.

It generally seems difficult (perhaps impossible?) to distinguish between these cases by using "getremotechanges()":

  - branch X exists at position Y in both the local and remote;
  - branch X exists at positino Y in the local, but not the remote.

In any case, this seems to work properly and //should// do less work than "getremotechanges()" since we don't need to pull as much data over the wire.

Test Plan: Ran "hg arc-ls-markers" in various repositories, got what appeared to be a faithful representation of the remote branch and bookmark state.

Maniphest Tasks: T13546, T9948

Differential Revision: https://secure.phabricator.com/D21349
2020-06-10 17:31:50 -07:00
epriestley
488a24c40a In "arc land" in Mercurial, inch closer to making complex branch/bookmark workflows function
Summary:
Ref T9948. Ref T13546. This change moves toward a functional "arc land" in Mercurial.

Because of how "bundlerepo.getremotechanges()" works, "hg arc-ls-markers" does not actually list markers in the remote that aren't different from local markers so it's hard to get anywhere with this.

Test Plan: Got somewhat-encouraging output from "arc land" and "hg arc-ls-markers", but too many things are still broken for this to really work yet.

Maniphest Tasks: T13546, T9948

Differential Revision: https://secure.phabricator.com/D21348
2020-06-10 17:31:50 -07:00
epriestley
b1f807f7ca Disambiguate various types of Mercurial remote markers with "hg arc-ls-remote"
Summary: Ref T13546. Ref T9948. It seems challenging to examine a remote in vanilla Mercurial. Provide an "hg arc-ls-remote" command which functions like "git ls-remote" so we can figure out if "--into X" is a bookmark, branch, both, neither, or a branch with multiple heads without mutating the working copy as a side effect.

Test Plan: Ran various "arc land --into ..." commands in a Mercurial working copy, saw apparently-sensible resolution of remote marker names.

Maniphest Tasks: T13546, T9948

Differential Revision: https://secure.phabricator.com/D21343
2020-06-10 10:27:17 -07:00