comparison 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
comparison
equal deleted inserted replaced
26857:e5a1df51bb25 26858:9f272bf3b342
120 env = {} 120 env = {}
121 121
122 # make in-memory changes visible to external process 122 # make in-memory changes visible to external process
123 tr = repo.currenttransaction() 123 tr = repo.currenttransaction()
124 repo.dirstate.write(tr) 124 repo.dirstate.write(tr)
125 if tr and tr.writepending(): 125 if tr:
126 tr.writepending()
126 env['HG_PENDING'] = repo.root 127 env['HG_PENDING'] = repo.root
127 128
128 for k, v in args.iteritems(): 129 for k, v in args.iteritems():
129 if callable(v): 130 if callable(v):
130 v = v() 131 v = v()