changeset 10518:5fe51d348daf stable

patch, i18n: avoid parameterized messages Singular message removed for simplicity.
author Wagner Bruna <wbruna@softwareexpress.com.br>
date Fri, 19 Feb 2010 13:04:11 -0200
parents 13448eab08ca
children f75db9927429
files mercurial/patch.py
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Sat Feb 20 15:18:59 2010 +0100
+++ b/mercurial/patch.py	Fri Feb 19 13:04:11 2010 -0200
@@ -607,21 +607,18 @@
                         self.offset += len(newlines) - len(old)
                         self.skew = l - orig_start
                         self.dirty = 1
+                        offset = l - orig_start - fuzzlen
                         if fuzzlen:
-                            fuzzstr = "with fuzz %d " % fuzzlen
-                            f = self.ui.warn
+                            msg = _("Hunk #%d succeeded at %d "
+                                    "with fuzz %d "
+                                    "(offset %d lines).\n")
                             self.printfile(True)
+                            self.ui.warn(msg %
+                                (h.number, l + 1, fuzzlen, offset))
                         else:
-                            fuzzstr = ""
-                            f = self.ui.note
-                        offset = l - orig_start - fuzzlen
-                        if offset == 1:
-                            msg = _("Hunk #%d succeeded at %d %s"
-                                    "(offset %d line).\n")
-                        else:
-                            msg = _("Hunk #%d succeeded at %d %s"
+                            msg = _("Hunk #%d succeeded at %d "
                                     "(offset %d lines).\n")
-                        f(msg % (h.number, l + 1, fuzzstr, offset))
+                            self.ui.note(msg % (h.number, l + 1, offset))
                         return fuzzlen
         self.printfile(True)
         self.ui.warn(_("Hunk #%d FAILED at %d\n") % (h.number, orig_start))