Mercurial Interface eric7

Wed, 20 Apr 2022 15:00:51 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 20 Apr 2022 15:00:51 +0200
branch
eric7
changeset 9028
b3a7f0368163
parent 9027
f259edcf185a
child 9029
14efd8fa5d8f

Mercurial Interface
- added capability to enter a revset expression when defining a revision to operate on

eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditConfigDialog.py file | annotate | diff | comparison | revisions
eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditConfigDialog.ui file | annotate | diff | comparison | revisions
eric7/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/HgRebaseDialog.py file | annotate | diff | comparison | revisions
eric7/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/HgRebaseDialog.ui file | annotate | diff | comparison | revisions
eric7/Plugins/VcsPlugins/vcsMercurial/StripExtension/HgStripDialog.py file | annotate | diff | comparison | revisions
eric7/Plugins/VcsPlugins/vcsMercurial/StripExtension/HgStripDialog.ui file | annotate | diff | comparison | revisions
--- a/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditConfigDialog.py	Sun Apr 17 19:34:09 2022 +0200
+++ b/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditConfigDialog.py	Wed Apr 20 15:00:51 2022 +0200
@@ -46,6 +46,25 @@
         if bookmarksList is not None:
             self.bookmarkCombo.addItems(sorted(bookmarksList))
         
+        # connect various radio buttons and input fields
+        self.defaultButton.toggled.connect(self.__updateOK)
+        self.outgoingButton.toggled.connect(self.__updateOK)
+        self.revisionButton.toggled.connect(self.__updateOK)
+        self.idButton.toggled.connect(self.__updateOK)
+        self.tagButton.toggled.connect(self.__updateOK)
+        self.branchButton.toggled.connect(self.__updateOK)
+        self.bookmarkButton.toggled.connect(self.__updateOK)
+        self.expressionButton.toggled.connect(self.__updateOK)
+        
+        self.idEdit.textChanged.connect(self.__updateOK)
+        self.expressionEdit.textChanged.connect(self.__updateOK)
+        
+        self.tagCombo.editTextChanged.connect(self.__updateOK)
+        self.branchCombo.editTextChanged.connect(self.__updateOK)
+        self.bookmarkCombo.editTextChanged.connect(self.__updateOK)
+        
+        self.numberSpinBox.valueChanged.connect(self.__updateOK)
+        
         self.idEdit.setText(rev)
         if rev:
             self.revisionButton.setChecked(True)
@@ -57,6 +76,7 @@
         
         self.__updateOK()
     
+    @pyqtSlot()
     def __updateOK(self):
         """
         Private slot to update the OK button.
@@ -72,126 +92,12 @@
                 enabled = enabled and bool(self.branchCombo.currentText())
             elif self.bookmarkButton.isChecked():
                 enabled = enabled and bool(self.bookmarkCombo.currentText())
+            elif self.expressionButton.isChecked():
+                enabled = enabled and bool(self.expressionEdit.text())
         
         self.buttonBox.button(
             QDialogButtonBox.StandardButton.Ok).setEnabled(enabled)
     
-    @pyqtSlot(bool)
-    def on_defaultButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Default select button.
-        
-        @param checked state of the button
-        @type bool
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_outgoingButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Outgoing select button.
-        
-        @param checked state of the button
-        @type bool
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_revisionButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Revision select button.
-        
-        @param checked state of the button
-        @type bool
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_idButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the ID select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_tagButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Tag select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_branch1Button_toggled(self, checked):
-        """
-        Private slot to handle changes of the Branch select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_bookmarkButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Bookmark select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(int)
-    def on_numberSpinBox_valueChanged(self, val):
-        """
-        Private slot to handle changes of the Number spin box.
-        
-        @param val value of the spin box
-        @type int
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_idEdit_textChanged(self, txt):
-        """
-        Private slot to handle changes of the ID edit.
-        
-        @param txt text of the edit
-        @type str
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_tagCombo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Tag combo.
-        
-        @param txt text of the combo
-        @type str
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_branchCombo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Branch combo.
-        
-        @param txt text of the combo
-        @type str
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_bookmarkCombo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Bookmark combo.
-        
-        @param txt text of the combo
-        @type str
-        """
-        self.__updateOK()
-    
     def __getRevision(self):
         """
         Private method to generate the revision.
@@ -214,6 +120,8 @@
                 return self.branchCombo.currentText()
             elif self.bookmarkButton.isChecked():
                 return self.bookmarkCombo.currentText()
+            elif self.expressionButton.isChecked():
+                return self.expressionEdit.text()
         
         return ""
     
--- a/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditConfigDialog.ui	Sun Apr 17 19:34:09 2022 +0200
+++ b/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditConfigDialog.ui	Wed Apr 20 15:00:51 2022 +0200
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>400</width>
-    <height>451</height>
+    <height>477</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -131,6 +131,9 @@
            <property name="toolTip">
             <string>Enter a changeset id</string>
            </property>
+           <property name="clearButtonEnabled">
+            <bool>true</bool>
+           </property>
           </widget>
          </item>
          <item row="2" column="0">
@@ -208,6 +211,26 @@
            </property>
           </widget>
          </item>
+         <item row="5" column="0">
+          <widget class="QRadioButton" name="expressionButton">
+           <property name="text">
+            <string>Expression:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="5" column="1" colspan="2">
+          <widget class="QLineEdit" name="expressionEdit">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="toolTip">
+            <string>Enter a revision set expression</string>
+           </property>
+           <property name="clearButtonEnabled">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
         </layout>
        </widget>
       </item>
@@ -263,6 +286,8 @@
   <tabstop>branchCombo</tabstop>
   <tabstop>bookmarkButton</tabstop>
   <tabstop>bookmarkCombo</tabstop>
+  <tabstop>expressionButton</tabstop>
+  <tabstop>expressionEdit</tabstop>
   <tabstop>forceCheckBox</tabstop>
   <tabstop>keepCheckBox</tabstop>
  </tabstops>
@@ -275,8 +300,8 @@
    <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>228</x>
-     <y>429</y>
+     <x>237</x>
+     <y>467</y>
     </hint>
     <hint type="destinationlabel">
      <x>150</x>
@@ -291,8 +316,8 @@
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>296</x>
-     <y>435</y>
+     <x>305</x>
+     <y>467</y>
     </hint>
     <hint type="destinationlabel">
      <x>337</x>
@@ -407,8 +432,24 @@
      <y>88</y>
     </hint>
     <hint type="destinationlabel">
-     <x>117</x>
-     <y>374</y>
+     <x>126</x>
+     <y>405</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>expressionButton</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>expressionEdit</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>52</x>
+     <y>336</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>158</x>
+     <y>339</y>
     </hint>
    </hints>
   </connection>
--- a/eric7/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/HgRebaseDialog.py	Sun Apr 17 19:34:09 2022 +0200
+++ b/eric7/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/HgRebaseDialog.py	Wed Apr 20 15:00:51 2022 +0200
@@ -50,9 +50,34 @@
         
         self.dryRunGroup.setEnabled(version >= (4, 7, 0))
         
+        # connect various radio buttons and input fields
+        self.id1Button.toggled.connect(self.__updateOK)
+        self.tag1Button.toggled.connect(self.__updateOK)
+        self.branch1Button.toggled.connect(self.__updateOK)
+        self.bookmark1Button.toggled.connect(self.__updateOK)
+        self.expression1Button.toggled.connect(self.__updateOK)
+        self.id2Button.toggled.connect(self.__updateOK)
+        self.tag2Button.toggled.connect(self.__updateOK)
+        self.branch2Button.toggled.connect(self.__updateOK)
+        self.bookmark2Button.toggled.connect(self.__updateOK)
+        self.expression2Button.toggled.connect(self.__updateOK)
+        
+        self.id1Edit.textChanged.connect(self.__updateOK)
+        self.expression1Edit.textChanged.connect(self.__updateOK)
+        self.id2Edit.textChanged.connect(self.__updateOK)
+        self.expression2Edit.textChanged.connect(self.__updateOK)
+        
+        self.tag1Combo.editTextChanged.connect(self.__updateOK)
+        self.branch1Combo.editTextChanged.connect(self.__updateOK)
+        self.bookmark1Combo.editTextChanged.connect(self.__updateOK)
+        self.tag2Combo.editTextChanged.connect(self.__updateOK)
+        self.branch2Combo.editTextChanged.connect(self.__updateOK)
+        self.bookmark2Combo.editTextChanged.connect(self.__updateOK)
+        
         msh = self.minimumSizeHint()
         self.resize(max(self.width(), msh.width()), msh.height())
     
+    @pyqtSlot()
     def __updateOK(self):
         """
         Private slot to update the OK button.
@@ -60,176 +85,38 @@
         enabled = True
         if not self.parentButton.isChecked():
             if self.id1Button.isChecked():
-                enabled = enabled and self.id1Edit.text() != ""
+                enabled = enabled and bool(self.id1Edit.text())
             elif self.tag1Button.isChecked():
-                enabled = enabled and self.tag1Combo.currentText() != ""
+                enabled = enabled and bool(self.tag1Combo.currentText())
             elif self.branch1Button.isChecked():
-                enabled = enabled and self.branch1Combo.currentText() != ""
+                enabled = enabled and bool(self.branch1Combo.currentText())
             elif self.bookmark1Button.isChecked():
-                enabled = enabled and self.bookmark1Combo.currentText() != ""
+                enabled = enabled and bool(self.bookmark1Combo.currentText())
+            elif self.expression1Button.isChecked():
+                enabled = enabled and bool(self.expression1Edit.text())
         
         if self.id2Button.isChecked():
-            enabled = enabled and self.id2Edit.text() != ""
+            enabled = enabled and bool(self.id2Edit.text())
         elif self.tag2Button.isChecked():
-            enabled = enabled and self.tag2Combo.currentText() != ""
+            enabled = enabled and bool(self.tag2Combo.currentText())
         elif self.branch2Button.isChecked():
-            enabled = enabled and self.branch2Combo.currentText() != ""
+            enabled = enabled and bool(self.branch2Combo.currentText())
         elif self.bookmark2Button.isChecked():
-            enabled = enabled and self.bookmark2Combo.currentText() != ""
+            enabled = enabled and bool(self.bookmark2Combo.currentText())
+        elif self.expression2Button.isChecked():
+            enabled = enabled and bool(self.expression2Edit.text())
         
         self.buttonBox.button(
             QDialogButtonBox.StandardButton.Ok).setEnabled(enabled)
     
-    @pyqtSlot(bool)
-    def on_id1Button_toggled(self, checked):
-        """
-        Private slot to handle changes of the ID1 select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_id2Button_toggled(self, checked):
-        """
-        Private slot to handle changes of the ID2 select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_tag1Button_toggled(self, checked):
-        """
-        Private slot to handle changes of the Tag1 select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_tag2Button_toggled(self, checked):
-        """
-        Private slot to handle changes of the Tag2 select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_branch1Button_toggled(self, checked):
-        """
-        Private slot to handle changes of the Branch1 select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_branch2Button_toggled(self, checked):
-        """
-        Private slot to handle changes of the Branch2 select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_bookmark1Button_toggled(self, checked):
-        """
-        Private slot to handle changes of the Bookmark1 select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_bookmark2Button_toggled(self, checked):
-        """
-        Private slot to handle changes of the Bookmark2 select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_id1Edit_textChanged(self, txt):
-        """
-        Private slot to handle changes of the ID1 edit.
-        
-        @param txt text of the edit (string)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_id2Edit_textChanged(self, txt):
-        """
-        Private slot to handle changes of the ID2 edit.
-        
-        @param txt text of the edit (string)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_tag1Combo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Tag1 combo.
-        
-        @param txt text of the combo (string)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_tag2Combo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Tag2 combo.
-        
-        @param txt text of the combo (string)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_branch1Combo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Branch1 combo.
-        
-        @param txt text of the combo (string)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_branch2Combo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Branch2 combo.
-        
-        @param txt text of the combo (string)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_bookmark1Combo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Bookmark1 combo.
-        
-        @param txt text of the combo (string)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_bookmark2Combo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Bookmark2 combo.
-        
-        @param txt text of the combo (string)
-        """
-        self.__updateOK()
-    
     def __getRevision(self, no):
         """
         Private method to generate the revision.
         
         @param no revision number to generate (1 or 2)
-        @return revision (string)
+        @type int
+        @return revision
+        @rtype str
         """
         if no == 1:
             numberButton = self.number1Button
@@ -242,6 +129,8 @@
             branchCombo = self.branch1Combo
             bookmarkButton = self.bookmark1Button
             bookmarkCombo = self.bookmark1Combo
+            expressionButton = self.expression1Button
+            expressionEdit = self.expression1Edit
             tipButton = None
         else:
             numberButton = self.number2Button
@@ -254,6 +143,8 @@
             branchCombo = self.branch2Combo
             bookmarkButton = self.bookmark2Button
             bookmarkCombo = self.bookmark2Combo
+            expressionButton = self.expression2Button
+            expressionEdit = self.expression2Edit
             tipButton = self.tip2Button
         
         if numberButton.isChecked():
@@ -266,6 +157,8 @@
             return branchCombo.currentText()
         elif bookmarkButton.isChecked():
             return bookmarkCombo.currentText()
+        elif expressionButton.isChecked():
+            return expressionEdit.text()
         elif tipButton and tipButton.isChecked():
             return ""
         
--- a/eric7/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/HgRebaseDialog.ui	Sun Apr 17 19:34:09 2022 +0200
+++ b/eric7/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/HgRebaseDialog.ui	Wed Apr 20 15:00:51 2022 +0200
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>650</width>
-    <height>477</height>
+    <height>509</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -124,6 +124,9 @@
              <property name="toolTip">
               <string>Enter a changeset id</string>
              </property>
+             <property name="clearButtonEnabled">
+              <bool>true</bool>
+             </property>
             </widget>
            </item>
            <item row="2" column="0">
@@ -201,6 +204,26 @@
              </property>
             </widget>
            </item>
+           <item row="5" column="0">
+            <widget class="QRadioButton" name="expression1Button">
+             <property name="text">
+              <string>Expression:</string>
+             </property>
+            </widget>
+           </item>
+           <item row="5" column="1" colspan="2">
+            <widget class="QLineEdit" name="expression1Edit">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="toolTip">
+              <string>Enter a revision set expression</string>
+             </property>
+             <property name="clearButtonEnabled">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
           </layout>
          </widget>
         </item>
@@ -287,6 +310,9 @@
           <property name="toolTip">
            <string>Enter a changeset id</string>
           </property>
+          <property name="clearButtonEnabled">
+           <bool>true</bool>
+          </property>
          </widget>
         </item>
         <item row="2" column="0">
@@ -364,7 +390,27 @@
           </property>
          </widget>
         </item>
-        <item row="5" column="0" colspan="3">
+        <item row="5" column="0">
+         <widget class="QRadioButton" name="expression2Button">
+          <property name="text">
+           <string>Expression:</string>
+          </property>
+         </widget>
+        </item>
+        <item row="5" column="1" colspan="2">
+         <widget class="QLineEdit" name="expression2Edit">
+          <property name="enabled">
+           <bool>false</bool>
+          </property>
+          <property name="toolTip">
+           <string>Enter a revision set expression</string>
+          </property>
+          <property name="clearButtonEnabled">
+           <bool>true</bool>
+          </property>
+         </widget>
+        </item>
+        <item row="6" column="0" colspan="3">
          <widget class="QRadioButton" name="tip2Button">
           <property name="toolTip">
            <string>Select tip revision of repository</string>
@@ -491,6 +537,8 @@
   <tabstop>branch1Combo</tabstop>
   <tabstop>bookmark1Button</tabstop>
   <tabstop>bookmark1Combo</tabstop>
+  <tabstop>expression1Button</tabstop>
+  <tabstop>expression1Edit</tabstop>
   <tabstop>number2Button</tabstop>
   <tabstop>number2SpinBox</tabstop>
   <tabstop>id2Button</tabstop>
@@ -501,12 +549,16 @@
   <tabstop>branch2Combo</tabstop>
   <tabstop>bookmark2Button</tabstop>
   <tabstop>bookmark2Combo</tabstop>
+  <tabstop>expression2Button</tabstop>
+  <tabstop>expression2Edit</tabstop>
   <tabstop>tip2Button</tabstop>
   <tabstop>collapseCheckBox</tabstop>
   <tabstop>keepChangesetsCheckBox</tabstop>
   <tabstop>keepBranchCheckBox</tabstop>
   <tabstop>detachCheckBox</tabstop>
-  <tabstop>buttonBox</tabstop>
+  <tabstop>noDryRunButton</tabstop>
+  <tabstop>dryRunOnlyButton</tabstop>
+  <tabstop>dryRunConfirmButton</tabstop>
  </tabstops>
  <resources/>
  <connections>
@@ -517,8 +569,8 @@
    <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>124</x>
-     <y>864</y>
+     <x>133</x>
+     <y>499</y>
     </hint>
     <hint type="destinationlabel">
      <x>21</x>
@@ -533,8 +585,8 @@
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>176</x>
-     <y>864</y>
+     <x>185</x>
+     <y>499</y>
     </hint>
     <hint type="destinationlabel">
      <x>73</x>
@@ -549,12 +601,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>86</x>
-     <y>163</y>
+     <x>120</x>
+     <y>190</y>
     </hint>
     <hint type="destinationlabel">
-     <x>201</x>
-     <y>164</y>
+     <x>228</x>
+     <y>192</y>
     </hint>
    </hints>
   </connection>
@@ -565,12 +617,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>99</x>
-     <y>699</y>
+     <x>435</x>
+     <y>67</y>
     </hint>
     <hint type="destinationlabel">
-     <x>204</x>
-     <y>700</y>
+     <x>535</x>
+     <y>69</y>
     </hint>
    </hints>
   </connection>
@@ -581,12 +633,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>56</x>
-     <y>189</y>
+     <x>90</x>
+     <y>223</y>
     </hint>
     <hint type="destinationlabel">
-     <x>245</x>
-     <y>190</y>
+     <x>296</x>
+     <y>224</y>
     </hint>
    </hints>
   </connection>
@@ -597,12 +649,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>95</x>
-     <y>725</y>
+     <x>435</x>
+     <y>100</y>
     </hint>
     <hint type="destinationlabel">
-     <x>248</x>
-     <y>726</y>
+     <x>627</x>
+     <y>101</y>
     </hint>
    </hints>
   </connection>
@@ -613,12 +665,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>83</x>
-     <y>215</y>
+     <x>117</x>
+     <y>255</y>
     </hint>
     <hint type="destinationlabel">
-     <x>241</x>
-     <y>216</y>
+     <x>296</x>
+     <y>256</y>
     </hint>
    </hints>
   </connection>
@@ -629,12 +681,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>74</x>
-     <y>241</y>
+     <x>108</x>
+     <y>287</y>
     </hint>
     <hint type="destinationlabel">
-     <x>229</x>
-     <y>242</y>
+     <x>296</x>
+     <y>288</y>
     </hint>
    </hints>
   </connection>
@@ -645,12 +697,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>63</x>
-     <y>751</y>
+     <x>404</x>
+     <y>132</y>
     </hint>
     <hint type="destinationlabel">
-     <x>248</x>
-     <y>752</y>
+     <x>627</x>
+     <y>133</y>
     </hint>
    </hints>
   </connection>
@@ -661,12 +713,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>100</x>
-     <y>777</y>
+     <x>435</x>
+     <y>164</y>
     </hint>
     <hint type="destinationlabel">
-     <x>248</x>
-     <y>778</y>
+     <x>627</x>
+     <y>165</y>
     </hint>
    </hints>
   </connection>
@@ -677,12 +729,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>48</x>
-     <y>267</y>
+     <x>82</x>
+     <y>319</y>
     </hint>
     <hint type="destinationlabel">
-     <x>245</x>
-     <y>268</y>
+     <x>296</x>
+     <y>320</y>
     </hint>
    </hints>
   </connection>
@@ -693,12 +745,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>48</x>
-     <y>803</y>
+     <x>389</x>
+     <y>196</y>
     </hint>
     <hint type="destinationlabel">
-     <x>248</x>
-     <y>804</y>
+     <x>627</x>
+     <y>197</y>
     </hint>
    </hints>
   </connection>
@@ -713,8 +765,40 @@
      <y>49</y>
     </hint>
     <hint type="destinationlabel">
+     <x>248</x>
+     <y>259</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>expression1Button</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>expression1Edit</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>54</x>
+     <y>341</y>
+    </hint>
+    <hint type="destinationlabel">
      <x>226</x>
-     <y>126</y>
+     <y>338</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>expression2Button</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>expression2Edit</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>398</x>
+     <y>214</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>461</x>
+     <y>220</y>
     </hint>
    </hints>
   </connection>
--- a/eric7/Plugins/VcsPlugins/vcsMercurial/StripExtension/HgStripDialog.py	Sun Apr 17 19:34:09 2022 +0200
+++ b/eric7/Plugins/VcsPlugins/vcsMercurial/StripExtension/HgStripDialog.py	Wed Apr 20 15:00:51 2022 +0200
@@ -42,6 +42,21 @@
             self.bookmarkCombo.addItems([""] + sorted(bookmarksList))
         self.idEdit.setText(rev)
         
+        # connect various radio buttons and input fields
+        self.numberButton.toggled.connect(self.__updateOK)
+        self.idButton.toggled.connect(self.__updateOK)
+        self.tagButton.toggled.connect(self.__updateOK)
+        self.branchButton.toggled.connect(self.__updateOK)
+        self.expressionButton.toggled.connect(self.__updateOK)
+        
+        self.numberSpinBox.valueChanged.connect(self.__updateOK)
+        
+        self.idEdit.textChanged.connect(self.__updateOK)
+        self.expressionEdit.textChanged.connect(self.__updateOK)
+        
+        self.tagCombo.editTextChanged.connect(self.__updateOK)
+        self.branchCombo.editTextChanged.connect(self.__updateOK)
+        
         msh = self.minimumSizeHint()
         self.resize(max(self.width(), msh.width()), msh.height())
         
@@ -49,6 +64,7 @@
         
         self.idEdit.setFocus()
     
+    @pyqtSlot()
     def __updateOK(self):
         """
         Private slot to update the OK button.
@@ -57,95 +73,17 @@
         if self.numberButton.isChecked():
             enabled = enabled and self.numberSpinBox.value() >= 0
         elif self.idButton.isChecked():
-            enabled = enabled and self.idEdit.text() != ""
+            enabled = enabled and bool(self.idEdit.text())
         elif self.tagButton.isChecked():
-            enabled = enabled and self.tagCombo.currentText() != ""
+            enabled = enabled and bool(self.tagCombo.currentText())
         elif self.branchButton.isChecked():
-            enabled = enabled and self.branchCombo.currentText() != ""
+            enabled = enabled and bool(self.branchCombo.currentText())
+        elif self.expressionButton.isChecked():
+            enabled = enabled and bool(self.expressionEdit.text())
         
         self.buttonBox.button(
             QDialogButtonBox.StandardButton.Ok).setEnabled(enabled)
     
-    @pyqtSlot(bool)
-    def on_numberButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Number select button.
-        
-        @param checked state of the button
-        @type bool
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_idButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the ID select button.
-        
-        @param checked state of the button
-        @type bool
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_tagButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Tag select button.
-        
-        @param checked state of the button
-        @type bool
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_branchButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Branch select button.
-        
-        @param checked state of the button
-        @type bool
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(int)
-    def on_numberSpinBox_valueChanged(self, val):
-        """
-        Private slot to handle changes of the Number spin box.
-        
-        @param val value of the spin box
-        @type int
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_idEdit_textChanged(self, txt):
-        """
-        Private slot to handle changes of the ID edit.
-        
-        @param txt text of the edit
-        @type str
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_tagCombo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Tag combo.
-        
-        @param txt text of the combo
-        @type str
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_branchCombo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Branch combo.
-        
-        @param txt text of the combo
-        @type str
-        """
-        self.__updateOK()
-    
     def __getRevision(self):
         """
         Private method to generate the revision.
@@ -161,6 +99,8 @@
             return self.tagCombo.currentText()
         elif self.branchButton.isChecked():
             return self.branchCombo.currentText()
+        elif self.expressionButton.isChecked():
+            return self.expressionEdit.text()
         else:
             # should not happen
             return ""
--- a/eric7/Plugins/VcsPlugins/vcsMercurial/StripExtension/HgStripDialog.ui	Sun Apr 17 19:34:09 2022 +0200
+++ b/eric7/Plugins/VcsPlugins/vcsMercurial/StripExtension/HgStripDialog.ui	Wed Apr 20 15:00:51 2022 +0200
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>400</width>
-    <height>276</height>
+    <height>374</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -86,6 +86,9 @@
         <property name="toolTip">
          <string>Enter a changeset id</string>
         </property>
+        <property name="clearButtonEnabled">
+         <bool>true</bool>
+        </property>
        </widget>
       </item>
       <item row="2" column="0">
@@ -134,6 +137,26 @@
         </property>
        </widget>
       </item>
+      <item row="4" column="0">
+       <widget class="QRadioButton" name="expressionButton">
+        <property name="text">
+         <string>Expression:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="4" column="1" colspan="2">
+       <widget class="QLineEdit" name="expressionEdit">
+        <property name="enabled">
+         <bool>false</bool>
+        </property>
+        <property name="toolTip">
+         <string>Enter a revision set expression</string>
+        </property>
+        <property name="clearButtonEnabled">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
@@ -215,6 +238,8 @@
   <tabstop>tagCombo</tabstop>
   <tabstop>branchButton</tabstop>
   <tabstop>branchCombo</tabstop>
+  <tabstop>expressionButton</tabstop>
+  <tabstop>expressionEdit</tabstop>
   <tabstop>bookmarkCombo</tabstop>
   <tabstop>forceCheckBox</tabstop>
   <tabstop>noBackupCheckBox</tabstop>
@@ -229,8 +254,8 @@
    <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>248</x>
-     <y>254</y>
+     <x>257</x>
+     <y>364</y>
     </hint>
     <hint type="destinationlabel">
      <x>157</x>
@@ -245,8 +270,8 @@
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>316</x>
-     <y>260</y>
+     <x>325</x>
+     <y>364</y>
     </hint>
     <hint type="destinationlabel">
      <x>286</x>
@@ -261,12 +286,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>34</x>
-     <y>42</y>
+     <x>55</x>
+     <y>66</y>
     </hint>
     <hint type="destinationlabel">
-     <x>100</x>
-     <y>42</y>
+     <x>215</x>
+     <y>68</y>
     </hint>
    </hints>
   </connection>
@@ -277,12 +302,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>47</x>
-     <y>65</y>
+     <x>68</x>
+     <y>99</y>
     </hint>
     <hint type="destinationlabel">
-     <x>105</x>
-     <y>65</y>
+     <x>227</x>
+     <y>100</y>
     </hint>
    </hints>
   </connection>
@@ -293,12 +318,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>44</x>
-     <y>93</y>
+     <x>65</x>
+     <y>131</y>
     </hint>
     <hint type="destinationlabel">
-     <x>102</x>
-     <y>95</y>
+     <x>224</x>
+     <y>132</y>
     </hint>
    </hints>
   </connection>
@@ -309,12 +334,28 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>52</x>
-     <y>118</y>
+     <x>73</x>
+     <y>163</y>
     </hint>
     <hint type="destinationlabel">
-     <x>109</x>
-     <y>122</y>
+     <x>231</x>
+     <y>164</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>expressionButton</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>expressionEdit</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>74</x>
+     <y>183</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>154</x>
+     <y>180</y>
     </hint>
    </hints>
   </connection>

eric ide

mercurial