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.
--- a/mercurial/branchmap.py Wed Oct 19 02:46:35 2016 +0200
+++ b/mercurial/branchmap.py Sun Mar 12 12:17:30 2017 -0700
@@ -360,7 +360,9 @@
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