# HG changeset patch # User Chris Cannam # Date 1300369977 0 # Node ID ea6f76c0aa768f9641b77986449ac856debaa672 # Parent 4373061dd20ee9980b2f0841d2d2afdf4e3193af Make username/password prompts in easyhg.py more helpful; use a distinctive return for cancel in these dialogs, and avoid showing command-failed in the main program when cancelled diff -r 4373061dd20e -r ea6f76c0aa76 easyhg.py --- a/easyhg.py Thu Mar 17 13:45:05 2011 +0000 +++ b/easyhg.py Thu Mar 17 13:52:57 2011 +0000 @@ -54,7 +54,7 @@ self.write(msg, ' ', default, "\n") return default if msg == _('user:'): - msg = _('User:') + msg = _('Username for remote repository:') d = QtGui.QInputDialog() d.setInputMode(QtGui.QInputDialog.TextInput) d.setTextEchoMode(QtGui.QLineEdit.Normal) @@ -65,7 +65,7 @@ ok = d.exec_() r = d.textValue() if not ok: - raise util.Abort(_('response expected')) + raise util.Abort(_('username entry cancelled')) if not r: return default return r @@ -74,7 +74,7 @@ if not self.interactive(): return default if not prompt or prompt == _('password:'): - prompt = _('Password:'); + prompt = _('Password for remote repository:'); d = QtGui.QInputDialog() d.setInputMode(QtGui.QInputDialog.TextInput) d.setTextEchoMode(QtGui.QLineEdit.Password) @@ -85,8 +85,9 @@ ok = d.exec_() r = d.textValue() if not ok: - raise util.Abort(_('response expected')) + raise util.Abort(_('password entry cancelled')) if not r: return default return r + diff -r 4373061dd20e -r ea6f76c0aa76 mainwindow.cpp --- a/mainwindow.cpp Thu Mar 17 13:45:05 2011 +0000 +++ b/mainwindow.cpp Thu Mar 17 13:52:57 2011 +0000 @@ -1802,6 +1802,9 @@ if (output.contains("authorization failed")) { reportAuthFailed(output); return; + } else if (output.contains("entry cancelled")) { + // ignore this, user cancelled username or password dialog + return; } else { // Incoming returns non-zero code and no output if the // check was successful but there are no changes @@ -1826,6 +1829,9 @@ if (output.contains("authorization failed")) { reportAuthFailed(output); return; + } else if (output.contains("entry cancelled")) { + // ignore this, user cancelled username or password dialog + return; } break; // go on to default report case ACT_PUSH: @@ -1835,6 +1841,9 @@ } else if (output.contains("authorization failed")) { reportAuthFailed(output); return; + } else if (output.contains("entry cancelled")) { + // ignore this, user cancelled username or password dialog + return; } break; // go on to default report case ACT_QUERY_HEADS: