patch, i18n: avoid parameterized messages stable
authorWagner Bruna <wbruna@softwareexpress.com.br>
Fri, 19 Feb 2010 13:04:11 -0200
branchstable
changeset 10518 5fe51d348daf
parent 10517 13448eab08ca
child 10519 f75db9927429
patch, i18n: avoid parameterized messages Singular message removed for simplicity.
mercurial/patch.py
--- 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))