diff mercurial/commands.py @ 6935:03916abdfb64

Have verbose and debug flag print the changeset rev and hash when committing. Besides updating the tests output, I had to push back at the end the test for issue1193 in test-commit, solved by cset 4386a7706828, because it was using the current date for commit and was randomizing the subsequent hash.
author Gilles Moris <gilles.moris@free.fr>
date Fri, 22 Aug 2008 22:32:53 +0200
parents abb915d9d8db
children 359e93ceee3a
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Aug 24 22:13:39 2008 +0200
+++ b/mercurial/commands.py	Fri Aug 22 22:32:53 2008 +0200
@@ -590,12 +590,17 @@
     parents = cl.parentrevs(rev)
     if rev - 1 in parents:
         # one of the parents was the old tip
-        return
-    if (parents == (nullrev, nullrev) or
-        len(cl.heads(cl.node(parents[0]))) > 1 and
-        (parents[1] == nullrev or len(cl.heads(cl.node(parents[1]))) > 1)):
+        pass
+    elif (parents == (nullrev, nullrev) or
+          len(cl.heads(cl.node(parents[0]))) > 1 and
+          (parents[1] == nullrev or len(cl.heads(cl.node(parents[1]))) > 1)):
         ui.status(_('created new head\n'))
 
+    if ui.debugflag:
+        ui.write(_('committed changeset %d:%s\n') % (rev,hex(node)))
+    elif ui.verbose:
+        ui.write(_('committed changeset %d:%s\n') % (rev,short(node)))
+
 def copy(ui, repo, *pats, **opts):
     """mark files as copied for the next commit