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