Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG743b293c3ca0: py3: use util.forcebytestr to convert error messages to bytes
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| Path | Packages | |||
|---|---|---|---|---|
| M | mercurial/branchmap.py (3 lines) | |||
| M | mercurial/tags.py (2 lines) |
| f.write("%s %s %s\n" % (hex(node), state, | f.write("%s %s %s\n" % (hex(node), state, | ||||
| encoding.fromlocal(label))) | encoding.fromlocal(label))) | ||||
| f.close() | f.close() | ||||
| repo.ui.log('branchcache', | repo.ui.log('branchcache', | ||||
| 'wrote %s branch cache with %d labels and %d nodes\n', | 'wrote %s branch cache with %d labels and %d nodes\n', | ||||
| repo.filtername, len(self), nodecount) | repo.filtername, len(self), nodecount) | ||||
| except (IOError, OSError, error.Abort) as inst: | except (IOError, OSError, error.Abort) as inst: | ||||
| # Abort may be raised by read only opener, so log and continue | # Abort may be raised by read only opener, so log and continue | ||||
| repo.ui.debug("couldn't write branch cache: %s\n" % inst) | repo.ui.debug("couldn't write branch cache: %s\n" % | ||||
| util.forcebytestr(inst)) | |||||
| def update(self, repo, revgen): | def update(self, repo, revgen): | ||||
| """Given a branchhead cache, self, that may have extra nodes or be | """Given a branchhead cache, self, that may have extra nodes or be | ||||
| missing heads, and a generator of nodes that are strictly a superset of | missing heads, and a generator of nodes that are strictly a superset of | ||||
| heads missing, this function updates self to be correct. | heads missing, this function updates self to be correct. | ||||
| """ | """ | ||||
| starttime = util.timer() | starttime = util.timer() | ||||
| cl = repo.changelog | cl = repo.changelog | ||||
| len(data), _fnodescachefile)) | len(data), _fnodescachefile)) | ||||
| f.write(data) | f.write(data) | ||||
| self._dirtyoffset = None | self._dirtyoffset = None | ||||
| finally: | finally: | ||||
| f.close() | f.close() | ||||
| except (IOError, OSError) as inst: | except (IOError, OSError) as inst: | ||||
| repo.ui.log('tagscache', | repo.ui.log('tagscache', | ||||
| "couldn't write cache/%s: %s\n" % ( | "couldn't write cache/%s: %s\n" % ( | ||||
| _fnodescachefile, inst)) | _fnodescachefile, util.forcebytestr(inst))) | ||||
| finally: | finally: | ||||
| lock.release() | lock.release() | ||||