Fixed an issue with Mercurial not realizing some changes of the configuration.

Sat, 22 Mar 2014 16:59:37 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 22 Mar 2014 16:59:37 +0100
changeset 3416
efce6439595a
parent 3410
b5e18d7f3501
child 3420
5169ee7a88db

Fixed an issue with Mercurial not realizing some changes of the configuration.

APIs/Python3/eric5.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric5.Plugins.VcsPlugins.vcsMercurial.ProjectHelper.html file | annotate | diff | comparison | revisions
Documentation/Source/eric5.Plugins.VcsPlugins.vcsMercurial.hg.html file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Wed Mar 19 19:50:54 2014 +0100
+++ b/APIs/Python3/eric5.api	Sat Mar 22 16:59:37 2014 +0100
@@ -5025,6 +5025,7 @@
 eric5.Plugins.VcsPlugins.vcsMercurial.hg.Hg.hgSummary?4(mq=False, largefiles=False)
 eric5.Plugins.VcsPlugins.vcsMercurial.hg.Hg.hgUnbundle?4(name)
 eric5.Plugins.VcsPlugins.vcsMercurial.hg.Hg.hgVerify?4(name)
+eric5.Plugins.VcsPlugins.vcsMercurial.hg.Hg.iniFileChanged?7
 eric5.Plugins.VcsPlugins.vcsMercurial.hg.Hg.initCommand?4(command)
 eric5.Plugins.VcsPlugins.vcsMercurial.hg.Hg.isExtensionActive?4(extensionName)
 eric5.Plugins.VcsPlugins.vcsMercurial.hg.Hg.vcsAdd?4(name, isDir=False, noDialog=False)
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Wed Mar 19 19:50:54 2014 +0100
+++ b/Documentation/Help/source.qhp	Sat Mar 22 16:59:37 2014 +0100
@@ -6327,6 +6327,7 @@
       <keyword name="HgProjectBrowserHelper.showContextMenuMulti" id="HgProjectBrowserHelper.showContextMenuMulti" ref="eric5.Plugins.VcsPlugins.vcsMercurial.ProjectBrowserHelper.html#HgProjectBrowserHelper.showContextMenuMulti" />
       <keyword name="HgProjectHelper" id="HgProjectHelper" ref="eric5.Plugins.VcsPlugins.vcsMercurial.ProjectHelper.html#HgProjectHelper" />
       <keyword name="HgProjectHelper (Constructor)" id="HgProjectHelper (Constructor)" ref="eric5.Plugins.VcsPlugins.vcsMercurial.ProjectHelper.html#HgProjectHelper.__init__" />
+      <keyword name="HgProjectHelper.__checkActions" id="HgProjectHelper.__checkActions" ref="eric5.Plugins.VcsPlugins.vcsMercurial.ProjectHelper.html#HgProjectHelper.__checkActions" />
       <keyword name="HgProjectHelper.__hgAddSubrepository" id="HgProjectHelper.__hgAddSubrepository" ref="eric5.Plugins.VcsPlugins.vcsMercurial.ProjectHelper.html#HgProjectHelper.__hgAddSubrepository" />
       <keyword name="HgProjectHelper.__hgArchive" id="HgProjectHelper.__hgArchive" ref="eric5.Plugins.VcsPlugins.vcsMercurial.ProjectHelper.html#HgProjectHelper.__hgArchive" />
       <keyword name="HgProjectHelper.__hgBackout" id="HgProjectHelper.__hgBackout" ref="eric5.Plugins.VcsPlugins.vcsMercurial.ProjectHelper.html#HgProjectHelper.__hgBackout" />
--- a/Documentation/Source/eric5.Plugins.VcsPlugins.vcsMercurial.ProjectHelper.html	Wed Mar 19 19:50:54 2014 +0100
+++ b/Documentation/Source/eric5.Plugins.VcsPlugins.vcsMercurial.ProjectHelper.html	Sat Mar 22 16:59:37 2014 +0100
@@ -60,6 +60,9 @@
 <td><a href="#HgProjectHelper.__init__">HgProjectHelper</a></td>
 <td>Constructor</td>
 </tr><tr>
+<td><a href="#HgProjectHelper.__checkActions">__checkActions</a></td>
+<td>Private slot to set the enabled status of actions.</td>
+</tr><tr>
 <td><a href="#HgProjectHelper.__hgAddSubrepository">__hgAddSubrepository</a></td>
 <td>Private slot used to add a sub-repository.</td>
 </tr><tr>
@@ -246,7 +249,12 @@
 <dd>
 name of this object (string)
 </dd>
-</dl><a NAME="HgProjectHelper.__hgAddSubrepository" ID="HgProjectHelper.__hgAddSubrepository"></a>
+</dl><a NAME="HgProjectHelper.__checkActions" ID="HgProjectHelper.__checkActions"></a>
+<h4>HgProjectHelper.__checkActions</h4>
+<b>__checkActions</b>(<i></i>)
+<p>
+        Private slot to set the enabled status of actions.
+</p><a NAME="HgProjectHelper.__hgAddSubrepository" ID="HgProjectHelper.__hgAddSubrepository"></a>
 <h4>HgProjectHelper.__hgAddSubrepository</h4>
 <b>__hgAddSubrepository</b>(<i></i>)
 <p>
--- a/Documentation/Source/eric5.Plugins.VcsPlugins.vcsMercurial.hg.html	Wed Mar 19 19:50:54 2014 +0100
+++ b/Documentation/Source/eric5.Plugins.VcsPlugins.vcsMercurial.hg.html	Sat Mar 22 16:59:37 2014 +0100
@@ -52,6 +52,10 @@
 </dd><dt>committed()</dt>
 <dd>
 emitted after the commit action has completed
+</dd><dt>iniFileChanged()</dt>
+<dd>
+emitted when a Mercurial/repo configuration file
+        has changed
 </dd>
 </dl>
 <h3>Derived from</h3>
--- a/Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py	Wed Mar 19 19:50:54 2014 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py	Sat Mar 22 16:59:37 2014 +0100
@@ -76,6 +76,8 @@
         
         for extension in self.__extensions.values():
             extension.setObjects(vcsObject, projectObject)
+        
+        self.vcs.iniFileChanged.connect(self.__checkActions)
     
     def getProject(self):
         """
@@ -997,6 +999,18 @@
         self.hgArchiveAct.triggered.connect(self.__hgArchive)
         self.actions.append(self.hgArchiveAct)
     
+    def __checkActions(self):
+        """
+        Private slot to set the enabled status of actions.
+        """
+        self.hgPullAct.setEnabled(self.vcs.canPull())
+        self.hgIncomingAct.setEnabled(self.vcs.canPull())
+        
+        self.hgPushAct.setEnabled(self.vcs.canPush())
+        self.hgPushBranchAct.setEnabled(self.vcs.canPush())
+        self.hgPushForcedAct.setEnabled(self.vcs.canPush())
+        self.hgOutgoingAct.setEnabled(self.vcs.canPush())
+    
     def initMenu(self, menu):
         """
         Public method to generate the VCS menu.
@@ -1165,19 +1179,14 @@
         """
         super().showMenu()
         
-        self.hgPullAct.setEnabled(self.vcs.canPull())
-        self.hgIncomingAct.setEnabled(self.vcs.canPull())
-        
-        self.hgPushAct.setEnabled(self.vcs.canPush())
-        self.hgPushBranchAct.setEnabled(self.vcs.canPush())
-        self.hgPushForcedAct.setEnabled(self.vcs.canPush())
-        self.hgOutgoingAct.setEnabled(self.vcs.canPush())
+        self.__checkActions()
     
     def shutdown(self):
         """
         Public method to perform shutdown actions.
         """
         self.vcs.activeExtensionsChanged.disconnect(self.__showExtensionMenu)
+        self.vcs.iniFileChanged.disconnect(self.__checkActions)
         
         # close torn off sub menus
         for menu in self.subMenus:
--- a/Plugins/VcsPlugins/vcsMercurial/hg.py	Wed Mar 19 19:50:54 2014 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/hg.py	Sat Mar 22 16:59:37 2014 +0100
@@ -35,9 +35,12 @@
     @signal committed() emitted after the commit action has completed
     @signal activeExtensionsChanged() emitted when the list of active
         extensions has changed
+    @signal iniFileChanged() emitted when a Mercurial/repo configuration file
+        has changed
     """
     committed = pyqtSignal()
     activeExtensionsChanged = pyqtSignal()
+    iniFileChanged = pyqtSignal()
     
     IgnoreFileName = ".hgignore"
     
@@ -2255,6 +2258,7 @@
                                 "\n  ".join(lfPattern)))
                 cfg.close()
                 self.__monitorRepoIniFile(repodir)
+                self.__iniFileChanged(cfgFile)
             except IOError:
                 pass
         self.repoEditor = MiniEditor(cfgFile, "Properties")
@@ -3242,9 +3246,9 @@
         else:
             output, error = self.__client.runcommand(args)
         
+        self.__defaultConfigured = False
+        self.__defaultPushConfigured = False
         if output:
-            self.__defaultConfigured = False
-            self.__defaultPushConfigured = False
             for line in output.splitlines():
                 if line.startswith("paths.default=") and \
                         not line.strip().endswith("="):
@@ -3290,6 +3294,8 @@
         
         if self.__repoIniFile and path == self.__repoIniFile:
             self.__checkDefaults()
+        
+        self.iniFileChanged.emit()
     
     def __monitorRepoIniFile(self, name):
         """

eric ide

mercurial