Changeset ed5d831928be…
Parent 6da01818c9ea…
by
Changes to one file · Browse files at ed5d831928be Showing diff from parent 6da01818c9ea Diff from another changeset...
@@ -19,16 +19,6 @@
from hggtk import dialog, gdialog, gtklib, hgcmd
-try:
- from mercurial import demandimport
- demandimport.disable()
- import iniparse
- demandimport.enable()
-except ImportError:
- print 'The iniparse python package is required by this tool. Download from'
- print 'http://code.google.com/p/iniparse/'
- sys.exit(0)
-
_unspecstr = _('<unspecified>')
_unspeclocalstr = hglib.fromutf(_unspecstr)
@@ -444,7 +434,20 @@ if configrepo:
dialog.error_dialog(self, _('No repository found'),
_('no repo at ') + root)
- self.response(None, gtk.RESPONSE_CANCEL)
+ self.destroy()
+ return
+
+ try:
+ from mercurial import demandimport
+ demandimport.disable()
+ import iniparse
+ demandimport.enable()
+ except ImportError:
+ dialog.error_dialog(self, _('Iniparse package not found'),
+ _('Please install iniparse package'))
+ self.destroy()
+ print 'Please install http://code.google.com/p/iniparse/'
+ return
# Catch close events
self.connect('response', self.should_live)
@@ -936,6 +939,7 @@ f.write(_('# Generated by tortoisehg-config\n'))
f.close()
self.fn = fn
+ import iniparse
return iniparse.INIConfig(file(fn), optionxformvalue=None)
def record_new_value(self, cpath, newvalue, keephistory=True):
|
Loading...