Mercurial eric7

Tue, 29 Oct 2024 19:48:56 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 29 Oct 2024 19:48:56 +0100
branch
eric7
changeset 11013
ad483a12058c
parent 11012
8685d10eca0f
child 11015
6be202244000

Mercurial
- Extended the monitored mercurial configuration files.

src/eric7/APIs/Python3/eric7.api file | annotate | diff | comparison | revisions
src/eric7/Documentation/Help/source.qch file | annotate | diff | comparison | revisions
src/eric7/Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
src/eric7/Documentation/Source/eric7.Plugins.VcsPlugins.vcsMercurial.hg.html file | annotate | diff | comparison | revisions
src/eric7/Documentation/Source/eric7.VCS.VersionControl.html file | annotate | diff | comparison | revisions
src/eric7/Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
src/eric7/VCS/VersionControl.py file | annotate | diff | comparison | revisions
--- a/src/eric7/APIs/Python3/eric7.api	Tue Oct 29 14:21:15 2024 +0100
+++ b/src/eric7/APIs/Python3/eric7.api	Tue Oct 29 19:48:56 2024 +0100
@@ -10402,12 +10402,12 @@
 eric7.Testing.Interfaces.PytestExecutor.PytestExecutor?1(testWidget)
 eric7.Testing.Interfaces.PytestRunner.EricPlugin.pytest_collectreport?4(report)
 eric7.Testing.Interfaces.PytestRunner.EricPlugin.pytest_itemcollected?4(item)
-eric7.Testing.Interfaces.PytestRunner.EricPlugin.pytest_report_header?4(config, _startdir)
+eric7.Testing.Interfaces.PytestRunner.EricPlugin.pytest_report_header?4(config)
 eric7.Testing.Interfaces.PytestRunner.EricPlugin.pytest_runtest_logfinish?4(nodeid, location)
 eric7.Testing.Interfaces.PytestRunner.EricPlugin.pytest_runtest_logreport?4(report)
-eric7.Testing.Interfaces.PytestRunner.EricPlugin.pytest_runtest_logstart?4(nodeid, _location)
-eric7.Testing.Interfaces.PytestRunner.EricPlugin.pytest_sessionfinish?4(_session, _exitstatus)
-eric7.Testing.Interfaces.PytestRunner.EricPlugin.pytest_sessionstart?4(_session)
+eric7.Testing.Interfaces.PytestRunner.EricPlugin.pytest_runtest_logstart?4(nodeid, location)
+eric7.Testing.Interfaces.PytestRunner.EricPlugin.pytest_sessionfinish?4(session, exitstatus)
+eric7.Testing.Interfaces.PytestRunner.EricPlugin.pytest_sessionstart?4(session)
 eric7.Testing.Interfaces.PytestRunner.EricPlugin?1(writer)
 eric7.Testing.Interfaces.PytestRunner.GetMarkersPlugin.getMarkers?4()
 eric7.Testing.Interfaces.PytestRunner.GetMarkersPlugin.pytest_cmdline_main?4(config)
@@ -11498,6 +11498,7 @@
 eric7.VCS.VersionControl.VersionControl.committed?7
 eric7.VCS.VersionControl.VersionControl.getStatusMonitorAutoUpdate?4()
 eric7.VCS.VersionControl.VersionControl.getStatusMonitorInterval?4()
+eric7.VCS.VersionControl.VersionControl.restartStatusMonitor?4(project)
 eric7.VCS.VersionControl.VersionControl.setStatusMonitorAutoUpdate?4(auto)
 eric7.VCS.VersionControl.VersionControl.setStatusMonitorInterval?4(interval, project)
 eric7.VCS.VersionControl.VersionControl.splitPath?4(name)
Binary file src/eric7/Documentation/Help/source.qch has changed
--- a/src/eric7/Documentation/Help/source.qhp	Tue Oct 29 14:21:15 2024 +0100
+++ b/src/eric7/Documentation/Help/source.qhp	Tue Oct 29 19:48:56 2024 +0100
@@ -8946,7 +8946,7 @@
       <keyword name="Hg.__hgGetFileForRevision" id="Hg.__hgGetFileForRevision" ref="eric7.Plugins.VcsPlugins.vcsMercurial.hg.html#Hg.__hgGetFileForRevision" />
       <keyword name="Hg.__hgGraftSubCommand" id="Hg.__hgGraftSubCommand" ref="eric7.Plugins.VcsPlugins.vcsMercurial.hg.html#Hg.__hgGraftSubCommand" />
       <keyword name="Hg.__iniFileChanged" id="Hg.__iniFileChanged" ref="eric7.Plugins.VcsPlugins.vcsMercurial.hg.html#Hg.__iniFileChanged" />
-      <keyword name="Hg.__monitorRepoIniFile" id="Hg.__monitorRepoIniFile" ref="eric7.Plugins.VcsPlugins.vcsMercurial.hg.html#Hg.__monitorRepoIniFile" />
+      <keyword name="Hg.__monitorRepoConfigFiles" id="Hg.__monitorRepoConfigFiles" ref="eric7.Plugins.VcsPlugins.vcsMercurial.hg.html#Hg.__monitorRepoConfigFiles" />
       <keyword name="Hg.__vcsCommit_Step2" id="Hg.__vcsCommit_Step2" ref="eric7.Plugins.VcsPlugins.vcsMercurial.hg.html#Hg.__vcsCommit_Step2" />
       <keyword name="Hg._createStatusMonitorThread" id="Hg._createStatusMonitorThread" ref="eric7.Plugins.VcsPlugins.vcsMercurial.hg.html#Hg._createStatusMonitorThread" />
       <keyword name="Hg.canCommitMerge" id="Hg.canCommitMerge" ref="eric7.Plugins.VcsPlugins.vcsMercurial.hg.html#Hg.canCommitMerge" />
@@ -18639,6 +18639,7 @@
       <keyword name="VersionControl.clearStatusMonitorCachedState" id="VersionControl.clearStatusMonitorCachedState" ref="eric7.VCS.VersionControl.html#VersionControl.clearStatusMonitorCachedState" />
       <keyword name="VersionControl.getStatusMonitorAutoUpdate" id="VersionControl.getStatusMonitorAutoUpdate" ref="eric7.VCS.VersionControl.html#VersionControl.getStatusMonitorAutoUpdate" />
       <keyword name="VersionControl.getStatusMonitorInterval" id="VersionControl.getStatusMonitorInterval" ref="eric7.VCS.VersionControl.html#VersionControl.getStatusMonitorInterval" />
+      <keyword name="VersionControl.restartStatusMonitor" id="VersionControl.restartStatusMonitor" ref="eric7.VCS.VersionControl.html#VersionControl.restartStatusMonitor" />
       <keyword name="VersionControl.setStatusMonitorAutoUpdate" id="VersionControl.setStatusMonitorAutoUpdate" ref="eric7.VCS.VersionControl.html#VersionControl.setStatusMonitorAutoUpdate" />
       <keyword name="VersionControl.setStatusMonitorInterval" id="VersionControl.setStatusMonitorInterval" ref="eric7.VCS.VersionControl.html#VersionControl.setStatusMonitorInterval" />
       <keyword name="VersionControl.splitPath" id="VersionControl.splitPath" ref="eric7.VCS.VersionControl.html#VersionControl.splitPath" />
--- a/src/eric7/Documentation/Source/eric7.Plugins.VcsPlugins.vcsMercurial.hg.html	Tue Oct 29 14:21:15 2024 +0100
+++ b/src/eric7/Documentation/Source/eric7.Plugins.VcsPlugins.vcsMercurial.hg.html	Tue Oct 29 19:48:56 2024 +0100
@@ -106,8 +106,8 @@
 <td>Private slot to handle a change of the Mercurial configuration file.</td>
 </tr>
 <tr>
-<td><a href="#Hg.__monitorRepoIniFile">__monitorRepoIniFile</a></td>
-<td>Private slot to add a repository configuration file to the list of monitored files.</td>
+<td><a href="#Hg.__monitorRepoConfigFiles">__monitorRepoConfigFiles</a></td>
+<td>Private slot to add some repository configuration files to the list of monitored files.</td>
 </tr>
 <tr>
 <td><a href="#Hg.__vcsCommit_Step2">__vcsCommit_Step2</a></td>
@@ -728,11 +728,11 @@
 name of the changed file
 </dd>
 </dl>
-<a NAME="Hg.__monitorRepoIniFile" ID="Hg.__monitorRepoIniFile"></a>
-<h4>Hg.__monitorRepoIniFile</h4>
-<b>__monitorRepoIniFile</b>(<i>repodir</i>)
+<a NAME="Hg.__monitorRepoConfigFiles" ID="Hg.__monitorRepoConfigFiles"></a>
+<h4>Hg.__monitorRepoConfigFiles</h4>
+<b>__monitorRepoConfigFiles</b>(<i>repodir</i>)
 <p>
-        Private slot to add a repository configuration file to the list of
+        Private slot to add some repository configuration files to the list of
         monitored files.
 </p>
 
--- a/src/eric7/Documentation/Source/eric7.VCS.VersionControl.html	Tue Oct 29 14:21:15 2024 +0100
+++ b/src/eric7/Documentation/Source/eric7.VCS.VersionControl.html	Tue Oct 29 19:48:56 2024 +0100
@@ -155,6 +155,10 @@
 <td>Public method to get the monitor interval.</td>
 </tr>
 <tr>
+<td><a href="#VersionControl.restartStatusMonitor">restartStatusMonitor</a></td>
+<td>Public method to re-start the VCS status monitor thread.</td>
+</tr>
+<tr>
 <td><a href="#VersionControl.setStatusMonitorAutoUpdate">setStatusMonitorAutoUpdate</a></td>
 <td>Public method to enable the auto update function.</td>
 </tr>
@@ -645,6 +649,32 @@
 int
 </dd>
 </dl>
+<a NAME="VersionControl.restartStatusMonitor" ID="VersionControl.restartStatusMonitor"></a>
+<h4>VersionControl.restartStatusMonitor</h4>
+<b>restartStatusMonitor</b>(<i>project</i>)
+<p>
+        Public method to re-start the VCS status monitor thread.
+</p>
+
+<dl>
+
+<dt><i>project</i> (Project)</dt>
+<dd>
+reference to the project object
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+reference to the monitor thread
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+QThread
+</dd>
+</dl>
 <a NAME="VersionControl.setStatusMonitorAutoUpdate" ID="VersionControl.setStatusMonitorAutoUpdate"></a>
 <h4>VersionControl.setStatusMonitorAutoUpdate</h4>
 <b>setStatusMonitorAutoUpdate</b>(<i>auto</i>)
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/hg.py	Tue Oct 29 14:21:15 2024 +0100
+++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/hg.py	Tue Oct 29 19:48:56 2024 +0100
@@ -150,6 +150,7 @@
         self.__repoIniFile = ""
         self.__defaultConfigured = False
         self.__defaultPushConfigured = False
+        self.__ignoreFile = ""
 
         # instantiate the extensions
         self.__extensions = {
@@ -235,6 +236,8 @@
         watcher.removePath(self.__cfgFile)
         if self.__repoIniFile:
             watcher.removePath(self.__repoIniFile)
+        if self.__ignoreFile:
+            watcher.removePath(self.__ignoreFile)
 
     def initCommand(self, command):
         """
@@ -2166,7 +2169,7 @@
                             if lfPattern is not None:
                                 cfg.write("patterns =\n")
                                 cfg.write("  {0}\n".format("\n  ".join(lfPattern)))
-                self.__monitorRepoIniFile(repoName)
+                self.__monitorRepoConfigFiles(repoName)
                 self.__iniFileChanged(cfgFile)
         self.repoEditor = MiniEditor(cfgFile, "Properties")
         self.repoEditor.show()
@@ -2301,6 +2304,7 @@
                 with open(ignoreName, "w") as ignore:
                     ignore.write("\n".join(ignorePatterns))
                     ignore.write("\n")
+                self.__monitorRepoConfigFiles(name)
                 status = True
             except OSError:
                 status = False
@@ -3122,7 +3126,7 @@
         @type str
         """
         if (
-            path in (self.__cfgFile, self.__repoIniFile)
+            path in (self.__cfgFile, self.__repoIniFile, self.__ignoreFile)
             and not self.__iniFileChangedFlag
         ):
             self.__iniFileChangedFlag = True
@@ -3138,6 +3142,8 @@
                         ).format(err),
                     )
 
+            self.restartStatusMonitor(self.__projectHelper.getProject())
+
             self.__getExtensionsInfo()
 
             if self.__repoIniFile and path == self.__repoIniFile:
@@ -3147,21 +3153,27 @@
 
             self.__iniFileChangedFlag = False
 
-    def __monitorRepoIniFile(self, repodir):
+    def __monitorRepoConfigFiles(self, repodir):
         """
-        Private slot to add a repository configuration file to the list of
+        Private slot to add some repository configuration files to the list of
         monitored files.
 
         @param repodir directory name of the repository
         @type str
         """
+        watcher = EricFileSystemWatcher.instance()
+
         cfgFile = os.path.join(repodir, self.adminDir, "hgrc")
         if os.path.exists(cfgFile):
-            watcher = EricFileSystemWatcher.instance()
             watcher.addPath(cfgFile)
             self.__repoIniFile = cfgFile
             self.__checkDefaults()
 
+        ignoreFile = os.path.join(repodir, Hg.IgnoreFileName)
+        if os.path.exists(ignoreFile):
+            watcher.addPath(ignoreFile)
+            self.__ignoreFile = ignoreFile
+
     ###########################################################################
     ## Methods to handle extensions are below.
     ###########################################################################
@@ -3259,7 +3271,7 @@
         if repodir:
             self.__repoDir = repodir
             self.__createClient(repodir)
-            self.__monitorRepoIniFile(repodir)
+            self.__monitorRepoConfigFiles(repodir)
 
         return self.__projectHelper
 
--- a/src/eric7/VCS/VersionControl.py	Tue Oct 29 14:21:15 2024 +0100
+++ b/src/eric7/VCS/VersionControl.py	Tue Oct 29 19:48:56 2024 +0100
@@ -1045,6 +1045,18 @@
             )
             self.__statusMonitorInfo("")
 
+    def restartStatusMonitor(self, project):
+        """
+        Public method to re-start the VCS status monitor thread.
+
+        @param project reference to the project object
+        @type Project
+        @return reference to the monitor thread
+        @rtype QThread
+        """
+        self.stopStatusMonitor()
+        return self.startStatusMonitor(project)
+
     def setStatusMonitorInterval(self, interval, project):
         """
         Public method to change the monitor interval.

eric ide

mercurial