Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

stable history: use hg.islocal in push_clicked

instead of needlessly creating a full repo object just to see
whether it is a local repository

Fixes #665

Changeset f8450ffa61a1

Parent 5f040a4a8629

by Adrian Buehlmann

Changes to one file · Browse files at f8450ffa61a1 Showing diff from parent 5f040a4a8629 Diff from another changeset...

 
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
 
 
 
 
 
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1426
1427
1428
 
1394
1395
1396
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1397
1398
1399
1400
1401
1402
 
 
 
 
 
 
 
 
 
 
 
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
@@ -1394,35 +1394,28 @@
  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 + if not hg.islocal(remote_path): + 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') - 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 + 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     cmdline = ['hg', 'push'] + self.get_proxy_args()   if self.forcepush: