diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -39,7 +39,7 @@ class bundlerevlog(revlog.revlog): for chunk, start in chunkpositer(): size = len(chunk) if size < 80: - raise util.Abort("invalid changegroup") + raise util.Abort(_("invalid changegroup")) start += 80 size -= 80 node, p1, p2, cs = struct.unpack("20s20s20s20s", chunk[:80]) diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -936,7 +936,7 @@ def finddate(ui, repo, date): results[rev] = d elif st == 'iter': if rev in results: - ui.status("Found revision %s from %s\n" % + ui.status(_("Found revision %s from %s\n") % (rev, util.datestr(results[rev]))) return str(rev) diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2129,7 +2129,7 @@ def push(ui, repo, dest=None, **opts): cmdutil.setremoteconfig(ui, opts) other = hg.repository(ui, dest) - ui.status('pushing to %s\n' % util.hidepassword(dest)) + ui.status(_('pushing to %s\n') % util.hidepassword(dest)) if revs: revs = [repo.lookup(rev) for rev in revs] r = repo.push(other, opts['force'], revs=revs) diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py --- a/mercurial/hgweb/server.py +++ b/mercurial/hgweb/server.py @@ -259,7 +259,7 @@ def create_server(ui, repo): from OpenSSL import SSL ctx = SSL.Context(SSL.SSLv23_METHOD) except ImportError: - raise util.Abort("SSL support is unavailable") + raise util.Abort(_("SSL support is unavailable")) ctx.use_privatekey_file(ssl_cert) ctx.use_certificate_file(ssl_cert) sock = socket.socket(self.address_family, self.socket_type) diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1098,7 +1098,7 @@ class localrepository(repo.repository): wlock = self.wlock() for f in list: if self.dirstate[f] != 'r': - self.ui.warn("%s not removed!\n" % f) + self.ui.warn(_("%s not removed!\n") % f) else: m = f in manifests[0] and manifests[0] or manifests[1] t = self.file(f).read(m[f]) @@ -2022,7 +2022,7 @@ class localrepository(repo.repository): except ValueError, TypeError: raise util.UnexpectedOutput( _('Unexpected response from remote server:'), l) - self.ui.debug('adding %s (%s)\n' % (name, util.bytecount(size))) + self.ui.debug(_('adding %s (%s)\n') % (name, util.bytecount(size))) ofp = self.sopener(name, 'w') for chunk in util.filechunkiter(fp, limit=size): ofp.write(chunk) diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -347,7 +347,7 @@ def applyupdates(repo, action, wctx, mct updated += 1 elif m == "dr": # divergent renames fl = a[2] - repo.ui.warn("warning: detected divergent renames of %s to:\n" % f) + repo.ui.warn(_("warning: detected divergent renames of %s to:\n") % f) for nf in fl: repo.ui.warn(" %s\n" % nf) elif m == "e": # exec diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -229,7 +229,7 @@ def patch(patchname, ui, strip=1, cwd=No return internalpatch(patchname, ui, strip, cwd, files) except NoHunks: patcher = util.find_exe('gpatch') or util.find_exe('patch') - ui.debug('no valid hunks found; trying with %r instead\n' % + ui.debug(_('no valid hunks found; trying with %r instead\n') % patcher) if util.needbinarypatch(): args.append('--binary') diff --git a/mercurial/repair.py b/mercurial/repair.py --- a/mercurial/repair.py +++ b/mercurial/repair.py @@ -8,6 +8,7 @@ import changegroup, os from node import nullrev, short +from i18n import _ def _bundle(repo, bases, heads, node, suffix, extranodes=None): """create a bundle with the specified revisions as a backup""" @@ -16,7 +17,7 @@ def _bundle(repo, bases, heads, node, su if not os.path.isdir(backupdir): os.mkdir(backupdir) name = os.path.join(backupdir, "%s-%s" % (short(node), suffix)) - repo.ui.warn("saving bundle to %s\n" % name) + repo.ui.warn(_("saving bundle to %s\n") % name) return changegroup.writebundle(cg, name, "HG10BZ") def _collectfiles(repo, striprev): @@ -125,7 +126,7 @@ def strip(ui, repo, node, backup="all"): f.strip(striprev) if saveheads or extranodes: - ui.status("adding branch\n") + ui.status(_("adding branch\n")) f = open(chgrpfile, "rb") gen = changegroup.readbundle(f, chgrpfile) repo.addchangegroup(gen, 'strip', 'bundle:' + chgrpfile, True) diff --git a/mercurial/sshrepo.py b/mercurial/sshrepo.py --- a/mercurial/sshrepo.py +++ b/mercurial/sshrepo.py @@ -42,7 +42,7 @@ class sshrepository(repo.repository): cmd = '%s %s "%s init %s"' cmd = cmd % (sshcmd, args, remotecmd, self.path) - ui.note('running %s\n' % cmd) + ui.note(_('running %s\n') % cmd) res = util.system(cmd) if res != 0: self.raise_(repo.RepoError(_("could not create remote repo"))) @@ -60,7 +60,7 @@ class sshrepository(repo.repository): cmd = cmd % (sshcmd, args, remotecmd, self.path) cmd = util.quotecommand(cmd) - ui.note('running %s\n' % cmd) + ui.note(_('running %s\n') % cmd) self.pipeo, self.pipei, self.pipee = os.popen3(cmd, 'b') # skip any noise generated by remote shell diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py --- a/mercurial/streamclone.py +++ b/mercurial/streamclone.py @@ -6,6 +6,7 @@ # of the GNU General Public License, incorporated herein by reference. import util, lock +from i18n import _ class StreamException(Exception): def __init__(self, code): @@ -42,7 +43,7 @@ def stream_out(repo, untrusted=False): try: l = None try: - repo.ui.debug('scanning\n') + repo.ui.debug(_('scanning\n')) # get consistent snapshot of repo, lock during scan l = repo.lock() for name, ename, size in repo.store.walk(): @@ -54,11 +55,11 @@ def stream_out(repo, untrusted=False): raise StreamException(2) yield '0\n' - repo.ui.debug('%d files, %d bytes to transfer\n' % + repo.ui.debug(_('%d files, %d bytes to transfer\n') % (len(entries), total_bytes)) yield '%d %d\n' % (len(entries), total_bytes) for name, size in entries: - repo.ui.debug('sending %s (%d bytes)\n' % (name, size)) + repo.ui.debug(_('sending %s (%d bytes)\n') % (name, size)) yield '%s\0%d\n' % (name, size) for chunk in util.filechunkiter(repo.sopener(name), limit=size): yield chunk