Changeset 278134c79beb…
Parent 435f7adc9c6b…
by
Changes to 4 files · Browse files at 278134c79beb Showing diff from parent 435f7adc9c6b Diff from another changeset...
@@ -92,7 +92,7 @@ gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
self.cwd = cwd or os.getcwd()
self.ui = ui
- self.ui.interactive=False
+ self.ui.setconfig('ui', 'interactive', 'off')
self.repo = repo or hg.repository(ui, path=hglib.rootpath())
self.pats = pats
self.opts = opts
|
@@ -101,6 +101,9 @@ return line[0] + line[1:].expandtabs(_tabwidth)
+def calliffunc(f):
+ return hasattr(f, '__call__') and f() or f
+
class GtkUi(ui.ui):
'''
PyGtk enabled mercurial.ui subclass. All this code will be running
@@ -137,7 +140,7 @@
def prompt(self, msg, pat=None, default="y"):
import re
- if not self.interactive: return default
+ if not calliffunc(self.interactive): return default
while True:
try:
# send request to main thread, await response
|
@@ -420,7 +420,7 @@
? - display help'''
- if not ui.interactive:
+ if not hglib.calliffunc(ui.interactive):
raise util.Abort(_('shelve can only be run interactively'))
forced = opts['force'] or opts['append']
|
@@ -176,7 +176,7 @@ return sc
# shelve them!
- self.ui.interactive = True # hgshelve only works 'interactively'
+ self.ui.setconfig('ui', 'interactive', 'on') # hgshelve only works 'interactively'
opts = {'addremove': None, 'include': [], 'force': doforce,
'append': doappend, 'exclude': []}
hgshelve.filterpatch = filter_patch
|
Loading...