[PATCH 04 of 17] mark strings for translation in Mercurial

Martin Geisler mg at daimi.au.dk
Sat Aug 23 15:55:20 CDT 2008


# HG changeset patch
# User Martin Geisler <mg at daimi.au.dk>
# Date 1219523130 -7200
# Node ID e2f4e1ef8b621e4434961a948ad652da2c702866
# Parent  8a207c9f614189ab9906a378884112de79434d7d
mark strings for translation in Mercurial

diff -r 8a207c9f6141 -r e2f4e1ef8b62 mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py	Sat Aug 23 22:25:30 2008 +0200
+++ b/mercurial/bundlerepo.py	Sat Aug 23 22:25:30 2008 +0200
@@ -39,7 +39,7 @@
         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 -r 8a207c9f6141 -r e2f4e1ef8b62 mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Sat Aug 23 22:25:30 2008 +0200
+++ b/mercurial/cmdutil.py	Sat Aug 23 22:25:30 2008 +0200
@@ -936,7 +936,7 @@
                 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 -r 8a207c9f6141 -r e2f4e1ef8b62 mercurial/commands.py
--- a/mercurial/commands.py	Sat Aug 23 22:25:30 2008 +0200
+++ b/mercurial/commands.py	Sat Aug 23 22:25:30 2008 +0200
@@ -2122,7 +2122,7 @@
     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 -r 8a207c9f6141 -r e2f4e1ef8b62 mercurial/hgweb/server.py
--- a/mercurial/hgweb/server.py	Sat Aug 23 22:25:30 2008 +0200
+++ b/mercurial/hgweb/server.py	Sat Aug 23 22:25:30 2008 +0200
@@ -259,7 +259,7 @@
                     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 -r 8a207c9f6141 -r e2f4e1ef8b62 mercurial/localrepo.py
--- a/mercurial/localrepo.py	Sat Aug 23 22:25:30 2008 +0200
+++ b/mercurial/localrepo.py	Sat Aug 23 22:25:30 2008 +0200
@@ -1098,7 +1098,7 @@
             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 @@
             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 -r 8a207c9f6141 -r e2f4e1ef8b62 mercurial/merge.py
--- a/mercurial/merge.py	Sat Aug 23 22:25:30 2008 +0200
+++ b/mercurial/merge.py	Sat Aug 23 22:25:30 2008 +0200
@@ -347,7 +347,7 @@
             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 -r 8a207c9f6141 -r e2f4e1ef8b62 mercurial/patch.py
--- a/mercurial/patch.py	Sat Aug 23 22:25:30 2008 +0200
+++ b/mercurial/patch.py	Sat Aug 23 22:25:30 2008 +0200
@@ -229,7 +229,7 @@
                 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 -r 8a207c9f6141 -r e2f4e1ef8b62 mercurial/repair.py
--- a/mercurial/repair.py	Sat Aug 23 22:25:30 2008 +0200
+++ b/mercurial/repair.py	Sat Aug 23 22:25:30 2008 +0200
@@ -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 @@
     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 @@
         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 -r 8a207c9f6141 -r e2f4e1ef8b62 mercurial/sshrepo.py
--- a/mercurial/sshrepo.py	Sat Aug 23 22:25:30 2008 +0200
+++ b/mercurial/sshrepo.py	Sat Aug 23 22:25:30 2008 +0200
@@ -42,7 +42,7 @@
             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 @@
         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 -r 8a207c9f6141 -r e2f4e1ef8b62 mercurial/streamclone.py
--- a/mercurial/streamclone.py	Sat Aug 23 22:25:30 2008 +0200
+++ b/mercurial/streamclone.py	Sat Aug 23 22:25:30 2008 +0200
@@ -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 @@
     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 @@
         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


More information about the Mercurial-devel mailing list