# HG changeset patch # User Benoit Boissinot # Date 2008-03-14 20:35:49 # Node ID d60aa0308b02897e5e411471e7c0a190259c4af8 # Parent b36774d0fce1f7d85a50f0618036f3fdda9ebde2 make sure not to reuse an existing append-file from a previous failed pull diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -108,6 +108,9 @@ class changelog(revlog): # if we're doing an initial clone, divert to another file if self._delaycount == 0: self._delayname = fp.name + if not self.count(): + # make sure to truncate the file + mode = mode.replace('a', 'w') return self._realopener(name + ".a", mode) # otherwise, divert to memory return appender(fp, self._delaybuf)