Added the '--force' option to the Mercurial branch dialog. eric7

Mon, 01 Nov 2021 13:14:46 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 01 Nov 2021 13:14:46 +0100
branch
eric7
changeset 8750
978bb45ffdcd
parent 8741
54546929c371
child 8751
4a6c2ccd880f

Added the '--force' option to the Mercurial branch dialog.

eric7/Plugins/VcsPlugins/vcsMercurial/HgBranchInputDialog.py file | annotate | diff | comparison | revisions
eric7/Plugins/VcsPlugins/vcsMercurial/HgBranchInputDialog.ui file | annotate | diff | comparison | revisions
eric7/Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
--- a/eric7/Plugins/VcsPlugins/vcsMercurial/HgBranchInputDialog.py	Sun Oct 31 18:01:20 2021 +0100
+++ b/eric7/Plugins/VcsPlugins/vcsMercurial/HgBranchInputDialog.py	Mon Nov 01 13:14:46 2021 +0100
@@ -51,8 +51,10 @@
         """
         Public method to get the data.
         
-        @return tuple of branch name (string) and a flag indicating to
-            commit the branch (boolean)
+        @return tuple of branch name, a flag indicating to commit the branch
+            and a flag indicating to force the branch creation
+        @rtype tuple of (str, bool, bool)
         """
         return (self.branchComboBox.currentText().replace(" ", "_"),
-                self.commitCheckBox.isChecked())
+                self.commitCheckBox.isChecked(),
+                self.forceCheckBox.isChecked())
--- a/eric7/Plugins/VcsPlugins/vcsMercurial/HgBranchInputDialog.ui	Sun Oct 31 18:01:20 2021 +0100
+++ b/eric7/Plugins/VcsPlugins/vcsMercurial/HgBranchInputDialog.ui	Mon Nov 01 13:14:46 2021 +0100
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>400</width>
-    <height>128</height>
+    <height>130</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -35,14 +35,28 @@
     </widget>
    </item>
    <item>
-    <widget class="QCheckBox" name="commitCheckBox">
-     <property name="toolTip">
-      <string>Select to commit the branch</string>
-     </property>
-     <property name="text">
-      <string>Commit Branch</string>
-     </property>
-    </widget>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QCheckBox" name="commitCheckBox">
+       <property name="toolTip">
+        <string>Select to commit the branch</string>
+       </property>
+       <property name="text">
+        <string>Commit Branch</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QCheckBox" name="forceCheckBox">
+       <property name="toolTip">
+        <string>Select to force creating the branch</string>
+       </property>
+       <property name="text">
+        <string>Force</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
    </item>
    <item>
     <widget class="QDialogButtonBox" name="buttonBox">
--- a/eric7/Plugins/VcsPlugins/vcsMercurial/hg.py	Sun Oct 31 18:01:20 2021 +0100
+++ b/eric7/Plugins/VcsPlugins/vcsMercurial/hg.py	Mon Nov 01 13:14:46 2021 +0100
@@ -1864,9 +1864,11 @@
         from .HgBranchInputDialog import HgBranchInputDialog
         dlg = HgBranchInputDialog(self.hgGetBranchesList())
         if dlg.exec() == QDialog.DialogCode.Accepted:
-            name, commit = dlg.getData()
+            name, commit, force = dlg.getData()
             name = name.strip().replace(" ", "_")
             args = self.initCommand("branch")
+            if force:
+                args.append("--force")
             args.append(name)
             
             dia = HgDialog(

eric ide

mercurial