# HG changeset patch # User Mads Kiilerich # Date 2017-03-12 19:17:30 # Node ID 7dd2f51f38ac224cec522d093ff6f805beb0dd3e # Parent 906be86990c4b445366090b29eb46f5045e8f170 rbc: empty (and invalid) rbc-names file should give an empty name list An empty file (if it somehow should exist) used to give a list with an empty name. That didn't do any harm, but it was "wrong". Fix that. diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py --- a/mercurial/branchmap.py +++ b/mercurial/branchmap.py @@ -360,7 +360,9 @@ class revbranchcache(object): try: bndata = repo.vfs.read(_rbcnames) self._rbcsnameslen = len(bndata) # for verification before writing - self._names = [encoding.tolocal(bn) for bn in bndata.split('\0')] + if bndata: + self._names = [encoding.tolocal(bn) + for bn in bndata.split('\0')] except (IOError, OSError): if readonly: # don't try to use cache - fall back to the slow path