cleanup: make all the code compliant with the i18n rules for ui strings

Summary: This diff is part of a series to cleanup fb-hgext and make it pass check-code.

Test Plan: all tests pass

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2811887
This commit is contained in:
Laurent Charignon 2016-01-11 10:19:22 -08:00
parent 7830092e84
commit a27b0abfb8
12 changed files with 105 additions and 102 deletions

View File

@ -88,7 +88,7 @@ def _pushb2movedata(pushop, bundler):
return
data = _encodedict(dic)
repo.ui.status('moves for %d changesets pushed\n' % len(dic.keys()))
repo.ui.status(_('moves for %d changesets pushed\n') % len(dic.keys()))
part = bundler.newpart('push:movedata', data=data, mandatory=False)
@ -143,7 +143,7 @@ def _handlemovedatarequest(op, inpart):
"""
dic = _decodedict(inpart)
op.records.add('movedata', {'mvdict': dic})
op.repo.ui.warn('moves for %d changesets retrieved\n' % len(dic.keys()))
op.repo.ui.warn(_('moves for %d changesets retrieved\n') % len(dic.keys()))
try:
dbutil.insertrawdata(op.repo, dic)
except Exception as e:

View File

@ -14,7 +14,7 @@ def logfailure(repo, e, funcname, warning=True):
if warning:
warnmsg = ui.config('copytrace', 'exceptionmsg',
_("** unknown exception encountered with copytracing **\n"))
ui.warn(warnmsg)
ui.warn((warnmsg))
else:
if ui.verbose:
ui.warn(_("Error encountered. Falling back to old copytracing"))

View File

@ -10,6 +10,7 @@
from mercurial import scmutil
from mercurial.i18n import _
from mercurial import copies as copiesmod
import sqlite3
@ -134,11 +135,11 @@ def _fillctx(repo, ctxlist):
if not added:
return []
else:
repo.ui.warn("Loop:\n")
repo.ui.warn(_("Loop:\n"))
parents = []
for ctxhash in added:
ctx = repo[ctxhash]
repo.ui.warn("%s added\n" % ctxhash)
repo.ui.warn(_("%s added\n") % ctxhash)
parents.append(ctx.p1())
parents.append(ctx.p2())
return parents

View File

@ -128,15 +128,15 @@ def applytomirrors(repo, status, sourcepath, mirrors, action):
if (sourcepath not in wctx and mirrorpath not in wctx and
sourcepath in status.removed and mirrorpath in status.removed):
if repo.ui.verbose:
repo.ui.status("not mirroring remove of '%s' to '%s'; "
"it is already removed\n" %
(sourcepath, mirrorpath))
repo.ui.status(("not mirroring remove of '%s' to '%s';"
" it is already removed\n")
% (sourcepath, mirrorpath))
continue
if wctx[sourcepath].data() == wctx[mirrorpath].data():
if repo.ui.verbose:
repo.ui.status("not mirroring '%s' to '%s'; it already "
"matches\n" % (sourcepath, mirrorpath))
repo.ui.status(("not mirroring '%s' to '%s'; it already "
"matches\n") % (sourcepath, mirrorpath))
continue
raise error.Abort("path '%s' needs to be mirrored to '%s', but the "
"target already has pending changes" %
@ -152,6 +152,7 @@ def applytomirrors(repo, status, sourcepath, mirrors, action):
util.copyfile(fullsource, fulltarget)
if action == 'a':
dirstate.add(mirrorpath)
@ -160,18 +161,19 @@ def applytomirrors(repo, status, sourcepath, mirrors, action):
if copysource and copysource.startswith(sourcemirror):
mirrorcopysource = mirror + copysource[len(sourcemirror):]
dirstate.copy(mirrorcopysource, mirrorpath)
repo.ui.status("mirrored copy '%s -> %s' to '%s -> %s'\n" %
(copysource, sourcepath,
repo.ui.status(("mirrored copy '%s -> %s' to '%s -> %s'\n")
% (copysource, sourcepath,
mirrorcopysource, mirrorpath))
else:
repo.ui.status("mirrored adding '%s' to '%s'\n" %
repo.ui.status(("mirrored adding '%s' to '%s'\n") %
(sourcepath, mirrorpath))
else:
repo.ui.status("mirrored changes in '%s' to '%s'\n" %
repo.ui.status(("mirrored changes in '%s' to '%s'\n") %
(sourcepath, mirrorpath))
elif action == 'r':
util.unlink(fulltarget)
dirstate.remove(mirrorpath)
repo.ui.status("mirrored remove of '%s' to '%s'\n" % (sourcepath, mirrorpath))
repo.ui.status(("mirrored remove of '%s' to '%s'\n")
% (sourcepath, mirrorpath))
return mirroredfiles

View File

@ -42,7 +42,7 @@ def uisetup(ui):
try:
rebasemod = extensions.find('rebase')
except KeyError:
ui.warn("no rebase extension detected - disabling fbamend")
ui.warn(_("no rebase extension detected - disabling fbamend"))
return
entry = extensions.wrapcommand(commands.table, 'commit', commit)
@ -223,10 +223,10 @@ def fixupamend(ui, repo):
preamendname = _preamendname(repo, current.node())
if not preamendname in repo._bookmarks:
raise error.Abort(_('no bookmark %s' % preamendname),
raise error.Abort(_('no bookmark %s') % preamendname,
hint=_('check if your bookmark is active'))
ui.status("rebasing the children of %s\n" % (preamendname))
ui.status(_("rebasing the children of %s\n") % (preamendname))
old = repo[preamendname]
oldbookmarks = old.bookmarks()

View File

@ -35,7 +35,7 @@ def extsetup(ui):
conduit_protocol = ui.config('fbconduit', 'protocol')
if not conduit_host:
ui.warn('No conduit host specified in config; disabling fbconduit\n')
ui.warn(('No conduit host specified in config; disabling fbconduit\n'))
return
if not conduit_protocol:
conduit_protocol = 'https'
@ -118,7 +118,7 @@ def mirrornode(ctx, mapping, args):
)
except ConduitError as e:
if 'unknown revision' not in str(e.args):
mapping['repo'].ui.warn(str(e.args) + '\n')
mapping['repo'].ui.warn((str(e.args) + '\n'))
return ''
return result.get(node, '')
@ -195,7 +195,7 @@ def gitnode(repo, subset, x):
translationerror = True
if translationerror or result[n] == "":
repo.ui.warn("Could not translate revision {0}.\n".format(n))
repo.ui.warn(("Could not translate revision {0}.\n".format(n)))
return subset.filter(lambda r: False)
rn = repo[node.bin(result[n])].rev()

View File

@ -90,7 +90,7 @@ def parseoptions(ui, cmdoptions, args):
"Please try passing the option as it's own flag: -{0}" \
.format(ex.opt))
ui.warn("ignoring unknown option %s\n" % flag)
ui.warn(_("ignoring unknown option %s\n") % flag)
args = list([convert(x) for x in args])
opts = dict([(k, convert(v)) if isinstance(v, str) else (k, v)
@ -168,10 +168,10 @@ def add(ui, repo, *args, **kwargs):
ui.status(_("note: use hg addremove to remove files that have "
"been deleted.\n\n"))
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def bisect(ui, repo, *args, **kwargs):
ui.status("See 'hg help bisect' for how to use bisect.\n\n")
ui.status(_("See 'hg help bisect' for how to use bisect.\n\n"))
def blame(ui, repo, *args, **kwargs):
cmdoptions = [
@ -179,7 +179,7 @@ def blame(ui, repo, *args, **kwargs):
args, opts = parseoptions(ui, cmdoptions, args)
cmd = Command('annotate')
cmd.extend([convert(v) for v in args])
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def branch(ui, repo, *args, **kwargs):
cmdoptions = [
@ -195,7 +195,7 @@ def branch(ui, repo, *args, **kwargs):
cmd = Command("bookmark")
if opts.get('set_upstream') or opts.get('set_upstream_to'):
ui.status("Mercurial has no concept of upstream branches\n")
ui.status(_("Mercurial has no concept of upstream branches\n"))
return
elif opts.get('delete'):
cmd['-d'] = None
@ -218,7 +218,7 @@ def branch(ui, repo, *args, **kwargs):
cmd.append(args[0])
elif len(args) == 1:
cmd.append(args[0])
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def ispath(repo, string):
"""
@ -291,7 +291,7 @@ def checkout(ui, repo, *args, **kwargs):
cmd = cmd & bookcmd
# if there is any path argument supplied, use revert instead of update
elif len(paths) > 0:
ui.status("note: use --no-backup to avoid creating .orig files\n\n")
ui.status(_("note: use --no-backup to avoid creating .orig files\n\n"))
cmd = Command('revert')
if opts.get('patch'):
cmd['-i'] = None
@ -309,7 +309,7 @@ def checkout(ui, repo, *args, **kwargs):
else:
raise GitUnknownError("a commit must be specified")
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def cherrypick(ui, repo, *args, **kwargs):
cmdoptions = [
@ -331,7 +331,7 @@ def cherrypick(ui, repo, *args, **kwargs):
else:
cmd.extend(args)
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def clean(ui, repo, *args, **kwargs):
cmdoptions = [
@ -346,7 +346,7 @@ def clean(ui, repo, *args, **kwargs):
cmd['--all'] = None
cmd.extend(args)
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def clone(ui, repo, *args, **kwargs):
cmdoptions = [
@ -366,8 +366,8 @@ def clone(ui, repo, *args, **kwargs):
if opts.get('bare'):
cmd['-U'] = None
ui.status("note: Mercurial does not have bare clones. " +
"-U will clone the repo without checking out a commit\n\n")
ui.status(_("note: Mercurial does not have bare clones. " +
"-U will clone the repo without checking out a commit\n\n"))
elif opts.get('no_checkout'):
cmd['-U'] = None
@ -376,7 +376,7 @@ def clone(ui, repo, *args, **kwargs):
cocmd.append(opts.get('branch'))
cmd = cmd & cocmd
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def commit(ui, repo, *args, **kwargs):
cmdoptions = [
@ -405,9 +405,9 @@ def commit(ui, repo, *args, **kwargs):
cmd['-m'] = "'%s'" % (opts.get('message'),)
if opts.get('all'):
ui.status("note: Mercurial doesn't have a staging area, " +
ui.status(_("note: Mercurial doesn't have a staging area, " +
"so there is no --all. -A will add and remove files " +
"for you though.\n\n")
"for you though.\n\n"))
if opts.get('file'):
cmd['-l'] = opts.get('file')
@ -420,11 +420,11 @@ def commit(ui, repo, *args, **kwargs):
cmd.extend(args)
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def deprecated(ui, repo, *args, **kwargs):
ui.warn('This command has been deprecated in the git project, ' +
'thus isn\'t supported by this tool.\n\n')
ui.warn(_('This command has been deprecated in the git project, ' +
'thus isn\'t supported by this tool.\n\n'))
def diff(ui, repo, *args, **kwargs):
cmdoptions = [
@ -437,8 +437,8 @@ def diff(ui, repo, *args, **kwargs):
cmd = Command('diff')
if opts.get('cached'):
ui.status('note: Mercurial has no concept of a staging area, ' +
'so --cached does nothing.\n\n')
ui.status(_('note: Mercurial has no concept of a staging area, ' +
'so --cached does nothing.\n\n'))
if opts.get('reverse'):
cmd['--reverse'] = None
@ -451,16 +451,16 @@ def diff(ui, repo, *args, **kwargs):
except Exception:
cmd.append(a)
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def difftool(ui, repo, *args, **kwargs):
ui.status('Mercurial does not enable external difftool by default. You '
ui.status(_('Mercurial does not enable external difftool by default. You '
'need to enable the extdiff extension in your .hgrc file by adding\n'
'extdiff =\n'
'to the [extensions] section and then running\n\n'
'hg extdiff -p <program>\n\n'
'See \'hg help extdiff\' and \'hg help -e extdiff\' for more '
'information.\n')
'information.\n'))
def fetch(ui, repo, *args, **kwargs):
cmdoptions = [
@ -484,7 +484,7 @@ def fetch(ui, repo, *args, **kwargs):
else:
cmd['-r'] = v
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def grep(ui, repo, *args, **kwargs):
cmdoptions = [
@ -497,7 +497,7 @@ def grep(ui, repo, *args, **kwargs):
# pattern first, followed by paths.
cmd.extend(args)
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def init(ui, repo, *args, **kwargs):
cmdoptions = [
@ -509,7 +509,7 @@ def init(ui, repo, *args, **kwargs):
if len(args) > 0:
cmd.append(args[0])
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def log(ui, repo, *args, **kwargs):
cmdoptions = [
@ -525,10 +525,10 @@ def log(ui, repo, *args, **kwargs):
('p', 'patch', None, ''),
]
args, opts = parseoptions(ui, cmdoptions, args)
ui.status('note: -v prints the entire commit message like Git does. To ' +
'print just the first line, drop the -v.\n\n')
ui.status("note: see hg help revset for information on how to filter " +
"log output.\n\n")
ui.status(_('note: -v prints the entire commit message like Git does. To ' +
'print just the first line, drop the -v.\n\n'))
ui.status(_("note: see hg help revset for information on how to filter " +
"log output.\n\n"))
cmd = Command('log')
cmd['-v'] = None
@ -547,8 +547,8 @@ def log(ui, repo, *args, **kwargs):
if opts.get('pretty') or opts.get('format') or opts.get('oneline'):
format = opts.get('format', '')
if 'format:' in format:
ui.status("note: --format format:??? equates to Mercurial's " +
"--template. See hg help templates for more info.\n\n")
ui.status(_("note: --format format:??? equates to Mercurial's " +
"--template. See hg help templates for more info.\n\n"))
cmd['--template'] = '???'
else:
ui.status(_("note: --pretty/format/oneline equate to Mercurial's " +
@ -563,7 +563,7 @@ def log(ui, repo, *args, **kwargs):
del args[0]
cmd.extend(args)
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def lsfiles(ui, repo, *args, **kwargs):
cmdoptions = [
@ -591,15 +591,15 @@ def lsfiles(ui, repo, *args, **kwargs):
else:
cmd = Command('files')
if opts.get('stage'):
ui.status("note: Mercurial doesn't have a staging area, ignoring "
"--stage\n")
ui.status(_("note: Mercurial doesn't have a staging area, ignoring "
"--stage\n"))
if opts.get('_zero'):
cmd['-0'] = None
cmd.append('.')
for include in args:
cmd['-I'] = util.shellquote(include)
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def merge(ui, repo, *args, **kwargs):
cmdoptions = [
@ -611,7 +611,7 @@ def merge(ui, repo, *args, **kwargs):
if len(args) > 0:
cmd.append(args[len(args) - 1])
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def mergebase(ui, repo, *args, **kwargs):
cmdoptions = []
@ -623,9 +623,9 @@ def mergebase(ui, repo, *args, **kwargs):
cmd = Command("log -T '{node}\\n' -r 'ancestor(%s,%s)'"
% (args[0], args[1]))
ui.status('NOTE: ancestors() is part of the revset language.\n',
"Learn more about revsets with 'hg help revsets'\n\n")
ui.status(str(cmd), "\n")
ui.status(_('NOTE: ancestors() is part of the revset language.\n',
"Learn more about revsets with 'hg help revsets'\n\n"))
ui.status((str(cmd)), "\n")
def mergetool(ui, repo, *args, **kwargs):
cmdoptions = []
@ -636,7 +636,7 @@ def mergetool(ui, repo, *args, **kwargs):
if len(args) == 0:
cmd['--all'] = None
cmd.extend(args)
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def mv(ui, repo, *args, **kwargs):
cmdoptions = [
@ -650,7 +650,7 @@ def mv(ui, repo, *args, **kwargs):
if opts.get('force'):
cmd['-f'] = None
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def pull(ui, repo, *args, **kwargs):
cmdoptions = [
@ -676,7 +676,7 @@ def pull(ui, repo, *args, **kwargs):
else:
cmd['-r'] = v
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def push(ui, repo, *args, **kwargs):
cmdoptions = [
@ -703,7 +703,7 @@ def push(ui, repo, *args, **kwargs):
if opts.get('force'):
cmd['-f'] = None
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def rebase(ui, repo, *args, **kwargs):
cmdoptions = [
@ -717,8 +717,8 @@ def rebase(ui, repo, *args, **kwargs):
args, opts = parseoptions(ui, cmdoptions, args)
if opts.get('interactive'):
ui.status("note: hg histedit does not perform a rebase. " +
"It just edits history.\n\n")
ui.status(_("note: hg histedit does not perform a rebase. " +
"It just edits history.\n\n"))
cmd = Command('histedit')
if len(args) > 0:
ui.status(_("also note: 'hg histedit' will automatically detect"
@ -728,7 +728,7 @@ def rebase(ui, repo, *args, **kwargs):
if opts.get('skip'):
cmd = Command('revert --all -r .')
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
cmd = Command('rebase')
@ -752,7 +752,7 @@ def rebase(ui, repo, *args, **kwargs):
cmd['-d'] = convert(args[0])
cmd['-b'] = convert(args[1])
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def reflog(ui, repo, *args, **kwargs):
cmdoptions = [
@ -792,7 +792,7 @@ def reset(ui, repo, *args, **kwargs):
cmd.append('--clean')
cmd.append(commit)
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def revert(ui, repo, *args, **kwargs):
cmdoptions = [
@ -807,7 +807,7 @@ def revert(ui, repo, *args, **kwargs):
if args:
cmd.append(args[0])
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def revparse(ui, repo, *args, **kwargs):
cmdoptions = [
@ -819,10 +819,10 @@ def revparse(ui, repo, *args, **kwargs):
if opts.get('show_cdup') or opts.get('show_toplevel'):
cmd = Command('root')
if opts.get('show_cdup'):
ui.status("note: hg root prints the root of the repository\n\n")
ui.status(str(cmd), "\n")
ui.status(_("note: hg root prints the root of the repository\n\n"))
ui.status((str(cmd)), "\n")
else:
ui.status("note: see hg help revset for how to refer to commits\n")
ui.status(_("note: see hg help revset for how to refer to commits\n"))
def rm(ui, repo, *args, **kwargs):
cmdoptions = [
@ -839,7 +839,7 @@ def rm(ui, repo, *args, **kwargs):
if opts.get('dry_run'):
cmd['-n'] = None
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def show(ui, repo, *args, **kwargs):
cmdoptions = [
@ -864,7 +864,7 @@ def show(ui, repo, *args, **kwargs):
cmd['-r'] = '".^"'
cmd.append(showarg)
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def stash(ui, repo, *args, **kwargs):
cmdoptions = [
@ -890,8 +890,8 @@ def stash(ui, repo, *args, **kwargs):
cmd['--keep'] = None
elif (action == 'branch' or action == 'show' or action == 'clear'
or action == 'create'):
ui.status("note: Mercurial doesn't have equivalents to the " +
"git stash branch, show, clear, or create actions.\n\n")
ui.status(_("note: Mercurial doesn't have equivalents to the " +
"git stash branch, show, clear, or create actions.\n\n"))
return
else:
if len(args) > 0:
@ -900,7 +900,7 @@ def stash(ui, repo, *args, **kwargs):
elif len(args) > 1:
cmd['--name'] = args[1]
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def status(ui, repo, *args, **kwargs):
cmdoptions = [
@ -914,12 +914,12 @@ def status(ui, repo, *args, **kwargs):
if opts.get('ignored'):
cmd['-i'] = None
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def svn(ui, repo, *args, **kwargs):
svncmd = args[0]
if not svncmd in gitsvncommands:
ui.warn("error: unknown git svn command %s\n" % (svncmd))
ui.warn(_("error: unknown git svn command %s\n") % (svncmd))
args = args[1:]
return gitsvncommands[svncmd](ui, repo, *args, **kwargs)
@ -931,7 +931,7 @@ def svndcommit(ui, repo, *args, **kwargs):
cmd = Command('push')
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def svnfetch(ui, repo, *args, **kwargs):
cmdoptions = [
@ -941,7 +941,7 @@ def svnfetch(ui, repo, *args, **kwargs):
cmd = Command('pull')
cmd.append('default-push')
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def svnfindrev(ui, repo, *args, **kwargs):
cmdoptions = [
@ -951,7 +951,7 @@ def svnfindrev(ui, repo, *args, **kwargs):
cmd = Command('log')
cmd['-r'] = args[0]
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def svnrebase(ui, repo, *args, **kwargs):
cmdoptions = [
@ -966,7 +966,7 @@ def svnrebase(ui, repo, *args, **kwargs):
cmd = pullcmd & rebasecmd
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
def tag(ui, repo, *args, **kwargs):
cmdoptions = [
@ -990,7 +990,7 @@ def tag(ui, repo, *args, **kwargs):
if opts.get('force'):
cmd['-f'] = None
ui.status(str(cmd), "\n")
ui.status((str(cmd)), "\n")
gitcommands = {
'add': add,

View File

@ -128,7 +128,7 @@ def prunemanifestdiskcache(ui, repo):
if odds < random.random():
# no pruning.
ui.note("no pruning needed at this time.")
ui.note(_("no pruning needed at this time."))
return
# update the file timestamp.

View File

@ -321,7 +321,7 @@ def _getrevs(bundle, onto):
if not sharedparents:
return revs, bundle[nullid]
raise error.Abort(_('pushed commits do not branch from an ancestor '
'of the desired destination %s' % onto.hex()))
'of the desired destination %s') % onto.hex())
oldonto = oldonto[0]
# Computes a list of all files that are in the changegroup, and diffs it
@ -529,16 +529,16 @@ def bundle2rebase(op, part):
# Notify the user of what is being pushed
plural = 's' if len(revs) > 1 else ''
op.repo.ui.warn("pushing %s commit%s:\n" % (len(revs), plural))
op.repo.ui.warn(_("pushing %s commit%s:\n") % (len(revs), plural))
maxoutput = 10
for i in range(0, min(len(revs), maxoutput)):
firstline = bundle[revs[i]].description().split('\n')[0][:50]
op.repo.ui.warn(" %s %s\n" % (revs[i], firstline))
op.repo.ui.warn((" %s %s\n") % (revs[i], firstline))
if len(revs) > maxoutput + 1:
op.repo.ui.warn(" ...\n")
op.repo.ui.warn((" ...\n"))
firstline = bundle[revs[-1]].description().split('\n')[0][:50]
op.repo.ui.warn(" %s %s\n" % (revs[-1], firstline))
op.repo.ui.warn((" %s %s\n") % (revs[-1], firstline))
for rev in revs:
newrev = _graft(op.repo, rev, mapping)

View File

@ -330,8 +330,8 @@ def _wraprepo(ui, repo):
elif line:
if line.strip().startswith('/'):
self.ui.warn(_('warning: sparse profile cannot use' +
' paths starting with /, ignoring %s\n' %
line))
' paths starting with /, ignoring %s\n')
% line)
continue
current.add(line)
@ -640,8 +640,8 @@ def sparse(ui, repo, *pats, **opts):
ui.status(repo.opener.read("sparse") + "\n")
temporaryincludes = repo.gettemporaryincludes()
if temporaryincludes:
ui.status("Temporarily Included Files (for merge/rebase):\n")
ui.status("\n".join(temporaryincludes) + "\n")
ui.status(_("Temporarily Included Files (for merge/rebase):\n"))
ui.status(("\n".join(temporaryincludes) + "\n"))
else:
ui.status(_('repo is not sparse\n'))
return
@ -689,8 +689,8 @@ def _config(ui, repo, pats, include=False, exclude=False, reset=False,
oldstatus = repo.status()
if any(pat.startswith('/') for pat in pats):
ui.warn(_('warning: paths cannot start with /, ignoring: %s\n'
% ([pat for pat in pats if pat.startswith('/')])))
ui.warn(_('warning: paths cannot start with /, ignoring: %s\n')
% ([pat for pat in pats if pat.startswith('/')]))
elif include:
newinclude.update(pats)
elif exclude:

View File

@ -1,5 +1,5 @@
def uisetup(ui):
ui.write("ext1: uisetup\n")
ui.write(("ext1: uisetup\n"))
def extsetup(ui):
ui.write("ext1: extsetup\n")
ui.write(("ext1: extsetup\n"))

View File

@ -1,5 +1,5 @@
def uisetup(ui):
ui.write("ext2: uisetup\n")
ui.write(("ext2: uisetup\n"))
def extsetup(ui):
ui.write("ext2: extsetup\n")
ui.write(("ext2: extsetup\n"))