diff mercurial/hook.py @ 26858:9f272bf3b342 stable

hooks: always include HG_PENDING Previously we would only include HG_PENDING in the hook args if the transaction's writepending() actually wrote something. This is a bad criteria, since it's possible that a previous call to writepending() wrote stuff and the hooks want to still see that. The solution is to always have hooks execute within the scope of the pending changes by always putting HG_PENDING in the environment.
author Durham Goode <durham@fb.com>
date Tue, 03 Nov 2015 16:58:13 -0800
parents 520defbc0335
children 10a1a4b3e775
line wrap: on
line diff
--- a/mercurial/hook.py	Tue Nov 03 12:31:33 2015 -0800
+++ b/mercurial/hook.py	Tue Nov 03 16:58:13 2015 -0800
@@ -122,7 +122,8 @@
     # make in-memory changes visible to external process
     tr = repo.currenttransaction()
     repo.dirstate.write(tr)
-    if tr and tr.writepending():
+    if tr:
+        tr.writepending()
         env['HG_PENDING'] = repo.root
 
     for k, v in args.iteritems():