Show More
@@ -1085,9 +1085,15 b' class localrepository(object):' | |||||
1085 | def txnclosehook(tr2): |
|
1085 | def txnclosehook(tr2): | |
1086 | """To be run if transaction is successful, will schedule a hook run |
|
1086 | """To be run if transaction is successful, will schedule a hook run | |
1087 | """ |
|
1087 | """ | |
|
1088 | # Don't reference tr2 in hook() so we don't hold a reference. | |||
|
1089 | # This reduces memory consumption when there are multiple | |||
|
1090 | # transactions per lock. This can likely go away if issue5045 | |||
|
1091 | # fixes the function accumulation. | |||
|
1092 | hookargs = tr2.hookargs | |||
|
1093 | ||||
1088 | def hook(): |
|
1094 | def hook(): | |
1089 | reporef().hook('txnclose', throw=False, txnname=desc, |
|
1095 | reporef().hook('txnclose', throw=False, txnname=desc, | |
1090 |
** |
|
1096 | **hookargs) | |
1091 | reporef()._afterlock(hook) |
|
1097 | reporef()._afterlock(hook) | |
1092 | tr.addfinalize('txnclose-hook', txnclosehook) |
|
1098 | tr.addfinalize('txnclose-hook', txnclosehook) | |
1093 | def txnaborthook(tr2): |
|
1099 | def txnaborthook(tr2): |
General Comments 0
You need to be logged in to leave comments.
Login now