Changeset cbcd392bdeea…
Parent c30783fbe84b…
by
Changes to 7 files · Browse files at cbcd392bdeea Showing diff from parent c30783fbe84b Diff from another changeset...
@@ -107,8 +107,15 @@ bb.setEnabled(True)
ble.setEnabled(True)
ble.setFocus()
- except (util.Abort, error.RepoLookupError), e:
+ except error.RepoLookupError, e:
self.cmd.core.stbar.showMessage(hglib.tounicode(str(e)))
+ except util.Abort, e:
+ if e.hint:
+ err = _('%s (hint: %s)') % (hglib.tounicode(str(e)),
+ hglib.tounicode(e.hint))
+ else:
+ err = hglib.tounicode(str(e))
+ self.cmd.core.stbar.showMessage(err)
def bverify():
bad = hglib.fromunicode(ble.text().simplified())
try:
@@ -121,8 +128,15 @@ cmds.append(prefix + ['--good', str(self.goodrev)])
cmds.append(prefix + ['--bad', str(self.badrev)])
self.cmd.run(*cmds)
- except (util.Abort, error.RepoLookupError), e:
+ except error.RepoLookupError, e:
self.cmd.core.stbar.showMessage(hglib.tounicode(str(e)))
+ except util.Abort, e:
+ if e.hint:
+ err = _('%s (hint: %s)') % (hglib.tounicode(str(e)),
+ hglib.tounicode(e.hint))
+ else:
+ err = hglib.tounicode(str(e))
+ self.cmd.core.stbar.showMessage(err)
gb.pressed.connect(gverify)
bb.pressed.connect(bverify)
|
@@ -598,7 +598,12 @@ else:
dcmd = []
except error.Abort, e:
- self.showMessage.emit(hglib.tounicode(str(e)))
+ if e.hint:
+ err = _('%s (hint: %s)') % (hglib.tounicode(str(e)),
+ hglib.tounicode(e.hint))
+ else:
+ err = hglib.tounicode(str(e))
+ self.showMessage.emit(err)
dcmd = []
if self.opts.get('patchName'):
cmdline = ['qnew', '--repository', repo.root,
@@ -893,8 +898,12 @@ try:
util.parsedate(date)
except error.Abort, e:
- qtlib.WarningMsgBox(_('Invalid date format'),
- hglib.tounicode(e), parent=self)
+ if e.hint:
+ err = _('%s (hint: %s)') % (hglib.tounicode(str(e)),
+ hglib.tounicode(e.hint))
+ else:
+ err = hglib.tounicode(str(e))
+ qtlib.WarningMsgBox(_('Invalid date format'), err, parent=self)
return
outopts['date'] = date
else:
@@ -909,8 +918,13 @@ try:
self.repo.ui.username()
except util.Abort, e:
+ if e.hint:
+ err = _('%s (hint: %s)') % (hglib.tounicode(str(e)),
+ hglib.tounicode(e.hint))
+ else:
+ err = hglib.tounicode(str(e))
qtlib.WarningMsgBox(_('No username configured'),
- hglib.tounicode(e), parent=self)
+ err, parent=self)
return
if self.pushaftercb.isChecked():
|
@@ -228,9 +228,16 @@ self.repo.thginvalidate()
wctx = self.repo[None]
wctx.status(unknown=True)
- except (util.Abort, error.RepoError), e:
+ except error.RepoError, e:
qtlib.WarningMsgBox(_('Unable to read repository status'),
uni(str(e)), parent=self)
+ except util.Abort, e:
+ if e.hint:
+ err = _('%s (hint: %s)') % (uni(str(e)), uni(e.hint))
+ else:
+ err = uni(str(e))
+ qtlib.WarningMsgBox(_('Unable to read repository status'),
+ err, parent=self)
return
self.lclunknowns = wctx.unknown()
|
@@ -175,9 +175,13 @@ hglib.tounicode(str(inst)))
return False
except util.Abort, inst:
+ if e.hint:
+ err = _('%s (hint: %s)') % (hglib.tounicode(str(e)),
+ hglib.tounicode(e.hint))
+ else:
+ err = hglib.tounicode(str(e))
qtlib.ErrorMsgBox(_('Error executing init'),
- _('Error when creating repository'),
- hglib.tounicode(str(inst)))
+ _('Error when creating repository'), err)
return False
except:
import traceback
|
@@ -335,16 +335,29 @@ else:
wctx = self.repo[None]
wctx.status(**stopts)
- except (OSError, IOError, util.Abort), e:
+ except (OSError, IOError), e:
self.showMessage.emit(hglib.tounicode(str(e)))
+ except util.Abort, e:
+ if e.hint:
+ err = _('%s (hint: %s)') % (hglib.tounicode(str(e)),
+ hglib.tounicode(e.hint))
+ else:
+ err = hglib.tounicode(str(e))
+ self.showMessage.emit(err)
try:
wctx.dirtySubrepos = []
for s in wctx.substate:
if wctx.sub(s).dirty():
wctx.dirtySubrepos.append(s)
- except (OSError, IOError, util.Abort,
- error.RepoLookupError, error.ConfigError), e:
+ except (OSError, IOError, error.RepoLookupError, error.ConfigError), e:
self.showMessage.emit(hglib.tounicode(str(e)))
+ except util.Abort, e:
+ if e.hint:
+ err = _('%s (hint: %s)') % (hglib.tounicode(str(e)),
+ hglib.tounicode(e.hint))
+ else:
+ err = hglib.tounicode(str(e))
+ self.showMessage.emit(err)
self.wctx = wctx
self.patchecked = patchecked
|
@@ -273,6 +273,8 @@ self.ret = dispatch._dispatch(ui, self.cmdline) or 0
except util.Abort, e:
ui.write_err(local._('abort: ') + str(e) + '\n')
+ if e.hint:
+ ui.write_err(local._('hint: ') + str(e.hint) + '\n')
except (error.RepoError, urllib2.HTTPError), e:
ui.write_err(str(e) + '\n')
except (Exception, OSError, IOError), e:
|
@@ -110,10 +110,19 @@ elif notify:
wfiles = [repo.wjoin(x) for x in files]
shlib.shell_notify(wfiles)
- except (util.Abort, IOError, OSError), e:
- QMessageBox.critical(parent, name + _(' Aborted'), str(e))
+ except (IOError, OSError), e:
+ err = hglib.tounicode(str(e))
+ QMessageBox.critical(parent, name + _(' Aborted'), err)
+ except util.Abort, e:
+ if e.hint:
+ err = _('%s (hint: %s)') % (hglib.tounicode(str(e)),
+ hglib.tounicode(e.hint))
+ else:
+ err = hglib.tounicode(str(e))
+ QMessageBox.critical(parent, name + _(' Aborted'), err)
except (error.LookupError), e:
- QMessageBox.critical(parent, name + _(' Aborted'), str(e))
+ err = hglib.tounicode(str(e))
+ QMessageBox.critical(parent, name + _(' Aborted'), err)
except NotImplementedError:
QMessageBox.critical(parent, name + _(' not implemented'),
'Please add it :)')
|
Loading...