Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

hggtk/hglib: adapt to changes in mercurial.ui and mercurial.dispatch

(mercurial changes from 6b5522cb2ad29601a9e31e3e6d191b37c9aba820 to 0ffb8f791b7c5252917dd7946f9891b5e5ae9a0f)
compatible with older versions of mercurial

Changeset e431171348be

Parent 104c53fc0b61

by Simon Heimberg

Changes to 2 files · Browse files at e431171348be Showing diff from parent 104c53fc0b61 Diff from another changeset...

Change 1 of 4 Show Entire File hggtk/​hglib.py Stacked
 
122
123
124
125
126
 
127
128
129
 
293
294
295
296
297
 
 
 
 
 
 
 
 
298
299
300
 
346
347
348
349
350
 
 
 
 
 
 
 
 
351
352
353
 
403
404
405
406
 
407
408
409
 
122
123
124
 
 
125
126
127
128
 
292
293
294
 
 
295
296
297
298
299
300
301
302
303
304
305
 
351
352
353
 
 
354
355
356
357
358
359
360
361
362
363
364
 
414
415
416
 
417
418
419
420
@@ -122,8 +122,7 @@
  self.outputq = outputq   self.dialogq = dialogq   self.responseq = responseq - self.setconfig('ui', 'interactive', 'True') - self.interactive = True + self.setconfig('ui', 'interactive', 'on')     def write(self, *args):   if self.buffers: @@ -293,8 +292,14 @@
  # read --config before doing anything else   # (e.g. to change trust settings for reading .hg/hgrc)   config = _earlygetopt(['--config'], args) - if config: - ui.updateopts(config=_parseconfig(config)) + if hasattr(ui, 'verbosity_constraints'): + # Mercurial 1.2 + if config: + for section, name, value in _parseconfig(config): + self.setconfig(section, name, value) + else: + # Mercurial 1.3 + _parseconfig(ui, config)     # check for cwd   cwd = _earlygetopt(['--cwd'], args) @@ -346,8 +351,14 @@
  _encoding = options["encoding"]   if options["encodingmode"]:   _encodingmode = options["encodingmode"] - ui.updateopts(options["verbose"], options["debug"], options["quiet"], - not options["noninteractive"], options["traceback"]) + if options['verbose'] or options['debug'] or options['quiet']: + ui.setconfig('ui', 'verbose', str(bool(options['verbose']))) + ui.setconfig('ui', 'debug', str(bool(options['debug']))) + ui.setconfig('ui', 'quiet', str(bool(options['quiet']))) + if options['traceback']: + ui.setconfig('ui', 'traceback', 'on') + if options['noninteractive']: + ui.setconfig('ui', 'interactive', 'off')     if options['help']:   return commands.help_(ui, cmd, options['version']) @@ -403,7 +414,7 @@
  class Qui(ui.ui):   def __init__(self):   ui.ui.__init__(self) - self.interactive = False + self.setconfig('ui', 'interactive', 'off')     def write(self, *args):   if self.buffers:
Change 1 of 2 Show Entire File hggtk/​hgtk.py Stacked
 
35
36
37
38
 
 
 
39
40
41
 
132
133
134
135
 
136
137
138
 
35
36
37
 
38
39
40
41
42
43
 
134
135
136
 
137
138
139
140
@@ -35,7 +35,9 @@
 def dispatch(args):   "run the command specified in args"   try: - u = _ui.ui(traceback='--traceback' in args) + u = _ui.ui() + if '--traceback' in args: + u.setconfig('ui', 'traceback', 'on')   if '--debugger' in args:   pdb.set_trace()   return _runcatch(u, args) @@ -132,7 +134,7 @@
 def runcommand(ui, args):   fullargs = args   cmd, func, args, options, cmdoptions = _parse(ui, args) - ui.updateopts(options["verbose"]) + ui.setconfig("ui", "verbose", str(bool(options["verbose"])))     if options['help']:   return help_(ui, cmd)