Read about our upcoming Code of Conduct on this issue

Commit 62a986f9 authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

python3: add byte prefix for objects that look like kwargs but aren't

The `byteify-strings.py` script has no way of knowing that those aren't
acutally kwargs since it works purely at the tokenization level, so we
have to add the byte prefix to their keys manually.
parent dc403312a012
......@@ -843,7 +843,7 @@ def tryimportone(orig, ui, repo, hunk, parents, opts, *args, **kwargs):
_getnodefrompatch(hunk, expected)
ret = orig(ui, repo, hunk, parents, opts, *args, **kwargs)
created = ret[1]
if (opts['obsolete'] and None not in (created, expected['node'])
if (opts[b'obsolete'] and None not in (created, expected['node'])
and created != expected['node']):
tr = repo.transaction('import-obs')
try:
......
......@@ -65,7 +65,7 @@ def addgetbundleargs(self):
def _addobscommontob2pull(orig, pullop, kwargs):
ret = orig(pullop, kwargs)
ui = pullop.repo.ui
if ('obsmarkers' in kwargs
if (b'obsmarkers' in kwargs
and pullop.remote.capable('_evoext_getbundle_obscommon')):
boundaries = obsdiscovery.buildpullobsmarkersboundaries(pullop)
if 'common' in boundaries:
......@@ -73,13 +73,13 @@ def _addobscommontob2pull(orig, pullop, kwargs):
if common != pullop.common:
obsexcmsg(ui, 'request obsmarkers for some common nodes\n')
if common != [node.nullid]:
kwargs['evo_obscommon'] = common
kwargs[b'evo_obscommon'] = common
elif 'missing' in boundaries:
missing = boundaries['missing']
if missing:
obsexcmsg(ui, 'request obsmarkers for %d common nodes\n'
% len(missing))
kwargs['evo_missing_nodes'] = missing
kwargs[b'evo_missing_nodes'] = missing
return ret
def _getbundleobsmarkerpart(orig, bundler, repo, source, **kwargs):
......
......@@ -218,12 +218,12 @@ def rewrite(repo, old, updates, head, newbases, commitopts):
if not message:
message = old.description()
user = commitopts.get('user') or old.user()
user = commitopts.get(b'user') or old.user()
# TODO: In case not date is given, we should take the old commit date
# if we are working one one changeset or mimic the fold behavior about
# date
date = commitopts.get('date') or None
extra = dict(commitopts.get('extra', old.extra()))
date = commitopts.get(b'date') or None
extra = dict(commitopts.get(b'extra', old.extra()))
extra['branch'] = head.branch()
new = context.memctx(repo,
......@@ -235,7 +235,7 @@ def rewrite(repo, old, updates, head, newbases, commitopts):
date=date,
extra=extra)
if commitopts.get('edit'):
if commitopts.get(b'edit'):
new._text = cmdutil.commitforceeditor(repo, new, [])
revcount = len(repo)
newid = repo.commitctx(new)
......
......@@ -317,7 +317,7 @@ def showstack(ui, repo, branch=None, topic=None, opts=None):
symbol = None
states = []
if opts.get('children'):
if opts.get(b'children'):
expr = 'children(%d) and merge() - %ld'
revisions = repo.revs(expr, ctx.rev(), st._revs)
if len(revisions) > 0:
......
......@@ -111,7 +111,7 @@ def commitstatus(orig, repo, node, branch, bheads=None, opts=None):
return ret
parents = ctx.parents()
if (not opts.get('amend') and bheads and node not in bheads and not
if (not opts.get(b'amend') and bheads and node not in bheads and not
[x for x in parents if x.node() in bheads and x.branch() == branch]):
repo.ui.status(_("(consider using topic for lightweight branches."
" See 'hg help topic')\n"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment