# HG changeset patch # User Martin von Zweigbergk # Date 1556897830 25200 # Node ID 39b63f9d746410029a7939267bf939c03a6fb8b4 # Parent 6770df6e4365a8b1ffaa011e6a5441b398a32c55 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 diff -r 6770df6e4365 -r 39b63f9d7464 mercurial/localrepo.py --- a/mercurial/localrepo.py Fri May 03 12:32:00 2019 -0700 +++ b/mercurial/localrepo.py Fri May 03 08:37:10 2019 -0700 @@ -2538,12 +2538,12 @@ _('note: commit message saved in %s\n') % msgfn) raise - def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2): + def commithook(): # hack for command that use a temporary commit (eg: histedit) # temporary commit got stripped before hook release if self.changelog.hasnode(ret): - self.hook("commit", node=node, parent1=parent1, - parent2=parent2) + self.hook("commit", node=hex(ret), parent1=hookp1, + parent2=hookp2) self._afterlock(commithook) return ret