diff mercurial/hook.py @ 26861:10a1a4b3e775 stable

hooks: back 9f272bf3b342 out Changeset 9f272bf3b342 alters the 'HG_PENDING' mechanism to be "always" there. This change is made under the assumption than we previously did it only when "writepending() actually wrote something". This assumption was wrong, 'writepending()' informs of pending changes the first time something is written and for all following calls. We back this change out to restore the former behavior, which was already correct.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 06 Nov 2015 11:08:11 -0500
parents 9f272bf3b342
children 10695f8f3323
line wrap: on
line diff
--- a/mercurial/hook.py	Tue Nov 03 17:13:27 2015 -0800
+++ b/mercurial/hook.py	Fri Nov 06 11:08:11 2015 -0500
@@ -122,8 +122,7 @@
     # make in-memory changes visible to external process
     tr = repo.currenttransaction()
     repo.dirstate.write(tr)
-    if tr:
-        tr.writepending()
+    if tr and tr.writepending():
         env['HG_PENDING'] = repo.root
 
     for k, v in args.iteritems():