Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

sync: add new logic to skip push confirmation

Before, the user was not prompted to confirm a push only if the
destination repo was local. Now confirmation is skipped if any of the
following are true:
- the destination repo is local
- the push comes from the outgoing InfoBar
- the Target checkbox is checked

Changeset 887df993fc7d

Parent a70c6d8b89fa

by David Wilhelm

Changes to 2 files · Browse files at 887df993fc7d Showing diff from parent a70c6d8b89fa Diff from another changeset...

 
452
453
454
455
 
456
457
458
 
946
947
948
949
950
 
 
 
 
 
 
 
951
952
953
 
452
453
454
 
455
456
457
458
 
946
947
948
 
 
949
950
951
952
953
954
955
956
957
958
@@ -452,7 +452,7 @@
  _('%d outgoing changesets') % len(nodes))   assert w   w.acceptButton.setText(_('Push')) - w.accepted.connect(self.push) # TODO: to the same URL + w.accepted.connect(lambda: self.push(False)) # TODO: to the same URL   w.rejected.connect(self.clearRevisionSet)     def createGrepWidget(self): @@ -946,8 +946,13 @@
  def outgoing(self):   self.syncDemand.get().outgoing()   - def push(self): - self.syncDemand.get().push() + def push(self, confirm=True): + """Call sync push. + + If confirm is False, the user will not be prompted for + confirmation. If confirm is True, the prompt might be used. + """ + self.syncDemand.get().push(confirm)     ##   ## Repoview context menu
 
119
120
121
122
 
123
124
125
 
674
675
676
677
 
678
679
680
681
 
682
683
684
 
844
845
846
847
 
848
849
850
 
 
851
852
853
 
119
120
121
 
122
123
124
125
 
674
675
676
 
677
678
679
680
 
681
682
683
684
 
844
845
846
 
847
848
849
 
850
851
852
853
854
@@ -119,7 +119,7 @@
  'hg-outgoing', self.outclicked)   self.pushAction = \   newaction(_('Push outgoing changesets to remote repository'), - 'hg-push', self.pushclicked) + 'hg-push', lambda: self.pushclicked(True))   newaction(_('Email outgoing changesets for remote repository'),   'mail-forward', self.emailclicked)   @@ -674,11 +674,11 @@
  else:   self.outclicked()   - def push(self): + def push(self, confirm):   if self.cmd.core.running():   self.showMessage.emit(_('sync command already running'))   else: - self.pushclicked() + self.pushclicked(confirm)     def pullBundle(self, bundle, rev):   'accept bundle changesets' @@ -844,10 +844,11 @@
  self.showMessage.emit(_('Perforce pending...'))   self.run(['--repository', self.repo.root, 'p4pending', '--verbose'], ())   - def pushclicked(self): + def pushclicked(self, confirm):   url = self.currentUrl(True)   urlu = hglib.tounicode(url) - if not hg.islocal(self.currentUrl(False)): + if (not hg.islocal(self.currentUrl(False)) and confirm + and not self.targetcheckbox.isChecked()):   r = qtlib.QuestionMsgBox(_('Confirm Push to remote Repository'),   _('Push to remote repository\n%s\n?')   % urlu)