1. TortoiseHg
  2. TortoiseHg
  3. thg

Commits

Angel Ezquerra  committed 56ea862

commit: hide the 'autoinc' option when merging

It is not possible to "autoinclude" files in merge commits. Hide the
corresponding commit option on the commit options dialog and on the "selected
options" label.

  • Participants
  • Parent commits eaa6503
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/commit.py

View file
         self.setMessage(newMessage)
 
     def details(self):
-        dlg = DetailsDialog(self.opts, self.userhist, self)
+        mode = 'commit'
+        if len(self.repo.parents()) > 1:
+            mode = 'merge'
+        dlg = DetailsDialog(self.opts, self.userhist, self, mode=mode)
         dlg.finished.connect(dlg.deleteLater)
         dlg.setWindowFlags(Qt.Sheet)
         dlg.setWindowModality(Qt.WindowModal)
 
 class DetailsDialog(QDialog):
     'Utility dialog for configuring uncommon settings'
-    def __init__(self, opts, userhistory, parent):
+    def __init__(self, opts, userhistory, parent, mode='commit'):
         QDialog.__init__(self, parent)
         self.setWindowTitle(_('%s - commit options') % parent.repo.displayname)
         self.repo = parent.repo
         hbox.addWidget(self.autoinccb)
         hbox.addWidget(self.autoincle)
         hbox.addWidget(autoincsave)
-        layout.addLayout(hbox)
+        if mode != 'merge':
+            #self.autoinccb.setVisible(False)
+            layout.addLayout(hbox)
         
         hbox = QHBoxLayout()
         recursesave = QPushButton(_('Save in Repo'))