Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 2082:856f0ba200bc
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)
author | mason@suse.com |
---|---|
date | Sat, 08 Apr 2006 20:08:06 -0400 |
parents | 343aeefb553b |
children | f71e9656524f |
comparison
equal
deleted
inserted
replaced
2081:416d8b2a75b8 | 2082:856f0ba200bc |
---|---|
1411 | 1411 |
1412 tr = self.transaction() | 1412 tr = self.transaction() |
1413 | 1413 |
1414 # write changelog and manifest data to temp files so | 1414 # write changelog and manifest data to temp files so |
1415 # concurrent readers will not see inconsistent view | 1415 # concurrent readers will not see inconsistent view |
1416 cl = appendfile.appendchangelog(self.opener) | 1416 cl = appendfile.appendchangelog(self.opener, self.changelog.version) |
1417 | 1417 |
1418 oldheads = len(cl.heads()) | 1418 oldheads = len(cl.heads()) |
1419 | 1419 |
1420 # pull off the changeset group | 1420 # pull off the changeset group |
1421 self.ui.status(_("adding changesets\n")) | 1421 self.ui.status(_("adding changesets\n")) |
1425 cnr, cor = map(cl.rev, (cn, co)) | 1425 cnr, cor = map(cl.rev, (cn, co)) |
1426 if cn == nullid: | 1426 if cn == nullid: |
1427 cnr = cor | 1427 cnr = cor |
1428 changesets = cnr - cor | 1428 changesets = cnr - cor |
1429 | 1429 |
1430 mf = appendfile.appendmanifest(self.opener) | 1430 mf = appendfile.appendmanifest(self.opener, self.manifest.version) |
1431 | 1431 |
1432 # pull off the manifest group | 1432 # pull off the manifest group |
1433 self.ui.status(_("adding manifests\n")) | 1433 self.ui.status(_("adding manifests\n")) |
1434 mm = mf.tip() | 1434 mm = mf.tip() |
1435 chunkiter = changegroup.chunkiter(source) | 1435 chunkiter = changegroup.chunkiter(source) |
1453 # consistent view of repo | 1453 # consistent view of repo |
1454 mf.writedata() | 1454 mf.writedata() |
1455 cl.writedata() | 1455 cl.writedata() |
1456 | 1456 |
1457 # make changelog and manifest see real files again | 1457 # make changelog and manifest see real files again |
1458 self.changelog = changelog.changelog(self.opener) | 1458 self.changelog = changelog.changelog(self.opener, self.changelog.version) |
1459 self.manifest = manifest.manifest(self.opener) | 1459 self.manifest = manifest.manifest(self.opener, self.manifest.version) |
1460 self.changelog.checkinlinesize(tr) | 1460 self.changelog.checkinlinesize(tr) |
1461 self.changelog.checkinlinesize(tr) | 1461 self.manifest.checkinlinesize(tr) |
1462 | 1462 |
1463 newheads = len(self.changelog.heads()) | 1463 newheads = len(self.changelog.heads()) |
1464 heads = "" | 1464 heads = "" |
1465 if oldheads and newheads > oldheads: | 1465 if oldheads and newheads > oldheads: |
1466 heads = _(" (+%d heads)") % (newheads - oldheads) | 1466 heads = _(" (+%d heads)") % (newheads - oldheads) |