comparison mercurial/localrepo.py @ 42240:39b63f9d7464

localrepo: don't use defaults arguments that will never be overridden The commithook() callback will be called when the lock is released. lock.release() calls the callback without arguments, so it was quite confusing to me that this function declared extra arguments. We can just close on the variables in the outer scope instead. Differential Revision: https://phab.mercurial-scm.org/D6336
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 03 May 2019 08:37:10 -0700
parents 32338e27bb9d
children 8988e640a8ac
comparison
equal deleted inserted replaced
42239:6770df6e4365 42240:39b63f9d7464
2536 if edited: 2536 if edited:
2537 self.ui.write( 2537 self.ui.write(
2538 _('note: commit message saved in %s\n') % msgfn) 2538 _('note: commit message saved in %s\n') % msgfn)
2539 raise 2539 raise
2540 2540
2541 def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2): 2541 def commithook():
2542 # hack for command that use a temporary commit (eg: histedit) 2542 # hack for command that use a temporary commit (eg: histedit)
2543 # temporary commit got stripped before hook release 2543 # temporary commit got stripped before hook release
2544 if self.changelog.hasnode(ret): 2544 if self.changelog.hasnode(ret):
2545 self.hook("commit", node=node, parent1=parent1, 2545 self.hook("commit", node=hex(ret), parent1=hookp1,
2546 parent2=parent2) 2546 parent2=hookp2)
2547 self._afterlock(commithook) 2547 self._afterlock(commithook)
2548 return ret 2548 return ret
2549 2549
2550 @unfilteredmethod 2550 @unfilteredmethod
2551 def commitctx(self, ctx, error=False): 2551 def commitctx(self, ctx, error=False):