Details
Details
- Reviewers
yuja - Group Reviewers
hg-reviewers - Commits
- rHG558e01a23f40: py3: slice on bytes to prevent getting the ascii values
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
yuja |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
lines = [] | lines = [] | ||||
if firstline is not None: | if firstline is not None: | ||||
lines.append('%s\n' % firstline) | lines.append('%s\n' % firstline) | ||||
for k, v in data.items(): | for k, v in data.items(): | ||||
if k == self.firstlinekey: | if k == self.firstlinekey: | ||||
e = "key name '%s' is reserved" % self.firstlinekey | e = "key name '%s' is reserved" % self.firstlinekey | ||||
raise error.ProgrammingError(e) | raise error.ProgrammingError(e) | ||||
if not k[0].isalpha(): | if not k[0:1].isalpha(): | ||||
e = "keys must start with a letter in a key-value file" | e = "keys must start with a letter in a key-value file" | ||||
raise error.ProgrammingError(e) | raise error.ProgrammingError(e) | ||||
if not k.isalnum(): | if not k.isalnum(): | ||||
e = "invalid key name in a simple key-value file" | e = "invalid key name in a simple key-value file" | ||||
raise error.ProgrammingError(e) | raise error.ProgrammingError(e) | ||||
if '\n' in v: | if '\n' in v: | ||||
e = "invalid value in a simple key-value file" | e = "invalid value in a simple key-value file" | ||||
raise error.ProgrammingError(e) | raise error.ProgrammingError(e) |