Prettify 'matrix changes' output
[matrix.git] / matrix / repositories.py
index 8f6e535..e9d6339 100644 (file)
@@ -200,13 +200,17 @@ class Repository(object):
                branch, remote = self.__get_branch_remote()
 
                output = git.changes(self.path, "%s/%s" % (remote, branch))
-               if output:
-                       if config.verbose:
-                               print 'Local commits in', self
-                               for line in output:
-                                       print ' ', line
-                               print
-
-                       return True
-               else:
+               if not output:
                        return False
+
+               if config.verbose:
+                       print 'Changes in', str(self) + ":"
+                       for line in output:
+                               print ' ', line
+                       print
+               elif len(output) == 1:
+                       print "One local commit in", str(self)
+               else:
+                       print len(output), "local commits in", str(self)
+
+               return True