Patchwork [2,of,2] subrepo: make the '(in subrepo %s)' hint more translation friendly

login
register
mail settings
Submitter Angel Ezquerra
Date Jan. 3, 2013, 5:17 p.m.
Message ID <58dd1c9df93299eb2fd8.1357233431@Angel-PC.localdomain>
Download mbox | patch
Permalink /patch/369/
State Superseded
Headers show

Comments

Angel Ezquerra - Jan. 3, 2013, 5:17 p.m.
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra at gmail.com>
# Date 1357231345 -3600
# Node ID 58dd1c9df93299eb2fd80292419998e078968e04
# Parent  5a1a5555319c13de73e51d271de5356b4a0656d0
subrepo: make the '(in subrepo %s)' hint more translation friendly

This patch makes the '(in subrepo %s)' hint that is printed when a subrepo
throws an error a bit easier to use tools that must parse mercurial's output,
such as GUI tools (e.g. TortoiseHg).

The message remains the same but the '%s' that was used to prepend the original
error message has been moved out of the translatable string.

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -29,7 +29,7 @@ 
             raise ex
         except error.Abort, ex:
             subrepo = subrelpath(self)
-            errormsg = _('%s (in subrepo %s)') % (str(ex), subrepo)
+            errormsg = str(ex) + ' ' + _('(in subrepo %s)') % subrepo
             # avoid handling this exception by raising a SubrepoAbort exception
             raise SubrepoAbort(errormsg, hint=ex.hint, subrepo=subrepo)
         return res