Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 2075:343aeefb553b
Make the appendfile class inline-data index friendly
The appendfile class needs a few changes to make it work with interleaved
index files. It needs to support the tell() method, opening in a+ mode,
and it needs to delay the checkinlinesize call until after the
append file is written.
Given that open(file, "a+") doesn't always seek to the end of the file,
this adds seek operations to appendfile that understand whence args
author | mason@suse.com |
---|---|
date | Tue, 04 Apr 2006 16:38:43 -0400 |
parents | 1e6745f78989 |
children | 856f0ba200bc |
comparison
equal
deleted
inserted
replaced
2074:01ee43dda681 | 2075:343aeefb553b |
---|---|
166 return self.tags()[key] | 166 return self.tags()[key] |
167 except KeyError: | 167 except KeyError: |
168 try: | 168 try: |
169 return self.changelog.lookup(key) | 169 return self.changelog.lookup(key) |
170 except: | 170 except: |
171 raise | |
171 raise repo.RepoError(_("unknown revision '%s'") % key) | 172 raise repo.RepoError(_("unknown revision '%s'") % key) |
172 | 173 |
173 def dev(self): | 174 def dev(self): |
174 return os.stat(self.path).st_dev | 175 return os.stat(self.path).st_dev |
175 | 176 |
1454 cl.writedata() | 1455 cl.writedata() |
1455 | 1456 |
1456 # make changelog and manifest see real files again | 1457 # make changelog and manifest see real files again |
1457 self.changelog = changelog.changelog(self.opener) | 1458 self.changelog = changelog.changelog(self.opener) |
1458 self.manifest = manifest.manifest(self.opener) | 1459 self.manifest = manifest.manifest(self.opener) |
1460 self.changelog.checkinlinesize(tr) | |
1461 self.changelog.checkinlinesize(tr) | |
1459 | 1462 |
1460 newheads = len(self.changelog.heads()) | 1463 newheads = len(self.changelog.heads()) |
1461 heads = "" | 1464 heads = "" |
1462 if oldheads and newheads > oldheads: | 1465 if oldheads and newheads > oldheads: |
1463 heads = _(" (+%d heads)") % (newheads - oldheads) | 1466 heads = _(" (+%d heads)") % (newheads - oldheads) |