Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 3452:fcf14d87e0a4
If we can't write the branch cache, fail quietly.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 18 Oct 2006 10:46:51 -0500 |
parents | 27ebe4efe98e |
children | dba3cadef789 0e68608bd11d |
comparison
equal
deleted
inserted
replaced
3451:196baf20232b | 3452:fcf14d87e0a4 |
---|---|
320 self._writebranchcache() | 320 self._writebranchcache() |
321 | 321 |
322 return self.branchcache | 322 return self.branchcache |
323 | 323 |
324 def _writebranchcache(self): | 324 def _writebranchcache(self): |
325 f = self.opener("branches.cache", "w") | 325 try: |
326 t = self.changelog.tip() | 326 f = self.opener("branches.cache", "w") |
327 f.write("%s %s\n" % (hex(t), self.changelog.count() - 1)) | 327 t = self.changelog.tip() |
328 for label, node in self.branchcache.iteritems(): | 328 f.write("%s %s\n" % (hex(t), self.changelog.count() - 1)) |
329 f.write("%s %s\n" % (hex(node), label)) | 329 for label, node in self.branchcache.iteritems(): |
330 f.write("%s %s\n" % (hex(node), label)) | |
331 except IOError: | |
332 pass | |
330 | 333 |
331 def lookup(self, key): | 334 def lookup(self, key): |
332 if key == '.': | 335 if key == '.': |
333 key = self.dirstate.parents()[0] | 336 key = self.dirstate.parents()[0] |
334 if key == nullid: | 337 if key == nullid: |