mercurial/localrepo.py
changeset 19884 fc3fbca35085
parent 19853 eddc2a2d57e6
child 19928 d1ac3790e10a
--- a/mercurial/localrepo.py	Wed Oct 02 09:50:21 2013 +0200
+++ b/mercurial/localrepo.py	Mon Oct 07 11:45:01 2013 -0700
@@ -2229,6 +2229,12 @@
                     # In other case we can safely update cache on disk.
                     branchmap.updatecache(self.filtered('served'))
                 def runhooks():
+                    # These hooks run when the lock releases, not when the
+                    # transaction closes. So it's possible for the changelog
+                    # to have changed since we last saw it.
+                    if clstart >= len(self):
+                        return
+
                     # forcefully update the on-disk branch cache
                     self.ui.debug("updating the branch cache\n")
                     self.hook("changegroup", node=hex(cl.node(clstart)),