diff hgext/inhibit.py @ 1346:9a1415f8b21b

inhbit: don't crash on commit with no changes Before this patch inhibit would crash when running hg amend with no changes. This patch fixes this case and adds a test to prevent regression.
author Laurent Charignon <lcharignon@fb.com>
date Wed, 20 May 2015 10:58:32 -0700
parents 0e2eb196923a
children 73e5b5280c1c
line wrap: on
line diff
--- a/hgext/inhibit.py	Wed May 20 13:32:32 2015 -0700
+++ b/hgext/inhibit.py	Wed May 20 10:58:32 2015 -0700
@@ -43,7 +43,8 @@
 
         def commit(self, *args, **kwargs):
             newnode = super(obsinhibitedrepo, self).commit(*args, **kwargs)
-            _inhibitmarkers(repo, [newnode])
+            if newnode is not None:
+                _inhibitmarkers(repo, [newnode])
             return newnode
 
     repo.__class__ = obsinhibitedrepo