Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

thgconfig: move tab configurations out of __init__

Changeset c306df22c254

Parent 11905ab451e0

by Steve Borho

Changes to one file · Browse files at c306df22c254 Showing diff from parent 11905ab451e0 Diff from another changeset...

 
18
19
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
22
23
 
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
 
99
100
101
102
103
104
105
106
107
108
109
110
 
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
 
128
129
130
131
132
133
134
135
136
137
 
138
139
140
 
191
192
193
 
 
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
 
 
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
 
 
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
 
306
307
308
 
390
391
392
393
 
 
394
395
396
 
577
578
579
580
 
581
582
583
 
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
 
231
232
233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
 
235
236
 
 
 
 
 
 
 
 
 
237
 
238
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
 
241
242
 
 
 
 
 
 
 
243
 
244
245
246
247
 
298
299
300
301
302
303
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
305
306
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
308
309
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
 
311
312
313
314
 
396
397
398
 
399
400
401
402
403
 
584
585
586
 
587
588
589
590
@@ -18,6 +18,164 @@
   _unspecstr = '<unspecified>'   +_tortoise_info = ( + ('3-way Merge Tool', 'ui.merge', [], + 'Graphical merge program for resolving merge conflicts. If left' + ' unspecified, Mercurial will use the first applicable tool it finds' + ' on your system or use its internal merge tool that leaves conflict' + ' markers in place.'), + ('Visual Diff Command', 'tortoisehg.vdiff', [], + 'Specify visual diff tool; must be an extdiff command'), + ('Visual Editor', 'tortoisehg.editor', [], + 'Specify the visual editor used to view files, etc'), + ('CLI Editor', 'ui.editor', [], + 'The editor to use during a commit and other' + ' instances where Mercurial needs multiline input from' + ' the user. Only used by CLI commands.'), + ('Tab Width', 'tortoisehg.tabwidth', [], + 'Specify the number of spaces to expand tabs.' + ' Default: Not expanded'), + ('Overlay Icons', 'tortoisehg.overlayicons', + ['False', 'True', 'localdisks'], + 'Display overlay icons in Explorer windows.' + ' Default: True')) + +_commit_info = ( + ('Username', 'ui.username', [], + 'Name associated with commits'), + ('Commit Tool', 'tortoisehg.commit', ['internal', 'qct'], + 'Select commit tool launched by TortoiseHg. Qct must' + ' must be installed separately'), + ('Bottom Diffs', 'gtools.diffbottom', ['False', 'True'], + 'Move diff panel below file list in status and' + ' commit dialogs. Default: False')) + +_log_info = ( + ('Author Coloring', 'tortoisehg.authorcolor', ['False', 'True'], + 'Color changesets by author name. If not enabled,' + ' the changes are colored green for merge, red for' + ' non-trivial parents, black for normal. Default: False'), + ('Long Summary', 'tortoisehg.longsummary', ['False', 'True'], + 'Concatenate multiple lines of changeset summary' + ' until they reach 80 characters. Default: False'), + ('Log Batch Size', 'tortoisehg.graphlimit', ['500'], + 'The number of revisions to read and display in the' + ' changelog viewer in a single batch. Default: 500'), + ('Copy Hash', 'tortoisehg.copyhash', ['False', 'True'], + 'Allow the changelog viewer to copy hash of currently' + ' selected changeset into the clipboard. Default: False')) + +_paths_info = ( + ('default', 'paths.default', [], + 'Directory or URL to use when pulling if no source is specified.' + ' Default is set to repository from which the repository was cloned.'), + ('default-push', 'paths.default-push', [], + 'Optional. Directory or URL to use when pushing if no' + ' destination is specified.''')) + +_web_info = ( + ('Name', 'web.name', ['unknown'], + 'Repository name to use in the web interface. Default' + ' is the working directory.'), + ('Description', 'web.description', ['unknown'], + 'Textual description of the repository''s purpose or' + ' contents.'), + ('Contact', 'web.contact', ['unknown'], + 'Name or email address of the person in charge of the' + ' repository.'), + ('Style', 'web.style', + ['paper', 'monoblue', 'coal', 'spartan', 'gitweb', 'old'], + 'Which template map style to use'), + ('Archive Formats', 'web.allow_archive', ['bz2', 'gz', 'zip'], + 'Comma separated list of archive formats allowed for' + ' downloading'), + ('Port', 'web.port', ['8000'], 'Port to listen on'), + ('Push Requires SSL', 'web.push_ssl', ['True', 'False'], + 'Whether to require that inbound pushes be transported' + ' over SSL to prevent password sniffing.'), + ('Stripes', 'web.stripes', ['1', '0'], + 'How many lines a "zebra stripe" should span in multiline' + ' output. Default is 1; set to 0 to disable.'), + ('Max Files', 'web.maxfiles', ['10'], + 'Maximum number of files to list per changeset.'), + ('Max Changes', 'web.maxfiles', ['10'], + 'Maximum number of changes to list on the changelog.'), + ('Allow Push', 'web.allow_push', ['*'], + 'Whether to allow pushing to the repository. If empty or not' + ' set, push is not allowed. If the special value "*", any remote' + ' user can push, including unauthenticated users. Otherwise, the' + ' remote user must have been authenticated, and the authenticated' + ' user name must be present in this list (separated by whitespace' + ' or ","). The contents of the allow_push list are examined after' + ' the deny_push list.'), + ('Deny Push', 'web.deny_push', ['*'], + 'Whether to deny pushing to the repository. If empty or not set,' + ' push is not denied. If the special value "*", all remote users' + ' are denied push. Otherwise, unauthenticated users are all' + ' denied, and any authenticated user name present in this list' + ' (separated by whitespace or ",") is also denied. The contents' + ' of the deny_push list are examined before the allow_push list.'), + ('Encoding', 'web.encoding', ['UTF-8'], + 'Character encoding name')) + +_proxy_info = ( + ('host', 'http_proxy.host', [], + 'Host name and (optional) port of proxy server, for' + ' example "myproxy:8000"'), + ('no', 'http_proxy.no', [], + 'Optional. Comma-separated list of host names that' + ' should bypass the proxy'), + ('passwd', 'http_proxy.passwd', [], + 'Optional. Password to authenticate with at the' + ' proxy server'), + ('user', 'http_proxy.user', [], + 'Optional. User name to authenticate with at the' + ' proxy server')) + +_email_info = ( + ('From', 'email.from', [], + 'Email address to use in "From" header and SMTP envelope'), + ('To', 'email.to', [], + 'Comma-separated list of recipient email addresses'), + ('Cc', 'email.cc', [], + 'Comma-separated list of carbon copy recipient email' + ' addresses'), + ('Bcc', 'email.bcc', [], + 'Comma-separated list of blind carbon copy recipient' + ' email addresses'), + ('method', 'email.method', ['smtp'], +'Optional. Method to use to send email messages. If value is "smtp" (default),' +' use SMTP (configured below). Otherwise, use as name of program to run that' +' acts like sendmail (takes "-f" option for sender, list of recipients on' +' command line, message on stdin). Normally, setting this to "sendmail" or' +' "/usr/sbin/sendmail" is enough to use sendmail to send messages.'), + ('SMTP Host', 'smtp.host', [], 'Host name of mail server'), + ('SMTP Port', 'smtp.port', ['25'], + 'Port to connect to on mail server. Default: 25'), + ('SMTP TLS', 'smtp.tls', ['False', 'True'], + 'Connect to mail server using TLS. Default: False'), + ('SMTP Username', 'smtp.username', [], + 'Username to authenticate to SMTP server with'), + ('SMTP Password', 'smtp.password', [], + 'Password to authenticate to SMTP server with'), + ('Local Hostname', 'smtp.local_hostname', [], + 'Hostname the sender can use to identify itself to MTA')) + +_diff_info = ( + ('Git Format', 'diff.git', ['False', 'True'], + 'Use git extended diff format.'), + ('No Dates', 'diff.nodates', ['False', 'True'], + 'Do no include dates in diff headers.'), + ('Show Function', 'diff.showfunc', ['False', 'True'], + 'Show which function each change is in.'), + ('Ignore White Space', 'diff.ignorews', ['False', 'True'], + 'Ignore white space when comparing lines.'), + ('Ignore WS Amount', 'diff.ignorewsamount', ['False', 'True'], + 'Ignore changes in the amount of white space.'), + ('Ignore Blank Lines', 'diff.ignoreblanklines', + ['False', 'True'], + 'Ignore changes whose lines are all blank.')) +  class ConfigDialog(gtk.Dialog):   def __init__(self, root='',   configrepo=False, @@ -73,68 +231,17 @@
  self.history = shlib.Settings('config_history')     # create pages for each section of configuration file - self._tortoise_info = ( - ('3-way Merge Tool', 'ui.merge', [], -'Graphical merge program for resolving merge conflicts. If left' -' unspecified, Mercurial will use the first applicable tool it finds' -' on your system or use its internal merge tool that leaves conflict' -' markers in place.'), - ('Visual Diff Command', 'tortoisehg.vdiff', [], - 'Specify visual diff tool; must be an extdiff command'), - ('Visual Editor', 'tortoisehg.editor', [], - 'Specify the visual editor used to view files, etc'), - ('CLI Editor', 'ui.editor', [], - 'The editor to use during a commit and other' - ' instances where Mercurial needs multiline input from' - ' the user. Only used by CLI commands.'), - ('Tab Width', 'tortoisehg.tabwidth', [], - 'Specify the number of spaces to expand tabs.' - ' Default: Not expanded'), - ('Overlay Icons', 'tortoisehg.overlayicons', - ['False', 'True', 'localdisks'], - 'Display overlay icons in Explorer windows.' - ' Default: True'))   self.tortoise_frame = self.add_page(notebook, 'TortoiseHG') - self.fill_frame(self.tortoise_frame, self._tortoise_info) + self.fill_frame(self.tortoise_frame, _tortoise_info)   - self._commit_info = ( - ('Username', 'ui.username', [], - 'Name associated with commits'), - ('Commit Tool', 'tortoisehg.commit', ['internal', 'qct'], - 'Select commit tool launched by TortoiseHg. Qct must' - ' must be installed separately'), - ('Bottom Diffs', 'gtools.diffbottom', ['False', 'True'], - 'Move diff panel below file list in status and' - ' commit dialogs. Default: False'))   self.commit_frame = self.add_page(notebook, 'Commit') - self.fill_frame(self.commit_frame, self._commit_info) + self.fill_frame(self.commit_frame, _commit_info)   - self._log_info = ( - ('Author Coloring', 'tortoisehg.authorcolor', ['False', 'True'], - 'Color changesets by author name. If not enabled,' - ' the changes are colored green for merge, red for' - ' non-trivial parents, black for normal. Default: False'), - ('Long Summary', 'tortoisehg.longsummary', ['False', 'True'], - 'Concatenate multiple lines of changeset summary' - ' until they reach 80 characters. Default: False'), - ('Log Batch Size', 'tortoisehg.graphlimit', ['500'], - 'The number of revisions to read and display in the' - ' changelog viewer in a single batch. Default: 500'), - ('Copy Hash', 'tortoisehg.copyhash', ['False', 'True'], - 'Allow the changelog viewer to copy hash of currently' - ' selected changeset into the clipboard. Default: False'))   self.log_frame = self.add_page(notebook, 'Changelog') - self.fill_frame(self.log_frame, self._log_info) + self.fill_frame(self.log_frame, _log_info)   - self._paths_info = ( - ('default', 'paths.default', [], -'Directory or URL to use when pulling if no source is specified.' -' Default is set to repository from which the current repository was cloned.'), - ('default-push', 'paths.default-push', [], -'Optional. Directory or URL to use when pushing if no' -' destination is specified.'''))   self.paths_frame = self.add_page(notebook, 'Paths') - vbox = self.fill_frame(self.paths_frame, self._paths_info) + vbox = self.fill_frame(self.paths_frame, _paths_info)     # Initialize data model for 'Paths' tab   self.pathdata = gtk.ListStore( @@ -191,118 +298,17 @@
  vbox.pack_start(buttonbox, False, False, 4)   self.refresh_path_list()   + self.web_frame = self.add_page(notebook, 'Web') + self.fill_frame(self.web_frame, _web_info)   - self._web_info = ( - ('Name', 'web.name', ['unknown'], - 'Repository name to use in the web interface. Default' - ' is the working directory.'), - ('Description', 'web.description', ['unknown'], - 'Textual description of the repository''s purpose or' - ' contents.'), - ('Contact', 'web.contact', ['unknown'], - 'Name or email address of the person in charge of the' - ' repository.'), - ('Style', 'web.style', - ['paper', 'monoblue', 'coal', 'spartan', 'gitweb', 'old'], - 'Which template map style to use'), - ('Archive Formats', 'web.allow_archive', ['bz2', 'gz', 'zip'], - 'Comma separated list of archive formats allowed for' - ' downloading'), - ('Port', 'web.port', ['8000'], 'Port to listen on'), - ('Push Requires SSL', 'web.push_ssl', ['True', 'False'], - 'Whether to require that inbound pushes be transported' - ' over SSL to prevent password sniffing.'), - ('Stripes', 'web.stripes', ['1', '0'], - 'How many lines a "zebra stripe" should span in multiline' - ' output. Default is 1; set to 0 to disable.'), - ('Max Files', 'web.maxfiles', ['10'], - 'Maximum number of files to list per changeset.'), - ('Max Changes', 'web.maxfiles', ['10'], - 'Maximum number of changes to list on the changelog.'), - ('Allow Push', 'web.allow_push', ['*'], -'Whether to allow pushing to the repository. If empty or not' -' set, push is not allowed. If the special value "*", any remote' -' user can push, including unauthenticated users. Otherwise, the' -' remote user must have been authenticated, and the authenticated' -' user name must be present in this list (separated by whitespace' -' or ","). The contents of the allow_push list are examined after' -' the deny_push list.'), - ('Deny Push', 'web.deny_push', ['*'], -'Whether to deny pushing to the repository. If empty or not set,' -' push is not denied. If the special value "*", all remote users' -' are denied push. Otherwise, unauthenticated users are all' -' denied, and any authenticated user name present in this list' -' (separated by whitespace or ",") is also denied. The contents' -' of the deny_push list are examined before the allow_push list.'), - ('Encoding', 'web.encoding', ['UTF-8'], - 'Character encoding name')) - self.web_frame = self.add_page(notebook, 'Web') - self.fill_frame(self.web_frame, self._web_info) + self.proxy_frame = self.add_page(notebook, 'Proxy') + self.fill_frame(self.proxy_frame, _proxy_info)   - self._proxy_info = ( - ('host', 'http_proxy.host', [], - 'Host name and (optional) port of proxy server, for' - ' example "myproxy:8000"'), - ('no', 'http_proxy.no', [], - 'Optional. Comma-separated list of host names that' - ' should bypass the proxy'), - ('passwd', 'http_proxy.passwd', [], - 'Optional. Password to authenticate with at the' - ' proxy server'), - ('user', 'http_proxy.user', [], - 'Optional. User name to authenticate with at the' - ' proxy server')) - self.proxy_frame = self.add_page(notebook, 'Proxy') - self.fill_frame(self.proxy_frame, self._proxy_info) + self.email_frame = self.add_page(notebook, 'Email') + self.fill_frame(self.email_frame, _email_info)   - self._email_info = ( - ('From', 'email.from', [], - 'Email address to use in "From" header and SMTP envelope'), - ('To', 'email.to', [], - 'Comma-separated list of recipient email addresses'), - ('Cc', 'email.cc', [], - 'Comma-separated list of carbon copy recipient email' - ' addresses'), - ('Bcc', 'email.bcc', [], - 'Comma-separated list of blind carbon copy recipient' - ' email addresses'), - ('method', 'email.method', ['smtp'], -'Optional. Method to use to send email messages. If value is "smtp" (default),' -' use SMTP (configured below). Otherwise, use as name of program to run that' -' acts like sendmail (takes "-f" option for sender, list of recipients on' -' command line, message on stdin). Normally, setting this to "sendmail" or' -' "/usr/sbin/sendmail" is enough to use sendmail to send messages.'), - ('SMTP Host', 'smtp.host', [], 'Host name of mail server'), - ('SMTP Port', 'smtp.port', ['25'], - 'Port to connect to on mail server. Default: 25'), - ('SMTP TLS', 'smtp.tls', ['False', 'True'], - 'Connect to mail server using TLS. Default: False'), - ('SMTP Username', 'smtp.username', [], - 'Username to authenticate to SMTP server with'), - ('SMTP Password', 'smtp.password', [], - 'Password to authenticate to SMTP server with'), - ('Local Hostname', 'smtp.local_hostname', [], - 'Hostname the sender can use to identify itself to MTA')) - self.email_frame = self.add_page(notebook, 'Email') - self.fill_frame(self.email_frame, self._email_info) - - self._diff_info = ( - ('Git Format', 'diff.git', ['False', 'True'], - 'Use git extended diff format.'), - ('No Dates', 'diff.nodates', ['False', 'True'], - 'Do no include dates in diff headers.'), - ('Show Function', 'diff.showfunc', ['False', 'True'], - 'Show which function each change is in.'), - ('Ignore White Space', 'diff.ignorews', ['False', 'True'], - 'Ignore white space when comparing lines.'), - ('Ignore WS Amount', 'diff.ignorewsamount', ['False', 'True'], - 'Ignore changes in the amount of white space.'), - ('Ignore Blank Lines', 'diff.ignoreblanklines', - ['False', 'True'], - 'Ignore changes whose lines are all blank.'), - )   self.diff_frame = self.add_page(notebook, 'Diff') - self.fill_frame(self.diff_frame, self._diff_info) + self.fill_frame(self.diff_frame, _diff_info)     # Force dialog into clean state in the beginning   self._refresh_vlist() @@ -390,7 +396,8 @@
  return   if testpath[0] == '~':   testpath = os.path.expanduser(testpath) - cmdline = ['hg', 'incoming', '--repository', self.root, '--verbose', testpath] + cmdline = ['hg', 'incoming', '--repository', self.root, + '--verbose', testpath]   from hgcmd import CmdDialog   dlg = CmdDialog(cmdline)   dlg.run() @@ -577,7 +584,7 @@
  f.write(str(self.ini))   f.close()   except IOError, e: - error_dialog(self, 'Unable to write back configuration file', str(e)) + error_dialog(self, 'Unable to write configuration file', str(e))     self._btn_apply.set_sensitive(False)   self.dirty = False