1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-19 00:18:50 +02:00

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
This commit is contained in:
epriestley 2020-07-07 10:12:09 -07:00
parent a28e76b7b3
commit 41774ba9cc
2 changed files with 11 additions and 9 deletions

View file

@ -116,7 +116,7 @@ final class ArcanistMercurialLandEngine
throw new PhutilArgumentUsageException(
pht(
'Symbol "%s" is ambiguous.',
$symbol));
$raw_symbol));
}
$marker = head($named_markers);
@ -493,6 +493,7 @@ final class ArcanistMercurialLandEngine
}
protected function selectIntoCommit() {
$api = $this->getRepositoryAPI();
$log = $this->getLogEngine();
if ($this->getIntoEmpty()) {
@ -508,7 +509,6 @@ final class ArcanistMercurialLandEngine
if ($this->getIntoLocal()) {
// If we're running under "--into-local", just make sure that the
// target identifies some actual commit.
$api = $this->getRepositoryAPI();
$local_ref = $this->getIntoRef();
// TODO: This error handling could probably be cleaner, it will just
@ -834,7 +834,7 @@ final class ArcanistMercurialLandEngine
try {
foreach ($body as $command) {
$this->newPasthru('%Ls', $command);
$this->newPassthru('%Ls', $command);
}
} finally {
foreach ($tail as $command) {

View file

@ -31,9 +31,9 @@ command = registrar.command(cmdtable)
@command(
b'arc-ls-markers',
[(b'', b'output', b'',
_('file to output refs to'), _('FILE')),
_(b'file to output refs to'), _(b'FILE')),
] + cmdutil.remoteopts,
_('[--output FILENAME] [SOURCE]'))
_(b'[--output FILENAME] [SOURCE]'))
def lsmarkers(ui, repo, source=None, **opts):
"""list markers
@ -166,7 +166,7 @@ def localmarkers(ui, repo):
'isClosed': False,
'isTip': False,
'isCurrent': True,
'description': repo['.'].description(),
'description': repo[b'.'].description(),
})
return markers
@ -181,7 +181,7 @@ def remotemarkers(ui, repo, source, opts):
remote = hg.peer(repo, opts, source)
with remote.commandexecutor() as e:
branchmap = e.callcommand('branchmap', {}).result()
branchmap = e.callcommand(b'branchmap', {}).result()
for branch_name in branchmap:
for branch_node in branchmap[branch_name]:
@ -189,11 +189,12 @@ def remotemarkers(ui, repo, source, opts):
'type': 'branch',
'name': branch_name,
'node': node.hex(branch_node),
'description': None,
})
with remote.commandexecutor() as e:
remotemarks = bookmarks.unhexlifybookmarks(e.callcommand('listkeys', {
'namespace': 'bookmarks',
remotemarks = bookmarks.unhexlifybookmarks(e.callcommand(b'listkeys', {
b'namespace': b'bookmarks',
}).result())
for mark in remotemarks:
@ -201,6 +202,7 @@ def remotemarkers(ui, repo, source, opts):
'type': 'bookmark',
'name': mark,
'node': node.hex(remotemarks[mark]),
'description': None,
})
return markers