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

commit: make QNew conditional on MQ extension being enabled for repository

Changeset 942100ba2e6b

Parent 9e02bbb7013b

by Steve Borho

Changes to one file · Browse files at 942100ba2e6b Showing diff from parent 9e02bbb7013b Diff from another changeset...

 
92
93
94
95
96
97
98
 
231
232
233
 
234
235
236
 
237
238
239
 
597
598
599
600
 
601
602
603
 
632
633
634
635
 
636
637
638
 
777
778
779
780
781
782
783
 
 
 
 
 
784
785
786
 
 
 
 
 
 
 
 
 
 
 
 
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
 
807
808
809
810
811
812
813
814
815
 
918
919
920
921
922
 
 
923
924
925
 
92
93
94
 
95
96
97
 
230
231
232
233
234
235
 
236
237
238
239
 
597
598
599
 
600
601
602
603
 
632
633
634
 
635
636
637
638
 
777
778
779
 
 
780
 
781
782
783
784
785
786
 
 
787
788
789
790
791
792
793
794
795
796
797
798
799
 
 
 
 
 
 
 
 
 
 
 
 
 
800
801
802
 
806
807
808
 
 
 
809
810
811
 
914
915
916
 
 
917
918
919
920
921
@@ -92,7 +92,6 @@
  self.stwidget.fileDisplayed.connect(self.fileDisplayed)   self.msghistory = []   self.qref = False - self.opts['patchName'] = None   self.repo = repo = self.stwidget.repo   self.runner = cmdui.Runner(_('Commit'), not embedded, self)   self.runner.output.connect(self.output) @@ -231,9 +230,10 @@
  self.repo.thginvalidate()   self.refresh()   self.stwidget.refreshWctx() # Trigger reload of working context +   def refresh(self):   # Update qrefresh mode - if self.opts['patchName']: + if self.opts.get('patchName'):   self.commitButtonName.emit(_('QNew'))   else:   if self.repo.changectx('.').thgmqappliedpatch(): @@ -597,7 +597,7 @@
  except error.Abort, e:   self.showMessage.emit(hglib.tounicode(str(e)))   dcmd = [] - if self.opts['patchName']: + if self.opts.get('patchName'):   cmdline = ['qnew', '--repository', repo.root,   '--verbose', '--user', user, '--message', msg,   self.opts['patchName'] @@ -632,7 +632,7 @@
  self.msgte.clear()   self.msgte.setModified(False)   self.commitComplete.emit() - if self.opts['patchName']: + if self.opts.get('patchName'):   self.opts['patchName'] = None   self.refresh()   self.stwidget.refreshWctx() @@ -777,27 +777,26 @@
  hbox.addWidget(self.autoincle)   hbox.addWidget(autoincsave)   layout.addLayout(hbox) - hbox = QHBoxLayout() - # qnew/shelve-patch creation dialog (in another file)   - self.patchcb = QCheckBox(_('New patch (QNew):')) + if 'mq' in self.repo.extensions(): + hbox = QHBoxLayout() + self.patchcb = QCheckBox(_('New patch (QNew):')) + self.patchle = QLineEdit() + self.patchcb.toggled.connect(self.patchle.setEnabled)   - self.patchle = QLineEdit() - self.patchcb.toggled.connect(self.patchle.setEnabled) + patchName = opts.get('patchName') + if patchName: + self.patchcb.setChecked(True) + self.patchle.setText(hglib.tounicode(patchName)) + self.patchle.setEnabled(True) + else: + self.patchcb.setChecked(False) + self.patchle.setEnabled(False) + hbox.addWidget(self.patchcb) + hbox.addWidget(self.patchle) + layout.addStretch(10) + layout.addLayout(hbox)   - patchName = opts.get('patchName') - if patchName: - self.patchcb.setChecked(True) - self.patchle.setText(hglib.tounicode(patchName)) - self.patchle.setEnabled(True) - else: - self.patchcb.setChecked(False) - self.patchle.setEnabled(False) - - hbox.addWidget(self.patchcb) - hbox.addWidget(self.patchle) - layout.addStretch(10) - layout.addLayout(hbox)   BB = QDialogButtonBox   bb = QDialogButtonBox(BB.Ok|BB.Cancel)   bb.accepted.connect(self.accept) @@ -807,9 +806,6 @@
    self.setWindowTitle('%s - commit details' % self.repo.displayname)   - def newPatch(self): - self.patchName = hglib.fromunicode(self.patchle.text()) -   def saveInRepo(self):   fn = os.path.join(self.repo.root, '.hg', 'hgrc')   self.saveToPath([fn]) @@ -918,8 +914,8 @@
  else:   outopts['pushafter'] = ''   outopts['patchName'] = None - if self.patchcb.isChecked(): - patchName = self.patchle.text() + if 'mq' in self.repo.extensions() and self.patchcb.isChecked(): + patchName = self.patchle.text().simplified()   if patchName:   outopts['patchName'] = hglib.fromunicode(patchName)