Show More
@@ -98,38 +98,25 b' class ui(object):' | |||||
98 | root = os.path.expanduser('~') |
|
98 | root = os.path.expanduser('~') | |
99 | self.fixconfig(root=root) |
|
99 | self.fixconfig(root=root) | |
100 |
|
100 | |||
101 |
def fixconfig(self, |
|
101 | def fixconfig(self, root=None): | |
102 | # translate paths relative to root (or home) into absolute paths |
|
102 | # translate paths relative to root (or home) into absolute paths | |
103 | if section is None or section == 'paths': |
|
103 | root = root or os.getcwd() | |
104 | if root is None: |
|
104 | for c in self.cdata, self.ucdata, self.overlay: | |
105 | root = os.getcwd() |
|
105 | for n, p in c.items('paths'): | |
106 | items = section and [(name, value)] or [] |
|
106 | if p and "://" not in p and not os.path.isabs(p): | |
107 | for cdata in self.cdata, self.ucdata, self.overlay: |
|
107 | c.set("paths", n, os.path.normpath(os.path.join(root, p))) | |
108 | if not items and 'paths' in cdata: |
|
|||
109 | pathsitems = cdata.items('paths') |
|
|||
110 | else: |
|
|||
111 | pathsitems = items |
|
|||
112 | for n, path in pathsitems: |
|
|||
113 | if path and "://" not in path and not os.path.isabs(path): |
|
|||
114 | cdata.set("paths", n, |
|
|||
115 | os.path.normpath(os.path.join(root, path))) |
|
|||
116 |
|
108 | |||
117 | # update ui options |
|
109 | # update ui options | |
118 | if section is None or section == 'ui': |
|
|||
119 |
|
|
110 | self.debugflag = self.configbool('ui', 'debug') | |
120 |
|
|
111 | self.verbose = self.debugflag or self.configbool('ui', 'verbose') | |
121 |
|
|
112 | self.quiet = not self.debugflag and self.configbool('ui', 'quiet') | |
122 |
|
|
113 | if self.verbose and self.quiet: | |
123 |
|
|
114 | self.quiet = self.verbose = False | |
124 |
|
115 | self.report_untrusted = self.configbool("ui", "report_untrusted", True) | ||
125 |
|
|
116 | self.interactive = self.configbool("ui", "interactive", self.isatty()) | |
126 | True) |
|
|||
127 | self.interactive = self.configbool("ui", "interactive", |
|
|||
128 | self.isatty()) |
|
|||
129 |
|
|
117 | self.traceback = self.configbool('ui', 'traceback', False) | |
130 |
|
118 | |||
131 | # update trust information |
|
119 | # update trust information | |
132 | if section is None or section == 'trusted': |
|
|||
133 |
|
|
120 | for user in self.configlist('trusted', 'users'): | |
134 |
|
|
121 | self.trusted_users[user] = 1 | |
135 |
|
|
122 | for group in self.configlist('trusted', 'groups'): | |
@@ -138,7 +125,7 b' class ui(object):' | |||||
138 | def setconfig(self, section, name, value): |
|
125 | def setconfig(self, section, name, value): | |
139 | for cdata in (self.overlay, self.cdata, self.ucdata): |
|
126 | for cdata in (self.overlay, self.cdata, self.ucdata): | |
140 | cdata.set(section, name, value) |
|
127 | cdata.set(section, name, value) | |
141 |
self.fixconfig( |
|
128 | self.fixconfig() | |
142 |
|
129 | |||
143 | def _get_cdata(self, untrusted): |
|
130 | def _get_cdata(self, untrusted): | |
144 | if untrusted: |
|
131 | if untrusted: | |
@@ -231,7 +218,7 b' class ui(object):' | |||||
231 | if p and '%%' in p: |
|
218 | if p and '%%' in p: | |
232 | ui.warn('(deprecated \'\%\%\' in path %s=%s from %s)\n' % |
|
219 | ui.warn('(deprecated \'\%\%\' in path %s=%s from %s)\n' % | |
233 | (loc, p, self.configsource('paths', loc))) |
|
220 | (loc, p, self.configsource('paths', loc))) | |
234 |
|
|
221 | p = p.replace('%%', '%') | |
235 | return p |
|
222 | return p | |
236 |
|
223 | |||
237 | def expandpath(self, loc, default=None): |
|
224 | def expandpath(self, loc, default=None): |
General Comments 0
You need to be logged in to leave comments.
Login now