[meld] Simplify unpushed commits messages



commit 75e33e4503a303432f3c282e066c96cbcd3ad794
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Tue May 14 06:24:24 2013 +1000

    Simplify unpushed commits messages

 meld/vc/git.py |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/meld/vc/git.py b/meld/vc/git.py
index 16584ea..1b66e4e 100644
--- a/meld/vc/git.py
+++ b/meld/vc/git.py
@@ -104,12 +104,14 @@ class Vc(_vc.CachedVc):
         unpushed_branches = len([v for v in branch_refs.values() if v])
         unpushed_commits = sum(len(v) for v in branch_refs.values())
         if unpushed_commits:
-            label = ngettext(
-                "Unpushed commits found: %d in %d branch",
-                "Unpushed commits found: %d in %d branches",
-                unpushed_branches) % (unpushed_commits, unpushed_branches)
+            if unpushed_branches > 1:
+                label = _("%d unpushed commits in %d branches") % \
+                    (unpushed_commits, unpushed_branches)
+            else:
+                label = ngettext("%d unpushed commit", "%d unpushed commits",
+                                 unpushed_commits) % (unpushed_commits)
         else:
-            label = _("No unpushed commits found")
+            label = ""
         return label
 
     def get_commits_to_push(self):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]