Show More
@@ -112,6 +112,17 b' def get_hg_settings():' | |||||
112 |
|
112 | |||
113 | return settings |
|
113 | return settings | |
114 |
|
114 | |||
|
115 | ui_sections = ['alias', 'auth', | |||
|
116 | 'decode/encode', 'defaults', | |||
|
117 | 'diff', 'email', | |||
|
118 | 'extensions', 'format', | |||
|
119 | 'merge-patterns', 'merge-tools', | |||
|
120 | 'hooks', 'http_proxy', | |||
|
121 | 'smtp', 'patch', | |||
|
122 | 'paths', 'profiling', | |||
|
123 | 'server', 'trusted', | |||
|
124 | 'ui', 'web', ] | |||
|
125 | ||||
115 | def make_ui(read_from='file', path=None, checkpaths=True): |
|
126 | def make_ui(read_from='file', path=None, checkpaths=True): | |
116 | """ |
|
127 | """ | |
117 | A function that will read python rc files or database |
|
128 | A function that will read python rc files or database | |
@@ -122,16 +133,7 b" def make_ui(read_from='file', path=None," | |||||
122 | @param read_from: read from 'file' or 'db' |
|
133 | @param read_from: read from 'file' or 'db' | |
123 | """ |
|
134 | """ | |
124 | #propagated from mercurial documentation |
|
135 | #propagated from mercurial documentation | |
125 | sections = ['alias', 'auth', |
|
136 | ||
126 | 'decode/encode', 'defaults', |
|
|||
127 | 'diff', 'email', |
|
|||
128 | 'extensions', 'format', |
|
|||
129 | 'merge-patterns', 'merge-tools', |
|
|||
130 | 'hooks', 'http_proxy', |
|
|||
131 | 'smtp', 'patch', |
|
|||
132 | 'paths', 'profiling', |
|
|||
133 | 'server', 'trusted', |
|
|||
134 | 'ui', 'web', ] |
|
|||
135 | baseui = ui.ui() |
|
137 | baseui = ui.ui() | |
136 |
|
138 | |||
137 |
|
139 | |||
@@ -142,7 +144,7 b" def make_ui(read_from='file', path=None," | |||||
142 |
|
144 | |||
143 | cfg = config.config() |
|
145 | cfg = config.config() | |
144 | cfg.read(path) |
|
146 | cfg.read(path) | |
145 | for section in sections: |
|
147 | for section in ui_sections: | |
146 | for k, v in cfg.items(section): |
|
148 | for k, v in cfg.items(section): | |
147 | baseui.setconfig(section, k, v) |
|
149 | baseui.setconfig(section, k, v) | |
148 | if checkpaths:check_repo_dir(cfg.items('paths')) |
|
150 | if checkpaths:check_repo_dir(cfg.items('paths')) |
General Comments 0
You need to be logged in to leave comments.
Login now