Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

sync: clean up post-pull dialog

Changeset 28442e25dfd2

Parent 5e321dfb0180

by Steve Borho

Changes to one file · Browse files at 28442e25dfd2 Showing diff from parent 5e321dfb0180 Diff from another changeset...

 
617
618
619
 
 
 
620
621
622
 
647
648
649
 
 
 
 
650
651
 
 
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
 
 
 
 
 
 
669
670
671
 
 
672
673
674
 
680
681
682
683
 
 
684
685
686
 
617
618
619
620
621
622
623
624
625
 
650
651
652
653
654
655
656
657
 
658
659
660
661
 
 
 
 
 
 
 
 
 
662
663
664
 
 
 
665
666
667
668
669
670
671
 
 
672
673
674
675
676
 
682
683
684
 
685
686
687
688
689
@@ -617,6 +617,9 @@
  self.setWindowTitle(_('Post Pull Behavior'))   self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint)   + lbl = QLabel(_('Select post-pull operation for this repository')) + layout.addWidget(lbl) +   self.none = QRadioButton(_('None - simply pull changesets'))   self.update = QRadioButton(_('Update - pull, then try to update'))   layout.addWidget(self.none) @@ -647,28 +650,27 @@
  elif repo.postpull == 'rebase':   self.rebase.setChecked(True)   + cfglabel = QLabel(_('<a href="config">Launch settings tool...</a>')) + cfglabel.linkActivated.connect(self.linkactivated) + layout.addWidget(cfglabel) +   BB = QDialogButtonBox - bb = QDialogButtonBox(BB.Cancel) + bb = QDialogButtonBox(BB.Ok|BB.Cancel) + bb.accepted.connect(self.accept)   bb.rejected.connect(self.reject)   - sr = QPushButton(_('Save In Repo')) - sr.clicked.connect(self.saveInRepo) - bb.addButton(sr, BB.ActionRole) - - sg = QPushButton(_('Save Global')) - sg.clicked.connect(self.saveGlobal) - sg.setAutoDefault(True) - bb.addButton(sg, BB.ActionRole) -   self.bb = bb   layout.addWidget(bb)   - def saveInRepo(self): - fn = os.path.join(self.repo.root, '.hg', 'hgrc') - self.saveToPath([fn]) + def linkactivated(self, command): + if command == 'config': + from tortoisehg.hgqt.settings import SettingsDialog + sd = SettingsDialog(configrepo=False, focus='tortoisehg.postpull', + parent=self, root=self.repo.root) + sd.exec_()   - def saveGlobal(self): - self.saveToPath(util.user_rcpath()) + +def run(ui, *pats, **opts):     def getValue(self):   if self.none.isChecked(): @@ -680,7 +682,8 @@
  else:   return 'rebase'   - def saveToPath(self, path): + def accept(self): + path = os.path.join(self.repo.root, '.hg', 'hgrc')   fn, cfg = loadIniFile(path, self)   if not hasattr(cfg, 'write'):   qtlib.WarningMsgBox(_('Unable to save post pull operation'),