diff mercurial/hook.py @ 44894:09da5cf44772

hooks: provide access to transaction changes for internal hooks External hooks are skipped here as the environment often has a size limit in the low MBs and that can easily be reached by larger transactions. Differential Revision: https://phab.mercurial-scm.org/D8490
author Joerg Sonnenberger <joerg@bec.de>
date Fri, 01 May 2020 01:32:08 +0200
parents 3cbbfd0bfc17
children fd3b94f1712d
line wrap: on
line diff
--- a/mercurial/hook.py	Thu May 07 23:54:37 2020 +0200
+++ b/mercurial/hook.py	Fri May 01 01:32:08 2020 +0200
@@ -158,6 +158,10 @@
     env[b'HG_HOOKNAME'] = name
 
     for k, v in pycompat.iteritems(args):
+        # transaction changes can accumulate MBs of data, so skip it
+        # for external hooks
+        if k == b'changes':
+            continue
         if callable(v):
             v = v()
         if isinstance(v, (dict, list)):