# HG changeset patch # User Mads Kiilerich <m...@kiilerich.com> # Date 1489346250 25200 # Sun Mar 12 12:17:30 2017 -0700 # Node ID 1b5144a87e936fc8071463956816a89041478126 # Parent 023b6f7456b3622cc81332ae9d6e30b7ecc37415 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 @@ -362,7 +362,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 _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel