Details
Details
- Reviewers
Alphare - Group Reviewers
hg-reviewers - Commits
- rHGb4ab4fd23199: config: remove pycompat.iteritems()
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
Alphare |
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/config.py (3 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
b9f98a399b51 | 992aaf46a2cf | Gregory Szorc | Mar 1 2022, 11:47 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | D12339 ui: use input() directly | |
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg |
# config.py - configuration parsing for Mercurial | # config.py - configuration parsing for Mercurial | ||||
# | # | ||||
# Copyright 2009 Olivia Mackall <olivia@selenic.com> and others | # Copyright 2009 Olivia Mackall <olivia@selenic.com> and others | ||||
# | # | ||||
# This software may be used and distributed according to the terms of the | # This software may be used and distributed according to the terms of the | ||||
# GNU General Public License version 2 or any later version. | # GNU General Public License version 2 or any later version. | ||||
import errno | import errno | ||||
import os | import os | ||||
from .i18n import _ | from .i18n import _ | ||||
from .pycompat import getattr | from .pycompat import getattr | ||||
from . import ( | from . import ( | ||||
encoding, | encoding, | ||||
error, | error, | ||||
pycompat, | |||||
util, | util, | ||||
) | ) | ||||
class config(object): | class config(object): | ||||
def __init__(self, data=None): | def __init__(self, data=None): | ||||
self._current_source_level = 0 | self._current_source_level = 0 | ||||
self._data = {} | self._data = {} | ||||
if result is None: | if result is None: | ||||
return None | return None | ||||
return result[2] | return result[2] | ||||
def sections(self): | def sections(self): | ||||
return sorted(self._data.keys()) | return sorted(self._data.keys()) | ||||
def items(self, section): | def items(self, section): | ||||
items = pycompat.iteritems(self._data.get(section, {})) | items = self._data.get(section, {}).items() | ||||
return [(k, v[0]) for (k, v) in items] | return [(k, v[0]) for (k, v) in items] | ||||
def set(self, section, item, value, source=b""): | def set(self, section, item, value, source=b""): | ||||
assert not isinstance( | assert not isinstance( | ||||
section, str | section, str | ||||
), b'config section may not be unicode strings on Python 3' | ), b'config section may not be unicode strings on Python 3' | ||||
assert not isinstance( | assert not isinstance( | ||||
item, str | item, str |