Show More
@@ -108,6 +108,16 b' class config(object):' | |||||
108 | self._source = self._source.preparewrite() |
|
108 | self._source = self._source.preparewrite() | |
109 | self._source[(section, item)] = source |
|
109 | self._source[(section, item)] = source | |
110 |
|
110 | |||
|
111 | def alter(self, section, key, new_value): | |||
|
112 | """alter a value without altering its source or level | |||
|
113 | ||||
|
114 | This method is meant to be used by `ui.fixconfig` only.""" | |||
|
115 | item = self._data[section][key] | |||
|
116 | size = len(item) | |||
|
117 | new_item = (new_value,) + item[1:] | |||
|
118 | assert len(new_item) == size | |||
|
119 | self._data[section][key] = new_item | |||
|
120 | ||||
111 | def restore(self, data): |
|
121 | def restore(self, data): | |
112 | """restore data returned by self.backup""" |
|
122 | """restore data returned by self.backup""" | |
113 | self._source = self._source.preparewrite() |
|
123 | self._source = self._source.preparewrite() |
@@ -554,7 +554,7 b' class ui(object):' | |||||
554 | p = util.expandpath(p) |
|
554 | p = util.expandpath(p) | |
555 | if not util.hasscheme(p) and not os.path.isabs(p): |
|
555 | if not util.hasscheme(p) and not os.path.isabs(p): | |
556 | p = os.path.normpath(os.path.join(root, p)) |
|
556 | p = os.path.normpath(os.path.join(root, p)) | |
557 |
c. |
|
557 | c.alter(b"paths", n, p) | |
558 |
|
558 | |||
559 | if section in (None, b'ui'): |
|
559 | if section in (None, b'ui'): | |
560 | # update ui options |
|
560 | # update ui options |
General Comments 0
You need to be logged in to leave comments.
Login now