hook: centralize passing HG_PENDING to external hook process
This patch centralizes passing HG_PENDING to external hook process into '_exthook()'. To make in-memory changes visible to external hook process, this patch does: - write (or schedule to write) in-memory dirstate changes, and - set HG_PENDING environment variable, if: - a transaction is running, and - there are in-memory changes to be visible This patch tests some commands with some hooks, because transaction activity of a same hook differs from each other ("---": "not tested"). ======== ========= ========= ============ command preupdate precommit pretxncommit ======== ========= ========= ============ unshelve o --- --- backout x --- --- import --- o o qrefresh --- x o ======== ========= ========= ============ Each hooks are examined separately to prevent in-memory changes from being visible to external process accidentally by side effect of hooks previously invoked.
Showing
- mercurial/changegroup.py 1 addition, 3 deletionsmercurial/changegroup.py
- mercurial/hook.py 7 additions, 0 deletionsmercurial/hook.py
- mercurial/localrepo.py 2 additions, 6 deletionsmercurial/localrepo.py
- tests/test-backout.t 54 additions, 0 deletionstests/test-backout.t
- tests/test-import.t 104 additions, 0 deletionstests/test-import.t
- tests/test-mq-qrefresh-replace-log-message.t 82 additions, 0 deletionstests/test-mq-qrefresh-replace-log-message.t
- tests/test-shelve.t 78 additions, 0 deletionstests/test-shelve.t
Loading
Please register or sign in to comment