# HG changeset patch # User Matt Mackall # Date 1322688824 21600 # Node ID 98ec09582f72dd6cfe7e0b8e233ef3fe135212b3 # Parent a348739da8f07914f59e9ddbb6e51df2f94b4d45 addchangegroup: ony queue hooks when we have changesets diff -r a348739da8f0 -r 98ec09582f72 mercurial/localrepo.py --- a/mercurial/localrepo.py Mon Nov 28 01:32:13 2011 +0100 +++ b/mercurial/localrepo.py Wed Nov 30 15:33:44 2011 -0600 @@ -2000,8 +2000,8 @@ tr.close() - def postaddchangegroup(): - if changesets > 0: + if changesets > 0: + def runhooks(): # forcefully update the on-disk branch cache self.ui.debug("updating the branch cache\n") self.updatebranchcache() @@ -2011,7 +2011,7 @@ for n in added: self.hook("incoming", node=hex(n), source=srctype, url=url) - self._postrelease(postaddchangegroup) + self._postrelease(runhooks) finally: tr.release()