changeset 15586:98ec09582f72

addchangegroup: ony queue hooks when we have changesets
author Matt Mackall <mpm@selenic.com>
date Wed, 30 Nov 2011 15:33:44 -0600
parents a348739da8f0
children 809d5d30e377
files mercurial/localrepo.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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()