Mercurial: added support for the '--secure' flag of hg import as of Mercurial 5.3.

Tue, 04 Feb 2020 19:43:37 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 04 Feb 2020 19:43:37 +0100
changeset 7396
c6399bce2c0b
parent 7395
dd50d0f4c588
child 7398
b376911244a2

Mercurial: added support for the '--secure' flag of hg import as of Mercurial 5.3.

docs/changelog file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HgImportDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HgImportDialog.ui file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
--- a/docs/changelog	Tue Feb 04 19:41:50 2020 +0100
+++ b/docs/changelog	Tue Feb 04 19:43:37 2020 +0100
@@ -2,6 +2,8 @@
 ----------
 Version 20.3:
 - bug fixes
+- Mercurial Interface
+  -- added support for the '--secure' flag of hg import as of Mercurial 5.3
 - Syntax Checker
   -- updated pyflakes to repository as of 2020-02-03
 
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgImportDialog.py	Tue Feb 04 19:41:50 2020 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgImportDialog.py	Tue Feb 04 19:43:37 2020 +0100
@@ -20,11 +20,14 @@
     """
     Class implementing a dialog to enter data for the Mercurial import command.
     """
-    def __init__(self, parent=None):
+    def __init__(self, vcs, parent=None):
         """
         Constructor
         
-        @param parent reference to the parent widget (QWidget)
+        @param vcs reference to the VCS object
+        @type Hg
+        @param parent reference to the parent widget
+        @type QWidget
         """
         super(HgImportDialog, self).__init__(parent)
         self.setupUi(self)
@@ -33,6 +36,8 @@
         self.patchFilePicker.setFilters(self.tr(
             "Patch Files (*.diff *.patch);;All Files (*)"))
         
+        self.secretCheckBox.setEnabled(vcs.version >= (5, 3, 0))
+        
         self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
         
         self.__initDateTime = QDateTime.currentDateTime()
@@ -62,9 +67,10 @@
         Public method to retrieve the import data.
         
         @return tuple naming the patch file, a flag indicating to not commit,
-            a commit message, a commit date, a commit user, a strip count and
-            a flag indicating to enforce the import
-            (string, boolean, string, string, string, integer, boolean)
+            a commit message, a commit date, a commit user, a flag indicating
+            to commit with the secret phase, a strip count and a flag
+            indicating to enforce the import
+        @type tuple of (str, bool, str, str, str, bool, int, bool)
         """
         if self.dateEdit.dateTime() != self.__initDateTime:
             date = self.dateEdit.dateTime().toString("yyyy-MM-dd hh:mm")
@@ -73,4 +79,5 @@
         
         return (self.patchFilePicker.text(), self.noCommitCheckBox.isChecked(),
                 self.messageEdit.toPlainText(), date, self.userEdit.text(),
-                self.stripSpinBox.value(), self.forceCheckBox.isChecked())
+                self.secretCheckBox.isChecked(), self.stripSpinBox.value(),
+                self.forceCheckBox.isChecked())
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgImportDialog.ui	Tue Feb 04 19:41:50 2020 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgImportDialog.ui	Tue Feb 04 19:43:37 2020 +0100
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>500</width>
-    <height>400</height>
+    <height>450</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -88,7 +88,7 @@
           </property>
           <property name="sizeHint" stdset="0">
            <size>
-            <width>40</width>
+            <width>258</width>
             <height>20</height>
            </size>
           </property>
@@ -113,6 +113,16 @@
         </item>
        </layout>
       </item>
+      <item>
+       <widget class="QCheckBox" name="secretCheckBox">
+        <property name="toolTip">
+         <string>Enable to commit with the secret phase</string>
+        </property>
+        <property name="text">
+         <string>Commit with Secret Phase</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
@@ -214,6 +224,7 @@
   <tabstop>messageEdit</tabstop>
   <tabstop>dateEdit</tabstop>
   <tabstop>userEdit</tabstop>
+  <tabstop>secretCheckBox</tabstop>
   <tabstop>stripSpinBox</tabstop>
   <tabstop>patchFilePicker</tabstop>
   <tabstop>forceCheckBox</tabstop>
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/hg.py	Tue Feb 04 19:41:50 2020 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/hg.py	Tue Feb 04 19:43:37 2020 +0100
@@ -2706,9 +2706,9 @@
                 return False
         
         from .HgImportDialog import HgImportDialog
-        dlg = HgImportDialog()
+        dlg = HgImportDialog(self)
         if dlg.exec_() == QDialog.Accepted:
-            (patchFile, noCommit, message, date, user, stripCount,
+            (patchFile, noCommit, message, date, user, withSecret, stripCount,
              force) = dlg.getParameters()
             
             args = self.initCommand("import")
@@ -2730,6 +2730,8 @@
                 args.append(str(stripCount))
             if force:
                 args.append("--force")
+            if withSecret:
+                args.append("--secret")
             args.append(patchFile)
             
             dia = HgDialog(self.tr("Import Patch"), self)

eric ide

mercurial