Changeset 1dab5d2926ad…
Parent c39ac49f885e…
by
Changes to 2 files · Browse files at 1dab5d2926ad Showing diff from parent c39ac49f885e Diff from another changeset...
@@ -30,9 +30,9 @@
class Prompt(SimpleMessage):
- def __init__(self, title, message, parent):
+ def __init__(self, title, message, parent, type=gtk.MESSAGE_INFO):
SimpleMessage.__init__(self, parent, gtk.DIALOG_MODAL,
- gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE)
+ type, gtk.BUTTONS_CLOSE)
self.set_title(hglib.toutf(title))
self.set_markup('<b>' + hglib.toutf(message) + '</b>')
mod = gtklib.get_thg_modifier()
|
@@ -1390,6 +1390,38 @@ self).run()
self.pathentry.grab_focus()
return
+
+ confirm_push = False
+ try:
+ dest_repo = hg.repository(self.ui, path=remote_path)
+ if not dest_repo.local():
+ if self.forcepush:
+ title = _('Confirm Forced Push to Remote Repository')
+ text = _('Forced push to remote repository\n%s\n'
+ '(creating new heads in remote if needed)?') % remote_path
+ buttontext = _('Forced &Push')
+ else:
+ title = _('Confirm Push to remote Repository')
+ text = _('Push to remote repository\n%s\n?') % remote_path
+ buttontext = _('&Push')
+ confirm_push = True
+ elif self.forcepush:
+ title = _('Confirm Forced Push')
+ text = _('Forced push to repository\n%s\n'
+ '(creating new heads if needed)?') % remote_path
+ buttontext = _('Forced &Push')
+ confirm_push = True
+ if confirm_push:
+ dlg = gdialog.CustomPrompt(title, text,
+ None, (buttontext, _('&Cancel')), default=1, esc=1)
+ if dlg.run() != 0:
+ return
+ except hglib.RepoError, e:
+ dlg = gdialog.Prompt(_('Invalid Remote Repository'), str(e), self,
+ type=gtk.MESSAGE_ERROR)
+ dlg.run()
+ return
+
cmdline = ['hg', 'push'] + self.get_proxy_args()
if self.forcepush:
cmdline += ['--force']
|
Loading...