Commits

camlspotter committed bc5142e

explicit return values of coutls

  • Participants
  • Parent commits 69561eb

Comments (0)

Files changed (1)

         if cdtip == repo['tip'] and uncommitted == 0:
             ui.write("there is nothing to push.\n")
             return 1
-        else:
-            num_changes = repo['tip'].rev() - cdtip.rev()
-            ui.write("there are {0} changes to push.\n"
+        num_changes = repo['tip'].rev() - cdtip.rev()
+        if num_changes > 0:
+            ui.write("{0} changes to be pushed.\n"
                      .format(num_changes))
-            if uncommitted:
-                ui.write("and there are {0} uncommitted files in "
-                         "working directory.\n".format(uncommitted))
-            return 0
+        if uncommitted:
+            ui.write("{0} uncommitted files in "
+                     "working directory.\n".format(uncommitted))
+        return 0
     else:
         ui.write(
             "the tip ({0}) on dest ({1}) is not in current "