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

commit: add 'cancel' button to confirm dialog for branch operations

Changeset 9060aa45512e

Parent bc4c62cb4f58

by Yuki KODAMA

Changes to one file · Browse files at 9060aa45512e Showing diff from parent bc4c62cb4f58 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​commit.py Stacked
 
640
641
642
 
643
644
645
646
647
648
649
650
 
 
 
 
651
652
653
654
 
 
 
 
655
656
 
657
658
659
 
640
641
642
643
644
645
646
 
 
 
 
 
647
648
649
650
651
 
 
 
652
653
654
655
656
 
657
658
659
660
@@ -640,20 +640,21 @@
  cmdline = ['hg', 'commit', '--verbose', '--repository', self.repo.root]     if self.nextbranch: + # response: 0=Yes, 1=No, 2=Cancel   newbranch = hglib.fromutf(self.nextbranch)   if newbranch in self.repo.branchtags():   if newbranch not in [p.branch() for p in self.repo.parents()]: - response = gdialog.Confirm(_('Confirm Override Branch'), - [], self, _('A branch named "%s" already exists,\n' - 'override?') % self.nextbranch).run() - else: - response = gtk.RESPONSE_YES + response = gdialog.CustomPrompt(_('Confirm Override Branch'), + _('A branch named "%s" already exists,\n' + 'override?') % self.nextbranch, self, + (_('&Yes'), _('&No'), _('&Cancel')), 2, 2).run()   else: - response = gdialog.Confirm(_('Confirm New Branch'), [], self, - _('Create new named branch "%s"?') % self.nextbranch).run() - if response == gtk.RESPONSE_YES: + response = gdialog.CustomPrompt(_('Confirm New Branch'), + _('Create new named branch "%s"?') % self.nextbranch, + self, (_('&Yes'), _('&No'), _('&Cancel')), 2, 2).run() + if response == 0:   self.repo.dirstate.setbranch(newbranch) - elif response != gtk.RESPONSE_NO: + elif response == 2:   return   elif self.closebranch:   cmdline.append('--close-branch')