[PATCH stable] changelog: ensure changelog._delaybuf is initialized

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Tue May 20 16:00:31 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1400619308 25200
#      Tue May 20 13:55:08 2014 -0700
# Branch stable
# Node ID 33b18d495eaf872bcd8b4feab704b4b6e147fa6a
# Parent  235ed8ca9a16f6231fc5c3bf1346cc1a25430c8c
changelog: ensure changelog._delaybuf is initialized

The ``localrepo.writepending`` method is using the ``changelog._delaybuff``
attribute to know if it has anything to do. However the ``changelog._delaybuff``
is never initialised at ``__init__`` time. This can lead to crash when using
bundle2 for part that never touch the changelog.

We simply initialize it to its base value. This is scheduled for stable as it
both trivial and blocking for experimenting with bundle2.

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -125,10 +125,11 @@ class changelog(revlog.revlog):
             # changelogs don't benefit from generaldelta
             self.version &= ~revlog.REVLOGGENERALDELTA
             self._generaldelta = False
         self._realopener = opener
         self._delayed = False
+        self._delaybuf = []
         self._divert = False
         self.filteredrevs = frozenset()
 
     def tip(self):
         """filtered version of revlog.tip"""


More information about the Mercurial-devel mailing list