Fix gettext call

Marcos Chaves marcos.nospam at gmail.com
Sat Nov 18 13:08:16 CST 2006


Hi,

I read that i18n support is planned for the future, so I run
pygettext.py on mercurial/commands.py (seems to be the only file with
_() calls) just to see if it worked and noticed that there were 3
gettext calls that don't seem to be properly formatted, generating
warnings. Attached is a simple patch that fixes them, so pygettext.py
runs with no errors and all messages are properly extracted.

-Marcos

Patch is attached too, just in case my mailer breaks the lines.

diff -r 9103dab96093 mercurial/commands.py
--- a/mercurial/commands.py	Sat Nov 18 11:34:19 2006 -0600
+++ b/mercurial/commands.py	Sat Nov 18 17:01:41 2006 -0200
@@ -213,8 +213,8 @@ def backout(ui, repo, rev, **opts):
                                '--parent'))
         p = repo.lookup(opts['parent'])
         if p not in (p1, p2):
-            raise util.Abort(_('%s is not a parent of %s' %
-                               (short(p), short(node))))
+            raise util.Abort(_('%s is not a parent of %s') %
+                               (short(p), short(node)))
         parent = p
     else:
         if opts['parent']:
@@ -1969,12 +1969,12 @@ def revert(ui, repo, *pats, **opts):
             elif misslist is not None:
                 handle(misslist, backupmiss)
             else:
-                if exact: ui.warn(_('file not managed: %s\n' % rel))
+                if exact: ui.warn(_('file not managed: %s\n') % rel)
             break
         else:
             # file has not changed in dirstate
             if node == parent:
-                if exact: ui.warn(_('no changes needed to %s\n' % rel))
+                if exact: ui.warn(_('no changes needed to %s\n') % rel)
                 continue
             if pmf is None:
                 # only need parent manifest in this unlikely case,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-gettext-call.diff
Type: application/octet-stream
Size: 1319 bytes
Desc: not available
Url : http://www.selenic.com/pipermail/mercurial-devel/attachments/20061118/b2c00309/fix-gettext-call.obj


More information about the Mercurial-devel mailing list