# HG changeset patch # User mason@suse.com # Date 1144541286 14400 # Node ID 856f0ba200bc59c05e304cc1aca2865e0e831870 # Parent 416d8b2a75b85d2f20d7c1f9a16b3f7fef082160 Additional appendfile fixes for interleaved data/index files The appendfile code was not passing default version info to the changelog or manifest classes, and so they were always being created as version 0. revlog.checkinlinesize had to be corrected to seek to the end of the index file when no index file was passed (only clone does this) diff -r 416d8b2a75b8 -r 856f0ba200bc mercurial/appendfile.py --- a/mercurial/appendfile.py Thu Apr 06 20:13:09 2006 -0400 +++ b/mercurial/appendfile.py Sat Apr 08 20:08:06 2006 -0400 @@ -180,15 +180,15 @@ # not mixed up together. class appendchangelog(changelog.changelog, appendopener): - def __init__(self, opener): + def __init__(self, opener, version): appendopener.__init__(self, opener) - changelog.changelog.__init__(self, self) + changelog.changelog.__init__(self, self, version) def checkinlinesize(self, fp, tr): return class appendmanifest(manifest.manifest, appendopener): - def __init__(self, opener): + def __init__(self, opener, version): appendopener.__init__(self, opener) - manifest.manifest.__init__(self, self) + manifest.manifest.__init__(self, self, version) def checkinlinesize(self, fp, tr): return diff -r 416d8b2a75b8 -r 856f0ba200bc mercurial/localrepo.py --- a/mercurial/localrepo.py Thu Apr 06 20:13:09 2006 -0400 +++ b/mercurial/localrepo.py Sat Apr 08 20:08:06 2006 -0400 @@ -1413,7 +1413,7 @@ # write changelog and manifest data to temp files so # concurrent readers will not see inconsistent view - cl = appendfile.appendchangelog(self.opener) + cl = appendfile.appendchangelog(self.opener, self.changelog.version) oldheads = len(cl.heads()) @@ -1427,7 +1427,7 @@ cnr = cor changesets = cnr - cor - mf = appendfile.appendmanifest(self.opener) + mf = appendfile.appendmanifest(self.opener, self.manifest.version) # pull off the manifest group self.ui.status(_("adding manifests\n")) @@ -1455,10 +1455,10 @@ cl.writedata() # make changelog and manifest see real files again - self.changelog = changelog.changelog(self.opener) - self.manifest = manifest.manifest(self.opener) + self.changelog = changelog.changelog(self.opener, self.changelog.version) + self.manifest = manifest.manifest(self.opener, self.manifest.version) self.changelog.checkinlinesize(tr) - self.changelog.checkinlinesize(tr) + self.manifest.checkinlinesize(tr) newheads = len(self.changelog.heads()) heads = "" diff -r 416d8b2a75b8 -r 856f0ba200bc mercurial/revlog.py --- a/mercurial/revlog.py Thu Apr 06 20:13:09 2006 -0400 +++ b/mercurial/revlog.py Sat Apr 08 20:08:06 2006 -0400 @@ -822,6 +822,7 @@ return if not fp: fp = self.opener(self.indexfile, 'r') + fp.seek(0, 2) size = fp.tell() if size < 131072: return