changelog: _delaycount -> _divert
authorMatt Mackall <mpm@selenic.com>
Sat, 18 Jul 2009 11:25:54 -0500
changeset 9163 f193b643d1b1
parent 9154 47ce7a3a1fb0
child 9164 b0d995b6b0a6
changelog: _delaycount -> _divert
mercurial/changelog.py
--- a/mercurial/changelog.py	Thu Jul 16 15:40:13 2009 -0500
+++ b/mercurial/changelog.py	Sat Jul 18 11:25:54 2009 -0500
@@ -91,12 +91,14 @@
     def __init__(self, opener):
         self._realopener = opener
         self._delayed = False
+        self._divert = False
         revlog.revlog.__init__(self, self._delayopener, "00changelog.i")
 
+
     def delayupdate(self):
         "delay visibility of index updates to other readers"
         self._delayed = True
-        self._delaycount = len(self)
+        self._divert = (len(self) == 0)
         self._delaybuf = []
         self._delayname = None
 
@@ -120,7 +122,7 @@
         if not self._delayed or not name == self.indexfile:
             return fp
         # if we're doing an initial clone, divert to another file
-        if self._delaycount == 0:
+        if self._divert:
             self._delayname = fp.name
             if not len(self):
                 # make sure to truncate the file