[PATCH STABLE] rollback, i18n: avoid parameterized message

Wagner Bruna wagner.bruna+mercurial at gmail.com
Mon Feb 21 18:55:17 CST 2011


# HG changeset patch
# User Wagner Bruna <wbruna at softwareexpress.com.br>
# Date 1298332734 10800
# Branch stable
# Node ID 93f216e98c39eeb04faf7ab5aa37702a8147e90f
# Parent  3d3661df05e534ac65069c23dcb43878aa0470b8
rollback, i18n: avoid parameterized message

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -742,9 +742,13 @@ class localrepository(repo.repository):
                 self.invalidate()
                 self.dirstate.invalidate()
                 self.destroyed()
-                self.ui.status(_("working directory now based on "
-                                 "revision %s\n") % (
-                    _(' and ').join(str(p.rev()) for p in self.parents())))
+                parents = tuple([p.rev() for p in self.parents()])
+                if len(parents) > 1:
+                    self.ui.status(_("working directory now based on "
+                                     "revisions %d and %d\n") % parents)
+                else:
+                    self.ui.status(_("working directory now based on "
+                                     "revision %d\n") % parents)
             else:
                 self.ui.warn(_("no rollback information available\n"))
                 return 1
diff --git a/tests/test-newbranch.t b/tests/test-newbranch.t
--- a/tests/test-newbranch.t
+++ b/tests/test-newbranch.t
@@ -106,7 +106,7 @@ Test for invalid branch cache:
 
   $ hg rollback
   repository tip rolled back to revision 4 (undo commit)
-  working directory now based on revision 4 and 3
+  working directory now based on revisions 4 and 3
 
   $ cp $branchcache .hg/bc-invalid
 
diff --git a/tests/test-rename-after-merge.t b/tests/test-rename-after-merge.t
--- a/tests/test-rename-after-merge.t
+++ b/tests/test-rename-after-merge.t
@@ -98,7 +98,7 @@ Commit issue 1476:
 
   $ hg rollback
   repository tip rolled back to revision 2 (undo commit)
-  working directory now based on revision 2 and 1
+  working directory now based on revisions 2 and 1
 
   $ hg up -C .
   2 files updated, 0 files merged, 2 files removed, 0 files unresolved


More information about the Mercurial-devel mailing list