mercurial/changegroup.py
changeset 23221 cadc9a723d60
parent 23205 2d54aa5397cd
child 23243 c58432685cff
--- a/mercurial/changegroup.py	Tue Oct 28 14:24:43 2014 +0100
+++ b/mercurial/changegroup.py	Tue Oct 28 15:44:23 2014 +0100
@@ -788,9 +788,6 @@
             # strip should not touch boundary at all
             phases.retractboundary(repo, tr, targetphase, added)
 
-
-        tr.close()
-
         if changesets > 0:
             if srctype != 'strip':
                 # During strip, branchcache is invalid but coming call to
@@ -819,7 +816,11 @@
                             "%s incoming changes - new heads: %s\n",
                             len(added),
                             ', '.join([hex(c[:6]) for c in newheads]))
-            repo._afterlock(runhooks)
+
+            tr.addpostclose('changegroup-runhooks-%020i' % clstart,
+                            lambda: repo._afterlock(runhooks))
+
+        tr.close()
 
     finally:
         tr.release()