Mercurial: completed more code cleanup.

Wed, 13 Jan 2021 17:46:13 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 13 Jan 2021 17:46:13 +0100
changeset 7971
ff2971513d6d
parent 7970
c4ee8a81584c
child 7972
4fc11172df1b

Mercurial: completed more code cleanup.

eric6/Plugins/VcsPlugins/vcsMercurial/GpgExtension/gpg.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HgDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HgDiffGenerator.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/ProjectHelper.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/histedit.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/LargefilesExtension/ProjectHelper.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/LargefilesExtension/largefiles.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/PurgeExtension/ProjectHelper.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/PurgeExtension/purge.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesHeaderDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListAllGuardsDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListGuardsDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesQueueManagementDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/ProjectHelper.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/ProjectHelper.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/rebase.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveBrowserDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/ProjectHelper.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/shelve.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/GpgExtension/gpg.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/GpgExtension/gpg.py	Wed Jan 13 17:46:13 2021 +0100
@@ -7,8 +7,6 @@
 Module implementing the gpg extension interface.
 """
 
-import os
-
 from PyQt5.QtWidgets import QDialog
 
 from ..HgExtension import HgExtension
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgDialog.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgDialog.py	Wed Jan 13 17:46:13 2021 +0100
@@ -79,18 +79,21 @@
         elif button == self.buttonBox.button(QDialogButtonBox.Cancel):
             self.vcs.getClient().cancel()
     
-    # TODO: workingDir is obsolete
-    def startProcess(self, args, workingDir=None, showArgs=True,
-                     environment=None):
+    def startProcess(self, args, showArgs=True, environment=None, client=None):
         """
         Public slot used to start the process.
         
-        @param args list of arguments for the process (list of strings)
-        @param workingDir working directory for the process (string)
-        @param showArgs flag indicating to show the arguments (boolean)
+        @param args list of arguments for the process
+        @type list of str
+        @param showArgs flag indicating to show the arguments
+        @type bool
         @param environment dictionary of environment settings to add
-            or change for the git process (dict of string and string)
+            or change for the git process
+        @type dict
+        @param client reference to a non-standard command client
+        @type HgClient
         @return flag indicating a successful start of the process
+        @rtype bool
         """
         self.errorGroup.hide()
         self.inputGroup.hide()
@@ -112,7 +115,9 @@
             self.resultbox.append(' '.join(args))
             self.resultbox.append('')
         
-        out, err = self.vcs.getClient().runcommand(
+        if client is None:
+            client = self.vcs.getClient()
+        out, err = client.runcommand(
             args,
             prompt=self.__getInput,
             output=self.__showOutput,
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgDiffGenerator.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgDiffGenerator.py	Wed Jan 13 17:46:13 2021 +0100
@@ -99,12 +99,11 @@
                     elif rev1 is None:
                         args.append(':{0}'.format(rev2))
         
-        if isinstance(fn, list):
-            dname, fnames = self.vcs.splitPathList(fn)
-            self.vcs.addArguments(args, fn)
-        else:
-            dname, fname = self.vcs.splitPath(fn)
-            args.append(fn)
+        if fn:
+            if isinstance(fn, list):
+                self.vcs.addArguments(args, fn)
+            else:
+                args.append(fn)
         
         self.__oldFile = ""
         self.__oldFileLine = -1
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Wed Jan 13 17:46:13 2021 +0100
@@ -594,7 +594,7 @@
         return col, color, edges
     
     def __generateIcon(self, column, color, bottomedges, topedges, dotColor,
-                       currentRev, closed, isDraft):
+                       currentRev, closed, isPushableDraft):
         """
         Private method to generate an icon containing the revision tree for the
         given data.
@@ -615,7 +615,8 @@
         @param closed flag indicating to draw an icon for a closed
             branch
         @type bool
-        @param isDraft flag indicating an entry of phase 'draft'
+        @param isPushableDraft flag indicating an entry of phase 'draft',
+            that can by pushed
         @type bool
         @return icon for the node
         @rtype QIcon
@@ -692,8 +693,9 @@
                     QPoint(dot_x + 2 * offset, dot_y + 2 * offset)
                 )
         else:
-            if isDraft:
-                # 'draft' phase: draw an up arrow like outgoing
+            if isPushableDraft:
+                # 'draft' phase: draw an up arrow like outgoing,
+                # if it can be pushed
                 offset = radius // 2
                 painter.drawConvexPolygon(
                     QPoint(dot_x + offset, dot_y),
@@ -859,24 +861,37 @@
     
     def __generateLogItem(self, author, date, message, revision, changedPaths,
                           parents, branches, tags, phase, bookmarks,
-                          latestTag):
+                          latestTag, canPush=False):
         """
         Private method to generate a log tree entry.
         
-        @param author author info (string)
-        @param date date info (string)
-        @param message text of the log message (list of strings)
-        @param revision revision info (string)
+        @param author author info
+        @type str
+        @param date date info
+        @type str
+        @param message text of the log message
+        @type list of str
+        @param revision revision info
+        @type str
         @param changedPaths list of dictionary objects containing
             info about the changed files/directories
-        @param parents list of parent revisions (list of integers)
-        @param branches list of branches (list of strings)
-        @param tags list of tags (string)
-        @param phase phase of the entry (string)
-        @param bookmarks list of bookmarks (string)
+        @type dict
+        @param parents list of parent revisions
+        @type list of int
+        @param branches list of branches
+        @type list of str
+        @param tags list of tags
+        @type str
+        @param phase phase of the entry
+        @type str
+        @param bookmarks list of bookmarks
+        @type str
         @param latestTag the latest tag(s) reachable from the changeset
-            (list of strings)
-        @return reference to the generated item (QTreeWidgetItem)
+        @type list of str
+        @param canPush flag indicating that changesets can be pushed
+        @type bool
+        @return reference to the generated item
+        @rtype QTreeWidgetItem
         """
         logMessageColumnWidth = self.vcs.getPlugin().getPreferences(
             "LogMessageColumnWidth")
@@ -945,7 +960,7 @@
                                    QColor(self.__branchColor(branches[0])),
                                    rev in self.__projectWorkingDirParents,
                                    rev in self.__closedBranchesRevs,
-                                   phase == "draft")
+                                   phase == "draft" and canPush)
         itm.setIcon(0, icon)
         
         try:
@@ -1131,6 +1146,7 @@
         changedPaths = []
         initialText = True
         fileCopies = {}
+        canPush = self.vcs.canPush()
         for s in self.buf:
             if s != "@@@\n":
                 try:
@@ -1220,7 +1236,8 @@
                         log["author"], log["date"],
                         log["message"], log["revision"], changedPaths,
                         log["parents"], log["branches"], log["tags"],
-                        log["phase"], log["bookmarks"], log["latesttag"])
+                        log["phase"], log["bookmarks"], log["latesttag"],
+                        canPush=canPush)
                     dt = QDate.fromString(log["date"], Qt.ISODate)
                     if (
                         not self.__maxDate.isValid() and
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/ProjectHelper.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/ProjectHelper.py	Wed Jan 13 17:46:13 2021 +0100
@@ -125,8 +125,7 @@
         Private slot used to start a history editing session.
         """
         shouldReopen = (
-            self.vcs.getExtensionObject("histedit")
-            .hgHisteditStart(self.project.getProjectPath())
+            self.vcs.getExtensionObject("histedit").hgHisteditStart()
         )
         if shouldReopen:
             res = E5MessageBox.yesNo(
@@ -142,8 +141,7 @@
         Private slot used to continue an interrupted history editing session.
         """
         shouldReopen = (
-            self.vcs.getExtensionObject("histedit")
-            .hgHisteditContinue(self.project.getProjectPath())
+            self.vcs.getExtensionObject("histedit").hgHisteditContinue()
         )
         if shouldReopen:
             res = E5MessageBox.yesNo(
@@ -159,8 +157,7 @@
         Private slot used to abort an interrupted history editing session.
         """
         shouldReopen = (
-            self.vcs.getExtensionObject("histedit")
-            .hgHisteditAbort(self.project.getProjectPath())
+            self.vcs.getExtensionObject("histedit").hgHisteditAbort()
         )
         if shouldReopen:
             res = E5MessageBox.yesNo(
@@ -177,8 +174,7 @@
         history editing session.
         """
         shouldReopen = (
-            self.vcs.getExtensionObject("histedit")
-            .hgHisteditEditPlan(self.project.getProjectPath())
+            self.vcs.getExtensionObject("histedit").hgHisteditEditPlan()
         )
         if shouldReopen:
             res = E5MessageBox.yesNo(
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/histedit.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/histedit.py	Wed Jan 13 17:46:13 2021 +0100
@@ -29,24 +29,15 @@
         """
         super(Histedit, self).__init__(vcs)
     
-    def hgHisteditStart(self, name, rev=""):
+    def hgHisteditStart(self, rev=""):
         """
         Public method to start a histedit session.
         
-        @param name file/directory name
-        @type str
         @param rev revision to start histedit at
         @type str
         @return flag indicating that the project should be reread
         @rtype bool
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return False
-        
         from .HgHisteditConfigDialog import HgHisteditConfigDialog
         res = False
         dlg = HgHisteditConfigDialog(self.vcs.hgGetTagsList(),
@@ -76,29 +67,20 @@
                 self.tr("Starting histedit session"),
                 self.vcs,
                 useClient=False)
-            res = dia.startProcess(args, repodir, environment=env)
+            res = dia.startProcess(args, environment=env)
             if res:
                 dia.exec()
                 res = dia.hasAddOrDelete()
                 self.vcs.checkVCSStatus()
         return res
     
-    def hgHisteditContinue(self, name):
+    def hgHisteditContinue(self):
         """
         Public method to continue an interrupted histedit session.
         
-        @param name file/directory name
-        @type str
         @return flag indicating that the project should be reread
         @rtype bool
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return False
-        
         args = self.vcs.initCommand("histedit")
         args.append("--continue")
         args.append("-v")
@@ -111,7 +93,7 @@
             self.tr("Continue histedit session"),
             self.vcs,
             useClient=False)
-        res = dia.startProcess(args, repodir, environment=env)
+        res = dia.startProcess(args, environment=env)
         if res:
             dia.exec()
             res = dia.hasAddOrDelete()
@@ -127,13 +109,6 @@
         @return flag indicating that the project should be reread
         @rtype bool
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return False
-        
         args = self.vcs.initCommand("histedit")
         args.append("--abort")
         args.append("-v")
@@ -146,30 +121,21 @@
             self.tr("Abort histedit session"),
             self.vcs,
             useClient=False)
-        res = dia.startProcess(args, repodir, environment=env)
+        res = dia.startProcess(args, environment=env)
         if res:
             dia.exec()
             res = dia.hasAddOrDelete()
             self.vcs.checkVCSStatus()
         return res
     
-    def hgHisteditEditPlan(self, name):
+    def hgHisteditEditPlan(self):
         """
         Public method to edit the remaining actions list of an interrupted
         histedit session.
         
-        @param name file/directory name
-        @type str
         @return flag indicating that the project should be reread
         @rtype bool
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return False
-        
         args = self.vcs.initCommand("histedit")
         args.append("--edit-plan")
         args.append("-v")
@@ -182,7 +148,7 @@
             self.tr("Edit Plan"),
             self.vcs,
             useClient=False)
-        res = dia.startProcess(args, repodir, environment=env)
+        res = dia.startProcess(args, environment=env)
         if res:
             dia.exec()
             res = dia.hasAddOrDelete()
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/LargefilesExtension/ProjectHelper.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/LargefilesExtension/ProjectHelper.py	Wed Jan 13 17:46:13 2021 +0100
@@ -225,5 +225,4 @@
         if mode not in ['large', 'lfa', 'lfc']:
             raise ValueError("Bad value for 'mode' parameter.")
         
-        self.vcs.getExtensionObject("largefiles").hgLfVerify(
-            self.project.getProjectPath(), mode)
+        self.vcs.getExtensionObject("largefiles").hgLfVerify(mode)
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/LargefilesExtension/largefiles.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/LargefilesExtension/largefiles.py	Wed Jan 13 17:46:13 2021 +0100
@@ -13,9 +13,11 @@
 from PyQt5.QtWidgets import QDialog
 
 from E5Gui.E5Application import e5App
+from E5Gui import E5MessageBox
 
 from ..HgExtension import HgExtension
 from ..HgDialog import HgDialog
+from ..HgClient import HgClient
 
 
 class Largefiles(HgExtension):
@@ -45,13 +47,6 @@
         
         projectDir = os.path.dirname(projectFile)
         
-        # find the root of the repo
-        repodir = projectDir
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         from .LfConvertDataDialog import LfConvertDataDialog
         dlg = LfConvertDataDialog(projectDir, direction)
         if dlg.exec() == QDialog.Accepted:
@@ -72,7 +67,7 @@
                 args.extend(patterns)
             
             dia = HgDialog(self.tr('Convert Project - Converting'), self.vcs)
-            res = dia.startProcess(args, repodir)
+            res = dia.startProcess(args)
             if res:
                 dia.exec()
                 res = dia.normalExit() and os.path.isdir(
@@ -80,22 +75,44 @@
             
             # step 2: create working directory contents
             if res:
+                # step 2.1: start a command server client for the new repo
+                client = HgClient(newName, "utf-8", self.vcs)
+                ok, err = client.startServer()
+                if not ok:
+                    E5MessageBox.warning(
+                        None,
+                        self.tr("Mercurial Command Server"),
+                        self.tr(
+                            """<p>The Mercurial Command Server could not be"""
+                            """ started.</p><p>Reason: {0}</p>""").format(err))
+                    return
+                
+                # step 2.2: create working directory contents
                 args = self.vcs.initCommand("update")
                 args.append("--verbose")
                 dia = HgDialog(self.tr('Convert Project - Extracting'),
-                               self.vcs, useClient=False)
-                res = dia.startProcess(args, newName)
+                               self.vcs, client=client)
+                res = dia.startProcess(args)
                 if res:
                     dia.exec()
                     res = dia.normalExit() and os.path.isfile(newProjectFile)
+                
+                # step 2.3: stop the command server client for the new repo
+                client.stopServer()
             
             # step 3: close current project and open new one
             if res:
                 if direction == 'largefiles':
-                    self.vcs.hgEditConfig(newName, largefilesData={
-                        "minsize": minSize, "pattern": patterns})
+                    self.vcs.hgEditConfig(
+                        repoName=newName,
+                        largefilesData={"minsize": minSize,
+                                        "pattern": patterns}
+                    )
                 else:
-                    self.vcs.hgEditConfig(newName, withLargefiles=False)
+                    self.vcs.hgEditConfig(
+                        repoName=newName,
+                        withLargefiles=False
+                    )
                 QTimer.singleShot(
                     0, lambda: e5App().getObject("Project").openProject(
                         newProjectFile))
@@ -115,18 +132,6 @@
             args.append("--normal")
         
         if isinstance(names, list):
-            dname = self.vcs.splitPathList(names)[0]
-        else:
-            dname = self.vcs.splitPath(names)[0]
-        
-        # find the root of the repo
-        repodir = dname
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
-        if isinstance(names, list):
             self.vcs.addArguments(args, names)
         else:
             args.append(names)
@@ -134,7 +139,7 @@
         dia = HgDialog(
             self.tr('Adding files to the Mercurial repository'),
             self.vcs)
-        res = dia.startProcess(args, repodir)
+        res = dia.startProcess(args)
         if res:
             dia.exec()
     
@@ -165,20 +170,12 @@
             if res:
                 dia.exec()
     
-    def hgLfVerify(self, projectDir, mode):
+    def hgLfVerify(self, mode):
         """
         Public method to verify large files integrity.
         
-        @param projectDir directory name of the project (string)
         @param mode verify mode (string; one of 'large', 'lfa' or 'lfc')
         """
-        # find the root of the repo
-        repodir = projectDir
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         args = self.vcs.initCommand("verify")
         if mode == "large":
             args.append("--large")
@@ -192,6 +189,6 @@
         dia = HgDialog(
             self.tr('Verifying the integrity of large files'),
             self.vcs)
-        res = dia.startProcess(args, repodir)
+        res = dia.startProcess(args)
         if res:
             dia.exec()
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py	Wed Jan 13 17:46:13 2021 +0100
@@ -1801,7 +1801,7 @@
         """
         Private slot used to edit the repository configuration file.
         """
-        self.vcs.hgEditConfig(self.project.ppath)
+        self.vcs.hgEditConfig()
     
     def __hgShowConfig(self):
         """
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/PurgeExtension/ProjectHelper.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/PurgeExtension/ProjectHelper.py	Wed Jan 13 17:46:13 2021 +0100
@@ -135,26 +135,22 @@
         """
         Private slot used to remove files not tracked by Mercurial.
         """
-        self.vcs.getExtensionObject("purge").hgPurge(
-            self.project.getProjectPath(), deleteAll=False)
+        self.vcs.getExtensionObject("purge").hgPurge(deleteAll=False)
     
     def __hgPurgeAll(self):
         """
         Private slot used to remove all files not tracked by Mercurial.
         """
-        self.vcs.getExtensionObject("purge").hgPurge(
-            self.project.getProjectPath(), deleteAll=True)
+        self.vcs.getExtensionObject("purge").hgPurge(deleteAll=True)
     
     def __hgPurgeList(self):
         """
         Private slot used to list files not tracked by Mercurial.
         """
-        self.vcs.getExtensionObject("purge").hgPurgeList(
-            self.project.getProjectPath(), deleteAll=False)
+        self.vcs.getExtensionObject("purge").hgPurgeList(deleteAll=False)
     
     def __hgPurgeAllList(self):
         """
         Private slot used to list all files not tracked by Mercurial.
         """
-        self.vcs.getExtensionObject("purge").hgPurgeList(
-            self.project.getProjectPath(), deleteAll=True)
+        self.vcs.getExtensionObject("purge").hgPurgeList(deleteAll=True)
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/PurgeExtension/purge.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/PurgeExtension/purge.py	Wed Jan 13 17:46:13 2021 +0100
@@ -7,8 +7,6 @@
 Module implementing the purge extension interface.
 """
 
-import os
-
 from PyQt5.QtWidgets import QDialog
 
 from ..HgExtension import HgExtension
@@ -36,14 +34,15 @@
         if self.purgeListDialog is not None:
             self.purgeListDialog.close()
     
-    def __getEntries(self, repodir, deleteAll):
+    def __getEntries(self, deleteAll):
         """
         Private method to get a list of files/directories being purged.
         
-        @param repodir directory name of the repository (string)
         @param deleteAll flag indicating to delete all files including ignored
-            ones (boolean)
-        @return name of the current patch (string)
+            ones
+        @type bool
+        @return name of the current patch
+        @rtype str
         """
         purgeEntries = []
         
@@ -59,21 +58,14 @@
         
         return purgeEntries
     
-    def hgPurge(self, name, deleteAll=False):
+    def hgPurge(self, deleteAll=False):
         """
         Public method to purge files and directories not tracked by Mercurial.
         
-        @param name file/directory name (string)
         @param deleteAll flag indicating to delete all files including ignored
-            ones (boolean)
+            ones
+        @type bool
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         if deleteAll:
             title = self.tr("Purge All Files")
             message = self.tr(
@@ -83,7 +75,7 @@
             title = self.tr("Purge Files")
             message = self.tr(
                 """Do really want to delete files not tracked by Mercurial?""")
-        entries = self.__getEntries(repodir, deleteAll)
+        entries = self.__getEntries(deleteAll)
         from UI.DeleteFilesConfirmationDialog import (
             DeleteFilesConfirmationDialog
         )
@@ -95,26 +87,18 @@
             args.append("-v")
             
             dia = HgDialog(title, self.vcs)
-            res = dia.startProcess(args, repodir)
+            res = dia.startProcess(args)
             if res:
                 dia.exec()
     
-    def hgPurgeList(self, name, deleteAll=False):
+    def hgPurgeList(self, deleteAll=False):
         """
         Public method to list files and directories not tracked by Mercurial.
         
-        @param name file/directory name (string)
         @param deleteAll flag indicating to list all files including ignored
             ones (boolean)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
-        entries = self.__getEntries(repodir, deleteAll)
+        entries = self.__getEntries(deleteAll)
         from .HgPurgeListDialog import HgPurgeListDialog
         self.purgeListDialog = HgPurgeListDialog(entries)
         self.purgeListDialog.show()
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py	Wed Jan 13 17:46:13 2021 +0100
@@ -7,8 +7,6 @@
 Module implementing a dialog to define guards for patches.
 """
 
-import os
-
 from PyQt5.QtCore import pyqtSlot, Qt, QCoreApplication
 from PyQt5.QtWidgets import (
     QDialog, QDialogButtonBox, QAbstractButton, QListWidgetItem
@@ -80,22 +78,10 @@
         
         e.accept()
     
-    def start(self, path):
+    def start(self):
         """
         Public slot to start the list command.
-        
-        @param path name of directory to be listed (string)
         """
-        dname, fname = self.vcs.splitPath(path)
-        
-        # find the root of the repo
-        repodir = dname
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
-        self.__repodir = repodir
         self.on_patchSelector_activated("")
     
     @pyqtSlot(str)
@@ -125,7 +111,7 @@
         self.patchNameLabel.setText("")
         
         self.guardCombo.clear()
-        guardsList = self.extension.getGuardsList(self.__repodir)
+        guardsList = self.extension.getGuardsList()
         self.guardCombo.addItems(guardsList)
         self.guardCombo.setEditText("")
         
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesHeaderDialog.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesHeaderDialog.py	Wed Jan 13 17:46:13 2021 +0100
@@ -7,8 +7,6 @@
 Module implementing a dialog to show the commit message of the current patch.
 """
 
-import os
-
 from PyQt5.QtCore import Qt, QCoreApplication
 from PyQt5.QtWidgets import QDialog, QDialogButtonBox
 
@@ -52,23 +50,12 @@
         
         e.accept()
     
-    def start(self, path):
+    def start(self):
         """
         Public slot to start the list command.
-        
-        @param path name of directory to be listed (string)
         """
         self.activateWindow()
         
-        dname, fname = self.vcs.splitPath(path)
-        
-        # find the root of the repo
-        repodir = dname
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         args = self.vcs.initCommand("qheader")
         
         out, err = self.__hgClient.runcommand(
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListAllGuardsDialog.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListAllGuardsDialog.py	Wed Jan 13 17:46:13 2021 +0100
@@ -7,8 +7,6 @@
 Module implementing a dialog to show all guards for all patches.
 """
 
-import os
-
 from PyQt5.QtCore import Qt, QCoreApplication
 from PyQt5.QtWidgets import QDialog, QTreeWidgetItem
 
@@ -38,21 +36,10 @@
         self.show()
         QCoreApplication.processEvents()
     
-    def start(self, path):
+    def start(self):
         """
         Public slot to start the list command.
-        
-        @param path name of directory to be listed (string)
         """
-        dname, fname = self.vcs.splitPath(path)
-        
-        # find the root of the repo
-        repodir = dname
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         args = self.vcs.initCommand("qguard")
         args.append("--list")
         
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListDialog.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListDialog.py	Wed Jan 13 17:46:13 2021 +0100
@@ -7,8 +7,6 @@
 Module implementing a dialog to show a list of applied and unapplied patches.
 """
 
-import os
-
 from PyQt5.QtCore import Qt, QCoreApplication
 from PyQt5.QtWidgets import (
     QDialog, QDialogButtonBox, QHeaderView, QTreeWidgetItem
@@ -62,27 +60,13 @@
         
         e.accept()
     
-    def start(self, path):
+    def start(self):
         """
         Public slot to start the list command.
-        
-        @param path name of directory to be listed (string)
         """
         self.errorGroup.hide()
-        
-        self.intercept = False
         self.activateWindow()
         
-        dname, fname = self.vcs.splitPath(path)
-        
-        # find the root of the repo
-        repodir = dname
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
-        self.__repodir = repodir
         self.__getSeries()
     
     def __getSeries(self, missing=False):
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListGuardsDialog.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListGuardsDialog.py	Wed Jan 13 17:46:13 2021 +0100
@@ -7,8 +7,6 @@
 Module implementing a dialog to show the guards of a selected patch.
 """
 
-import os
-
 from PyQt5.QtCore import pyqtSlot, Qt, QCoreApplication
 from PyQt5.QtWidgets import QDialog, QListWidgetItem
 
@@ -52,22 +50,10 @@
         
         e.accept()
     
-    def start(self, path):
+    def start(self):
         """
         Public slot to start the list command.
-        
-        @param path name of directory to be listed (string)
         """
-        dname, fname = self.vcs.splitPath(path)
-        
-        # find the root of the repo
-        repodir = dname
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
-        self.__repodir = repodir
         self.on_patchSelector_activated("")
     
     @pyqtSlot(str)
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesQueueManagementDialog.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesQueueManagementDialog.py	Wed Jan 13 17:46:13 2021 +0100
@@ -24,7 +24,7 @@
     NAME_INPUT = 1
     QUEUE_INPUT = 2
     
-    def __init__(self, mode, title, suppressActive, repodir, vcs, parent=None):
+    def __init__(self, mode, title, suppressActive, vcs, parent=None):
         """
         Constructor
         
@@ -34,7 +34,6 @@
         @param title title for the dialog (string)
         @param suppressActive flag indicating to not show the name of the
             active queue (boolean)
-        @param repodir name of the repository directory (string)
         @param vcs reference to the vcs object
         @param parent reference to the parent widget (QWidget)
         @exception ValueError raised to indicate an invalid dialog mode
@@ -49,7 +48,6 @@
             raise ValueError("illegal value for mode")
         
         self.__mode = mode
-        self.__repodir = repodir
         self.__suppressActive = suppressActive
         self.__hgClient = vcs.getClient()
         self.vcs = vcs
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/ProjectHelper.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/ProjectHelper.py	Wed Jan 13 17:46:13 2021 +0100
@@ -780,22 +780,19 @@
         """
         Private slot used to create a new named patch.
         """
-        self.vcs.getExtensionObject("mq").hgQueueNewPatch(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueNewPatch()
     
     def __hgQueueRefreshPatch(self):
         """
         Private slot used to refresh the current patch.
         """
-        self.vcs.getExtensionObject("mq").hgQueueRefreshPatch(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueRefreshPatch()
     
     def __hgQueueRefreshPatchMessage(self):
         """
         Private slot used to refresh the current patch and its commit message.
         """
-        self.vcs.getExtensionObject("mq").hgQueueRefreshPatch(
-            self.project.getProjectPath(), editMessage=True)
+        self.vcs.getExtensionObject("mq").hgQueueRefreshPatch(editMessage=True)
     
     def __hgQueueShowPatch(self):
         """
@@ -808,16 +805,14 @@
         """
         Private slot used to show the commit message of the current patch.
         """
-        self.vcs.getExtensionObject("mq").hgQueueShowHeader(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueShowHeader()
     
-    def __hgQueuePushPopPatches(self, name, operation, doAll=False,
+    def __hgQueuePushPopPatches(self, operation, doAll=False,
                                 named=False, force=False):
         """
         Private method to push patches onto the stack or pop patches off the
         stack.
         
-        @param name file/directory name (string)
         @param operation operation type to be performed (Queues.POP,
             Queues.PUSH, Queues.GOTO)
         @param doAll flag indicating to push/pop all (boolean)
@@ -826,7 +821,7 @@
         @param force flag indicating a forceful pop (boolean)
         """
         shouldReopen = self.vcs.getExtensionObject("mq").hgQueuePushPopPatches(
-            name, operation=operation, doAll=doAll, named=named, force=force)
+            operation=operation, doAll=doAll, named=named, force=force)
         if shouldReopen:
             res = E5MessageBox.yesNo(
                 None,
@@ -841,7 +836,6 @@
         Private slot used to push the next patch onto the stack.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.PUSH, doAll=False, named=False)
     
     def __hgQueuePushPatchForced(self):
@@ -850,7 +844,6 @@
         of local changes.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.PUSH, doAll=False, named=False, force=True)
     
     def __hgQueuePushAllPatches(self):
@@ -858,7 +851,6 @@
         Private slot used to push all patches onto the stack.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.PUSH, doAll=True, named=False)
     
     def __hgQueuePushAllPatchesForced(self):
@@ -867,7 +859,6 @@
         of local changes.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.PUSH, doAll=True, named=False, force=True)
     
     def __hgQueuePushPatches(self):
@@ -876,7 +867,6 @@
         one is at the top.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.PUSH, doAll=False, named=True)
     
     def __hgQueuePushPatchesForced(self):
@@ -885,7 +875,6 @@
         one is at the top on top of local changes.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.PUSH, doAll=False, named=True, force=True)
     
     def __hgQueuePopPatch(self):
@@ -893,7 +882,6 @@
         Private slot used to pop the current patch off the stack.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.POP, doAll=False, named=False)
     
     def __hgQueuePopPatchForced(self):
@@ -902,7 +890,6 @@
         any local changes to patched files.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.POP, doAll=False, named=False, force=True)
     
     def __hgQueuePopAllPatches(self):
@@ -910,7 +897,6 @@
         Private slot used to pop all patches off the stack.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.POP, doAll=True, named=False)
     
     def __hgQueuePopAllPatchesForced(self):
@@ -919,7 +905,6 @@
         any local changes to patched files.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.POP, doAll=True, named=False, force=True)
     
     def __hgQueuePopPatches(self):
@@ -928,7 +913,6 @@
         one is at the top.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.POP, doAll=False, named=True)
     
     def __hgQueuePopPatchesForced(self):
@@ -937,7 +921,6 @@
         one is at the top forgetting any local changes to patched files.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.POP, doAll=False, named=True, force=True)
     
     def __hgQueueGotoPatch(self):
@@ -946,7 +929,6 @@
         is at the top of the stack.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.GOTO, doAll=False, named=True)
     
     def __hgQueueGotoPatchForced(self):
@@ -955,113 +937,98 @@
         is at the top of the stack overwriting local changes.
         """
         self.__hgQueuePushPopPatches(
-            self.project.getProjectPath(),
             operation=Queues.GOTO, doAll=False, named=True, force=True)
     
     def __hgQueueListPatches(self):
         """
         Private slot used to show a list of applied and unapplied patches.
         """
-        self.vcs.getExtensionObject("mq").hgQueueListPatches(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueListPatches()
     
     def __hgQueueFinishAppliedPatches(self):
         """
         Private slot used to finish all applied patches.
         """
-        self.vcs.getExtensionObject("mq").hgQueueFinishAppliedPatches(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueFinishAppliedPatches()
     
     def __hgQueueRenamePatch(self):
         """
         Private slot used to rename a patch.
         """
-        self.vcs.getExtensionObject("mq").hgQueueRenamePatch(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueRenamePatch()
     
     def __hgQueueDeletePatch(self):
         """
         Private slot used to delete a patch.
         """
-        self.vcs.getExtensionObject("mq").hgQueueDeletePatch(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueDeletePatch()
     
     def __hgQueueFoldUnappliedPatches(self):
         """
         Private slot used to fold patches into the current patch.
         """
-        self.vcs.getExtensionObject("mq").hgQueueFoldUnappliedPatches(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueFoldUnappliedPatches()
     
     def __hgQueueGuardsDefine(self):
         """
         Private slot used to define guards for the current or a named patch.
         """
-        self.vcs.getExtensionObject("mq").hgQueueGuardsDefine(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueGuardsDefine()
     
     def __hgQueueGuardsDropAll(self):
         """
         Private slot used to drop all guards of the current or a named patch.
         """
-        self.vcs.getExtensionObject("mq").hgQueueGuardsDropAll(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueGuardsDropAll()
     
     def __hgQueueGuardsList(self):
         """
         Private slot used to list the guards for the current or a named patch.
         """
-        self.vcs.getExtensionObject("mq").hgQueueGuardsList(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueGuardsList()
     
     def __hgQueueGuardsListAll(self):
         """
         Private slot used to list all guards of all patches.
         """
-        self.vcs.getExtensionObject("mq").hgQueueGuardsListAll(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueGuardsListAll()
     
     def __hgQueueGuardsSetActive(self):
         """
         Private slot used to set the active guards.
         """
-        self.vcs.getExtensionObject("mq").hgQueueGuardsSetActive(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueGuardsSetActive()
     
     def __hgQueueGuardsDeactivate(self):
         """
         Private slot used to deactivate all active guards.
         """
-        self.vcs.getExtensionObject("mq").hgQueueGuardsDeactivate(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueGuardsDeactivate()
     
     def __hgQueueGuardsIdentifyActive(self):
         """
         Private slot used to list all active guards.
         """
-        self.vcs.getExtensionObject("mq").hgQueueGuardsIdentifyActive(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueGuardsIdentifyActive()
     
     def __hgQueueCreateQueue(self):
         """
         Private slot used to create a new queue.
         """
-        self.vcs.getExtensionObject("mq").hgQueueCreateRenameQueue(
-            self.project.getProjectPath(), True)
+        self.vcs.getExtensionObject("mq").hgQueueCreateRenameQueue(True)
     
     def __hgQueueRenameQueue(self):
         """
         Private slot used to rename the active queue.
         """
-        self.vcs.getExtensionObject("mq").hgQueueCreateRenameQueue(
-            self.project.getProjectPath(), False)
+        self.vcs.getExtensionObject("mq").hgQueueCreateRenameQueue(False)
     
     def __hgQueueDeleteQueue(self):
         """
         Private slot used to delete the reference to a queue.
         """
         self.vcs.getExtensionObject("mq").hgQueueDeletePurgeActivateQueue(
-            self.project.getProjectPath(), Queues.QUEUE_DELETE)
+            Queues.QUEUE_DELETE)
     
     def __hgQueuePurgeQueue(self):
         """
@@ -1069,21 +1036,20 @@
         the patch directory.
         """
         self.vcs.getExtensionObject("mq").hgQueueDeletePurgeActivateQueue(
-            self.project.getProjectPath(), Queues.QUEUE_PURGE)
+            Queues.QUEUE_PURGE)
     
     def __hgQueueActivateQueue(self):
         """
         Private slot used to set the active queue.
         """
         self.vcs.getExtensionObject("mq").hgQueueDeletePurgeActivateQueue(
-            self.project.getProjectPath(), Queues.QUEUE_ACTIVATE)
+            Queues.QUEUE_ACTIVATE)
     
     def __hgQueueListQueues(self):
         """
         Private slot used to list available queues.
         """
-        self.vcs.getExtensionObject("mq").hgQueueListQueues(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("mq").hgQueueListQueues()
     
     def __hgQueueInit(self):
         """
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py	Wed Jan 13 17:46:13 2021 +0100
@@ -71,11 +71,10 @@
         if self.queueStatusDialog is not None:
             self.queueStatusDialog.close()
     
-    def __getPatchesList(self, repodir, listType, withSummary=False):
+    def __getPatchesList(self, listType, withSummary=False):
         """
         Private method to get a list of patches of a given type.
         
-        @param repodir directory name of the repository (string)
         @param listType type of patches list to get
             (Queues.APPLIED_LIST, Queues.UNAPPLIED_LIST, Queues.SERIES_LIST)
         @param withSummary flag indicating to get a summary as well (boolean)
@@ -111,11 +110,10 @@
         
         return patchesList
     
-    def __getCurrentPatch(self, repodir):
+    def __getCurrentPatch(self):
         """
         Private method to get the name of the current patch.
         
-        @param repodir directory name of the repository (string)
         @return name of the current patch (string)
         """
         currentPatch = ""
@@ -127,11 +125,10 @@
         
         return currentPatch
     
-    def __getCommitMessage(self, repodir):
+    def __getCommitMessage(self):
         """
         Private method to get the commit message of the current patch.
         
-        @param repodir directory name of the repository (string)
         @return name of the current patch (string)
         """
         message = ""
@@ -143,11 +140,10 @@
         
         return message
     
-    def getGuardsList(self, repodir, allGuards=True):
+    def getGuardsList(self, allGuards=True):
         """
         Public method to get a list of all guards defined.
         
-        @param repodir directory name of the repository (string)
         @param allGuards flag indicating to get all guards (boolean)
         @return sorted list of guards (list of strings)
         """
@@ -169,19 +165,10 @@
         
         return sorted(guardsList)
     
-    def hgQueueNewPatch(self, name):
+    def hgQueueNewPatch(self):
         """
         Public method to create a new named patch.
-        
-        @param name file/directory name (string)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog
         dlg = HgQueuesNewPatchDialog(HgQueuesNewPatchDialog.NEW_MODE)
         if dlg.exec() == QDialog.Accepted:
@@ -208,30 +195,22 @@
             args.append(name)
             
             dia = HgDialog(self.tr('New Patch'), self.vcs)
-            res = dia.startProcess(args, repodir)
+            res = dia.startProcess(args)
             if res:
                 dia.exec()
                 self.vcs.checkVCSStatus()
     
-    def hgQueueRefreshPatch(self, name, editMessage=False):
+    def hgQueueRefreshPatch(self, editMessage=False):
         """
         Public method to refresh the current patch.
         
-        @param name file/directory name (string)
         @param editMessage flag indicating to edit the current
             commit message (boolean)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         args = self.vcs.initCommand("qrefresh")
         
         if editMessage:
-            currentMessage = self.__getCommitMessage(repodir)
+            currentMessage = self.__getCommitMessage()
             from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog
             dlg = HgQueuesNewPatchDialog(HgQueuesNewPatchDialog.REFRESH_MODE,
                                          currentMessage)
@@ -258,7 +237,7 @@
                 return
         
         dia = HgDialog(self.tr('Update Current Patch'), self.vcs)
-        res = dia.startProcess(args, repodir)
+        res = dia.startProcess(args)
         if res:
             dia.exec()
             self.vcs.checkVCSStatus()
@@ -275,25 +254,22 @@
         QApplication.processEvents()
         self.qdiffDialog.start(name, qdiff=True)
     
-    def hgQueueShowHeader(self, name):
+    def hgQueueShowHeader(self):
         """
         Public method to show the commit message of the current patch.
-        
-        @param name file/directory name (string)
         """
         from .HgQueuesHeaderDialog import HgQueuesHeaderDialog
         self.qheaderDialog = HgQueuesHeaderDialog(self.vcs)
         self.qheaderDialog.show()
         QApplication.processEvents()
-        self.qheaderDialog.start(name)
+        self.qheaderDialog.start()
     
-    def hgQueuePushPopPatches(self, name, operation, doAll=False, named=False,
+    def hgQueuePushPopPatches(self, operation, doAll=False, named=False,
                               force=False):
         """
         Public method to push patches onto the stack or pop patches off the
         stack.
         
-        @param name file/directory name (string)
         @param operation operation type to be performed (Queues.POP,
             Queues.PUSH, Queues.GOTO)
         @param doAll flag indicating to push/pop all (boolean)
@@ -303,13 +279,6 @@
         @return flag indicating that the project should be reread (boolean)
         @exception ValueError raised to indicate an invalid operation
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return False
-        
         if operation == Queues.POP:
             args = self.vcs.initCommand("qpop")
             title = self.tr("Pop Patches")
@@ -330,7 +299,7 @@
         if doAll and operation in (Queues.POP, Queues.PUSH):
             args.append("--all")
         elif named or operation == Queues.GOTO:
-            patchnames = self.__getPatchesList(repodir, listType)
+            patchnames = self.__getPatchesList(listType)
             if patchnames:
                 patch, ok = QInputDialog.getItem(
                     None,
@@ -350,63 +319,43 @@
                 return False
         
         dia = HgDialog(title, self.vcs)
-        res = dia.startProcess(args, repodir)
+        res = dia.startProcess(args)
         if res:
             dia.exec()
             res = dia.hasAddOrDelete()
             self.vcs.checkVCSStatus()
         return res
     
-    def hgQueueListPatches(self, name):
+    def hgQueueListPatches(self):
         """
         Public method to show a list of all patches.
-        
-        @param name file/directory name (string)
         """
         from .HgQueuesListDialog import HgQueuesListDialog
         self.queuesListDialog = HgQueuesListDialog(self.vcs)
         self.queuesListDialog.show()
-        self.queuesListDialog.start(name)
+        self.queuesListDialog.start()
     
-    def hgQueueFinishAppliedPatches(self, name):
+    def hgQueueFinishAppliedPatches(self):
         """
         Public method to finish all applied patches.
-        
-        @param name file/directory name (string)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         args = self.vcs.initCommand("qfinish")
         args.append("--applied")
         
         dia = HgDialog(self.tr('Finish Applied Patches'), self.vcs)
-        res = dia.startProcess(args, repodir)
+        res = dia.startProcess(args)
         if res:
             dia.exec()
             self.vcs.checkVCSStatus()
     
-    def hgQueueRenamePatch(self, name):
+    def hgQueueRenamePatch(self):
         """
         Public method to rename the current or a selected patch.
-        
-        @param name file/directory name (string)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         args = self.vcs.initCommand("qrename")
-        patchnames = sorted(self.__getPatchesList(repodir, Queues.SERIES_LIST))
+        patchnames = sorted(self.__getPatchesList(Queues.SERIES_LIST))
         if patchnames:
-            currentPatch = self.__getCurrentPatch(repodir)
+            currentPatch = self.__getCurrentPatch()
             if currentPatch:
                 from .HgQueuesRenamePatchDialog import (
                     HgQueuesRenamePatchDialog
@@ -419,26 +368,16 @@
                     args.append(newName)
                     
                     dia = HgDialog(self.tr("Rename Patch"), self.vcs)
-                    res = dia.startProcess(args, repodir)
+                    res = dia.startProcess(args)
                     if res:
                         dia.exec()
     
-    def hgQueueDeletePatch(self, name):
+    def hgQueueDeletePatch(self):
         """
         Public method to delete a selected unapplied patch.
-        
-        @param name file/directory name (string)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         args = self.vcs.initCommand("qdelete")
-        patchnames = sorted(self.__getPatchesList(repodir,
-                                                  Queues.UNAPPLIED_LIST))
+        patchnames = sorted(self.__getPatchesList(Queues.UNAPPLIED_LIST))
         if patchnames:
             patch, ok = QInputDialog.getItem(
                 None,
@@ -450,7 +389,7 @@
                 args.append(patch)
                 
                 dia = HgDialog(self.tr("Delete Patch"), self.vcs)
-                res = dia.startProcess(args, repodir)
+                res = dia.startProcess(args)
                 if res:
                     dia.exec()
         else:
@@ -459,23 +398,13 @@
                 self.tr("Select Patch"),
                 self.tr("""No patches to select from."""))
     
-    def hgQueueFoldUnappliedPatches(self, name):
+    def hgQueueFoldUnappliedPatches(self):
         """
         Public method to fold patches into the current patch.
-        
-        @param name file/directory name (string)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         args = self.vcs.initCommand("qfold")
         patchnames = sorted(
-            self.__getPatchesList(repodir, Queues.UNAPPLIED_LIST,
-                                  withSummary=True))
+            self.__getPatchesList(Queues.UNAPPLIED_LIST, withSummary=True))
         if patchnames:
             from .HgQueuesFoldDialog import HgQueuesFoldDialog
             dlg = HgQueuesFoldDialog(patchnames)
@@ -488,7 +417,7 @@
                     args.extend(patchesList)
                     
                     dia = HgDialog(self.tr("Fold Patches"), self.vcs)
-                    res = dia.startProcess(args, repodir)
+                    res = dia.startProcess(args)
                     if res:
                         dia.exec()
                 else:
@@ -502,86 +431,55 @@
                 self.tr("Fold Patches"),
                 self.tr("""No patches available to be folded."""))
     
-    def hgQueueGuardsList(self, name):
+    def hgQueueGuardsList(self):
         """
         Public method to list the guards for the current or a named patch.
-        
-        @param name file/directory name (string)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
-        patchnames = sorted(
-            self.__getPatchesList(repodir, Queues.SERIES_LIST))
+        patchnames = sorted(self.__getPatchesList(Queues.SERIES_LIST))
         if patchnames:
             from .HgQueuesListGuardsDialog import HgQueuesListGuardsDialog
             self.queuesListGuardsDialog = HgQueuesListGuardsDialog(
                 self.vcs, patchnames)
             self.queuesListGuardsDialog.show()
-            self.queuesListGuardsDialog.start(name)
+            self.queuesListGuardsDialog.start()
         else:
             E5MessageBox.information(
                 None,
                 self.tr("List Guards"),
                 self.tr("""No patches available to list guards for."""))
     
-    def hgQueueGuardsListAll(self, name):
+    def hgQueueGuardsListAll(self):
         """
         Public method to list all guards of all patches.
-        
-        @param name file/directory name (string)
         """
         from .HgQueuesListAllGuardsDialog import HgQueuesListAllGuardsDialog
         self.queuesListAllGuardsDialog = HgQueuesListAllGuardsDialog(self.vcs)
         self.queuesListAllGuardsDialog.show()
-        self.queuesListAllGuardsDialog.start(name)
+        self.queuesListAllGuardsDialog.start()
     
-    def hgQueueGuardsDefine(self, name):
+    def hgQueueGuardsDefine(self):
         """
         Public method to define guards for the current or a named patch.
-        
-        @param name file/directory name (string)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
-        patchnames = sorted(
-            self.__getPatchesList(repodir, Queues.SERIES_LIST))
+        patchnames = sorted(self.__getPatchesList(Queues.SERIES_LIST))
         if patchnames:
             from .HgQueuesDefineGuardsDialog import HgQueuesDefineGuardsDialog
             self.queuesDefineGuardsDialog = HgQueuesDefineGuardsDialog(
                 self.vcs, self, patchnames)
             self.queuesDefineGuardsDialog.show()
-            self.queuesDefineGuardsDialog.start(name)
+            self.queuesDefineGuardsDialog.start()
         else:
             E5MessageBox.information(
                 None,
                 self.tr("Define Guards"),
                 self.tr("""No patches available to define guards for."""))
     
-    def hgQueueGuardsDropAll(self, name):
+    def hgQueueGuardsDropAll(self):
         """
         Public method to drop all guards of the current or a named patch.
-        
-        @param name file/directory name (string)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         patchnames = sorted(
-            self.__getPatchesList(repodir, Queues.SERIES_LIST))
+            self.__getPatchesList(Queues.SERIES_LIST))
         if patchnames:
             patch, ok = QInputDialog.getItem(
                 None,
@@ -604,22 +502,13 @@
                 self.tr("Drop All Guards"),
                 self.tr("""No patches available to define guards for."""))
     
-    def hgQueueGuardsSetActive(self, name):
+    def hgQueueGuardsSetActive(self):
         """
         Public method to set the active guards.
-        
-        @param name file/directory name (string)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
-        guardsList = self.getGuardsList(repodir)
+        guardsList = self.getGuardsList()
         if guardsList:
-            activeGuardsList = self.getGuardsList(repodir, allGuards=False)
+            activeGuardsList = self.getGuardsList(allGuards=False)
             from .HgQueuesGuardsSelectionDialog import (
                 HgQueuesGuardsSelectionDialog
             )
@@ -632,7 +521,7 @@
                     args.extend(guards)
                     
                     dia = HgDialog(self.tr('Set Active Guards'), self.vcs)
-                    res = dia.startProcess(args, repodir)
+                    res = dia.startProcess(args)
                     if res:
                         dia.exec()
         else:
@@ -642,41 +531,23 @@
                 self.tr("""No guards available to select from."""))
             return
     
-    def hgQueueGuardsDeactivate(self, name):
+    def hgQueueGuardsDeactivate(self):
         """
         Public method to deactivate all active guards.
-        
-        @param name file/directory name (string)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         args = self.vcs.initCommand("qselect")
         args.append("--none")
         
         dia = HgDialog(self.tr('Deactivate Guards'), self.vcs)
-        res = dia.startProcess(args, repodir)
+        res = dia.startProcess(args)
         if res:
             dia.exec()
     
-    def hgQueueGuardsIdentifyActive(self, name):
+    def hgQueueGuardsIdentifyActive(self):
         """
         Public method to list all active guards.
-        
-        @param name file/directory name (string)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
-        guardsList = self.getGuardsList(repodir, allGuards=False)
+        guardsList = self.getGuardsList(allGuards=False)
         if guardsList:
             from .HgQueuesGuardsSelectionDialog import (
                 HgQueuesGuardsSelectionDialog
@@ -684,20 +555,12 @@
             dlg = HgQueuesGuardsSelectionDialog(guardsList, listOnly=True)
             dlg.exec()
     
-    def hgQueueCreateRenameQueue(self, name, isCreate):
+    def hgQueueCreateRenameQueue(self, isCreate):
         """
         Public method to create a new queue or rename the active queue.
         
-        @param name file/directory name (string)
         @param isCreate flag indicating to create a new queue (boolean)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         if isCreate:
             title = self.tr("Create New Queue")
         else:
@@ -707,7 +570,7 @@
         )
         dlg = HgQueuesQueueManagementDialog(
             HgQueuesQueueManagementDialog.NAME_INPUT,
-            title, False, repodir, self.vcs)
+            title, False, self.vcs)
         if dlg.exec() == QDialog.Accepted:
             queueName = dlg.getData()
             if queueName:
@@ -739,23 +602,15 @@
                     ):
                         self.queuesListQueuesDialog.refresh()
     
-    def hgQueueDeletePurgeActivateQueue(self, name, operation):
+    def hgQueueDeletePurgeActivateQueue(self, operation):
         """
         Public method to delete the reference to a queue and optionally
         remove the patch directory or set the active queue.
         
-        @param name file/directory name (string)
         @param operation operation to be performed (Queues.QUEUE_DELETE,
             Queues.QUEUE_PURGE, Queues.QUEUE_ACTIVATE)
         @exception ValueError raised to indicate an invalid operation
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         if operation == Queues.QUEUE_PURGE:
             title = self.tr("Purge Queue")
         elif operation == Queues.QUEUE_DELETE:
@@ -770,7 +625,7 @@
         )
         dlg = HgQueuesQueueManagementDialog(
             HgQueuesQueueManagementDialog.QUEUE_INPUT,
-            title, True, repodir, self.vcs)
+            title, True, self.vcs)
         if dlg.exec() == QDialog.Accepted:
             queueName = dlg.getData()
             if queueName:
@@ -803,26 +658,17 @@
                     ):
                         self.queuesListQueuesDialog.refresh()
     
-    def hgQueueListQueues(self, name):
+    def hgQueueListQueues(self):
         """
         Public method to list available queues.
-        
-        @param name file/directory name (string)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(name)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         from .HgQueuesQueueManagementDialog import (
             HgQueuesQueueManagementDialog
         )
         self.queuesListQueuesDialog = HgQueuesQueueManagementDialog(
             HgQueuesQueueManagementDialog.NO_INPUT,
             self.tr("Available Queues"),
-            False, repodir, self.vcs)
+            False, self.vcs)
         self.queuesListQueuesDialog.show()
     
     def hgQueueInit(self, name):
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/ProjectHelper.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/ProjectHelper.py	Wed Jan 13 17:46:13 2021 +0100
@@ -103,8 +103,7 @@
         """
         Private slot used to rebase changesets to another branch.
         """
-        shouldReopen = self.vcs.getExtensionObject("rebase").hgRebase(
-            self.project.getProjectPath())
+        shouldReopen = self.vcs.getExtensionObject("rebase").hgRebase()
         if shouldReopen:
             res = E5MessageBox.yesNo(
                 None,
@@ -118,8 +117,7 @@
         """
         Private slot used to continue the last rebase session after repair.
         """
-        shouldReopen = self.vcs.getExtensionObject("rebase").hgRebaseContinue(
-            self.project.getProjectPath())
+        shouldReopen = self.vcs.getExtensionObject("rebase").hgRebaseContinue()
         if shouldReopen:
             res = E5MessageBox.yesNo(
                 None,
@@ -133,8 +131,7 @@
         """
         Private slot used to abort the last rebase session.
         """
-        shouldReopen = self.vcs.getExtensionObject("rebase").hgRebaseAbort(
-            self.project.getProjectPath())
+        shouldReopen = self.vcs.getExtensionObject("rebase").hgRebaseAbort()
         if shouldReopen:
             res = E5MessageBox.yesNo(
                 None,
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/rebase.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/rebase.py	Wed Jan 13 17:46:13 2021 +0100
@@ -7,8 +7,6 @@
 Module implementing the rebase extension interface.
 """
 
-import os
-
 from PyQt5.QtWidgets import QDialog
 
 from ..HgExtension import HgExtension
@@ -27,20 +25,12 @@
         """
         super(Rebase, self).__init__(vcs)
     
-    def hgRebase(self, path):
+    def hgRebase(self):
         """
         Public method to rebase changesets to a different branch.
         
-        @param path directory name of the project (string)
         @return flag indicating that the project should be reread (boolean)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(path)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return False
-        
         res = False
         from .HgRebaseDialog import HgRebaseDialog
         dlg = HgRebaseDialog(self.vcs.hgGetTagsList(),
@@ -76,59 +66,43 @@
             args.append("--verbose")
             
             dia = HgDialog(self.tr('Rebase Changesets'), self.vcs)
-            res = dia.startProcess(args, repodir)
+            res = dia.startProcess(args)
             if res:
                 dia.exec()
                 res = dia.hasAddOrDelete()
                 self.vcs.checkVCSStatus()
         return res
     
-    def hgRebaseContinue(self, path):
+    def hgRebaseContinue(self):
         """
         Public method to continue rebasing changesets from another branch.
         
-        @param path directory name of the project (string)
         @return flag indicating that the project should be reread (boolean)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(path)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return False
-        
         args = self.vcs.initCommand("rebase")
         args.append("--continue")
         args.append("--verbose")
         
         dia = HgDialog(self.tr('Rebase Changesets (Continue)'), self.vcs)
-        res = dia.startProcess(args, repodir)
+        res = dia.startProcess(args)
         if res:
             dia.exec()
             res = dia.hasAddOrDelete()
             self.vcs.checkVCSStatus()
         return res
     
-    def hgRebaseAbort(self, path):
+    def hgRebaseAbort(self):
         """
         Public method to abort rebasing changesets from another branch.
         
-        @param path directory name of the project (string)
         @return flag indicating that the project should be reread (boolean)
         """
-        # find the root of the repo
-        repodir = self.vcs.splitPath(path)[0]
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return False
-        
         args = self.vcs.initCommand("rebase")
         args.append("--abort")
         args.append("--verbose")
         
         dia = HgDialog(self.tr('Rebase Changesets (Abort)'), self.vcs)
-        res = dia.startProcess(args, repodir)
+        res = dia.startProcess(args)
         if res:
             dia.exec()
             res = dia.hasAddOrDelete()
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveBrowserDialog.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveBrowserDialog.py	Wed Jan 13 17:46:13 2021 +0100
@@ -7,8 +7,6 @@
 Module implementing Mercurial shelve browser dialog.
 """
 
-import os
-
 from PyQt5.QtCore import pyqtSlot, Qt, QPoint
 from PyQt5.QtWidgets import (
     QWidget, QDialogButtonBox, QTreeWidgetItem, QAbstractButton, QMenu,
@@ -146,24 +144,13 @@
             self.__processBuffer()
         self.__finish()
     
-    def start(self, projectDir):
+    def start(self):
         """
         Public slot to start the hg shelve command.
-        
-        @param projectDir name of the project directory (string)
         """
         self.errorGroup.hide()
         QApplication.processEvents()
         
-        self.__projectDir = projectDir
-        
-        # find the root of the repo
-        self.repodir = self.__projectDir
-        while not os.path.isdir(os.path.join(self.repodir, self.vcs.adminDir)):
-            self.repodir = os.path.dirname(self.repodir)
-            if os.path.splitdrive(self.repodir)[1] == os.sep:
-                return
-        
         self.activateWindow()
         self.raise_()
         
@@ -311,7 +298,7 @@
         
         self.refreshButton.setEnabled(False)
         
-        self.start(self.__projectDir)
+        self.start()
     
     def __unshelve(self):
         """
@@ -320,8 +307,7 @@
         itm = self.shelveList.selectedItems()[0]
         if itm is not None:
             name = itm.text(self.NameColumn)
-            self.vcs.getExtensionObject("shelve").hgUnshelve(
-                self.__projectDir, shelveName=name)
+            self.vcs.getExtensionObject("shelve").hgUnshelve(shelveName=name)
             self.on_refreshButton_clicked()
     
     def __deleteShelves(self):
@@ -333,13 +319,12 @@
             shelveNames.append(itm.text(self.NameColumn))
         if shelveNames:
             self.vcs.getExtensionObject("shelve").hgDeleteShelves(
-                self.__projectDir, shelveNames=shelveNames)
+                shelveNames=shelveNames)
             self.on_refreshButton_clicked()
     
     def __cleanupShelves(self):
         """
         Private slot to delete all shelves.
         """
-        self.vcs.getExtensionObject("shelve").hgCleanupShelves(
-            self.__projectDir)
+        self.vcs.getExtensionObject("shelve").hgCleanupShelves()
         self.on_refreshButton_clicked()
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/ProjectHelper.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/ProjectHelper.py	Wed Jan 13 17:46:13 2021 +0100
@@ -190,23 +190,20 @@
         """
         Private slot to show the shelve browser dialog.
         """
-        self.vcs.getExtensionObject("shelve").hgShelveBrowser(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("shelve").hgShelveBrowser()
     
     def __hgUnshelve(self):
         """
         Private slot used to restore a shelved change.
         """
-        shouldReopen = self.vcs.getExtensionObject("shelve").hgUnshelve(
-            self.project.getProjectPath())
+        shouldReopen = self.vcs.getExtensionObject("shelve").hgUnshelve()
         self.__reopenProject(shouldReopen, self.tr("Unshelve"))
     
     def __hgUnshelveAbort(self):
         """
         Private slot used to abort an ongoing restore operation.
         """
-        shouldReopen = self.vcs.getExtensionObject("shelve").hgUnshelveAbort(
-            self.project.getProjectPath())
+        shouldReopen = self.vcs.getExtensionObject("shelve").hgUnshelveAbort()
         self.__reopenProject(shouldReopen, self.tr("Abort Unshelve"))
     
     def __hgUnshelveContinue(self):
@@ -214,8 +211,7 @@
         Private slot used to continue an ongoing restore operation.
         """
         shouldReopen = (
-            self.vcs.getExtensionObject("shelve").hgUnshelveContinue(
-                self.project.getProjectPath())
+            self.vcs.getExtensionObject("shelve").hgUnshelveContinue()
         )
         self.__reopenProject(shouldReopen, self.tr("Continue Unshelve"))
     
@@ -223,12 +219,10 @@
         """
         Private slot to delete selected shelves.
         """
-        self.vcs.getExtensionObject("shelve").hgDeleteShelves(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("shelve").hgDeleteShelves()
     
     def __hgCleanupShelves(self):
         """
         Private slot to delete all shelves.
         """
-        self.vcs.getExtensionObject("shelve").hgCleanupShelves(
-            self.project.getProjectPath())
+        self.vcs.getExtensionObject("shelve").hgCleanupShelves()
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/shelve.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/shelve.py	Wed Jan 13 17:46:13 2021 +0100
@@ -7,8 +7,6 @@
 Module implementing the shelve extension interface.
 """
 
-import os
-
 from PyQt5.QtWidgets import QDialog
 
 from E5Gui import E5MessageBox
@@ -40,11 +38,10 @@
         if self.__shelveBrowserDialog is not None:
             self.__shelveBrowserDialog.close()
     
-    def __hgGetShelveNamesList(self, repodir):
+    def __hgGetShelveNamesList(self):
         """
         Private method to get the list of shelved changes.
         
-        @param repodir directory name of the repository (string)
         @return list of shelved changes (list of string)
         """
         args = self.vcs.initCommand("shelve")
@@ -68,18 +65,6 @@
             or file names (list of string)
         @return flag indicating that the project should be reread (boolean)
         """
-        if isinstance(name, list):
-            dname = self.vcs.splitPathList(name)[0]
-        else:
-            dname = self.vcs.splitPath(name)[0]
-        
-        # find the root of the repo
-        repodir = dname
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return False
-        
         res = False
         from .HgShelveDataDialog import HgShelveDataDialog
         dlg = HgShelveDataDialog(self.vcs.version)
@@ -108,44 +93,34 @@
                 args.append(name)
             
             dia = HgDialog(self.tr('Shelve current changes'), self.vcs)
-            res = dia.startProcess(args, repodir)
+            res = dia.startProcess(args)
             if res:
                 dia.exec()
                 res = dia.hasAddOrDelete()
                 self.vcs.checkVCSStatus()
         return res
     
-    def hgShelveBrowser(self, projectDir):
+    def hgShelveBrowser(self):
         """
         Public method to show the shelve browser dialog.
-        
-        @param projectDir name of the project directory (string)
         """
         if self.__shelveBrowserDialog is None:
             from .HgShelveBrowserDialog import HgShelveBrowserDialog
             self.__shelveBrowserDialog = HgShelveBrowserDialog(
                 self.vcs)
         self.__shelveBrowserDialog.show()
-        self.__shelveBrowserDialog.start(projectDir)
+        self.__shelveBrowserDialog.start()
     
-    def hgUnshelve(self, name, shelveName=""):
+    def hgUnshelve(self, shelveName=""):
         """
         Public method to restore shelved changes to the project directory.
         
-        @param name name of the project directory (string)
         @param shelveName name of the shelve to restore (string)
         @return flag indicating that the project should be reread (boolean)
         """
-        # find the root of the repo
-        repodir = name
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return False
-        
         res = False
         from .HgUnshelveDataDialog import HgUnshelveDataDialog
-        dlg = HgUnshelveDataDialog(self.__hgGetShelveNamesList(repodir),
+        dlg = HgUnshelveDataDialog(self.__hgGetShelveNamesList(),
                                    shelveName=shelveName)
         if dlg.exec() == QDialog.Accepted:
             shelveName, keep = dlg.getData()
@@ -158,84 +133,60 @@
                 args.append(shelveName)
             
             dia = HgDialog(self.tr('Restore shelved changes'), self.vcs)
-            res = dia.startProcess(args, repodir)
+            res = dia.startProcess(args)
             if res:
                 dia.exec()
                 res = dia.hasAddOrDelete()
                 self.vcs.checkVCSStatus()
         return res
     
-    def hgUnshelveAbort(self, name):
+    def hgUnshelveAbort(self):
         """
         Public method to abort the ongoing restore operation.
         
-        @param name name of the project directory (string)
         @return flag indicating that the project should be reread (boolean)
         """
-        # find the root of the repo
-        repodir = name
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return False
-        
         args = self.vcs.initCommand("unshelve")
         args.append("--abort")
         
         dia = HgDialog(self.tr('Abort restore operation'), self.vcs)
-        res = dia.startProcess(args, repodir)
+        res = dia.startProcess(args)
         if res:
             dia.exec()
             res = dia.hasAddOrDelete()
             self.vcs.checkVCSStatus()
         return res
     
-    def hgUnshelveContinue(self, name):
+    def hgUnshelveContinue(self):
         """
         Public method to continue the ongoing restore operation.
         
-        @param name name of the project directory (string)
         @return flag indicating that the project should be reread (boolean)
         """
-        # find the root of the repo
-        repodir = name
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return False
-        
         args = self.vcs.initCommand("unshelve")
         if self.__unshelveKeep:
             args.append("--keep")
         args.append("--continue")
         
         dia = HgDialog(self.tr('Continue restore operation'), self.vcs)
-        res = dia.startProcess(args, repodir)
+        res = dia.startProcess(args)
         if res:
             dia.exec()
             res = dia.hasAddOrDelete()
             self.vcs.checkVCSStatus()
         return res
     
-    def hgDeleteShelves(self, name, shelveNames=None):
+    def hgDeleteShelves(self, shelveNames=None):
         """
         Public method to delete named shelves.
         
-        @param name name of the project directory (string)
         @param shelveNames name of shelves to delete (list of string)
         """
-        # find the root of the repo
-        repodir = name
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         if not shelveNames:
             from .HgShelvesSelectionDialog import HgShelvesSelectionDialog
             dlg = HgShelvesSelectionDialog(
                 self.tr("Select the shelves to be deleted:"),
-                self.__hgGetShelveNamesList(repodir))
+                self.__hgGetShelveNamesList())
             if dlg.exec() == QDialog.Accepted:
                 shelveNames = dlg.getSelectedShelves()
             else:
@@ -255,23 +206,14 @@
             args.extend(shelveNames)
             
             dia = HgDialog(self.tr('Delete shelves'), self.vcs)
-            res = dia.startProcess(args, repodir)
+            res = dia.startProcess(args)
             if res:
                 dia.exec()
     
-    def hgCleanupShelves(self, name):
+    def hgCleanupShelves(self):
         """
         Public method to delete all shelves.
-        
-        @param name name of the project directory (string)
         """
-        # find the root of the repo
-        repodir = name
-        while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
         res = E5MessageBox.yesNo(
             None,
             self.tr("Delete all shelves"),
@@ -281,6 +223,6 @@
             args.append("--cleanup")
             
             dia = HgDialog(self.tr('Delete all shelves'), self.vcs)
-            res = dia.startProcess(args, repodir)
+            res = dia.startProcess(args)
             if res:
                 dia.exec()
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/hg.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/hg.py	Wed Jan 13 17:46:13 2021 +0100
@@ -330,7 +330,7 @@
                 dia = HgDialog(
                     self.tr('Initial commit to Mercurial repository'),
                     self)
-                res = dia.startProcess(args, projectDir)
+                res = dia.startProcess(args)
                 if res:
                     dia.exec()
                 status = dia.normalExit()
@@ -1594,6 +1594,9 @@
         @param isFile flag indicating log for a file is to be shown
             (boolean)
         """
+        if name == self.__repoDir:
+            name = None
+        
         if self.logBrowser is None:
             from .HgLogBrowserDialog import HgLogBrowserDialog
             self.logBrowser = HgLogBrowserDialog(self)
@@ -1895,26 +1898,24 @@
         dlg = HgUserConfigDialog(version=self.version)
         dlg.exec()
     
-    def hgEditConfig(self, name, withLargefiles=True, largefilesData=None):
+    def hgEditConfig(self, repoName=None,
+                     withLargefiles=True, largefilesData=None):
         """
         Public method used to edit the repository configuration file.
         
-        @param name file/directory name (string)
+        @param repoName directory name containing the repository
+        @type str
         @param withLargefiles flag indicating to configure the largefiles
-            section (boolean)
+            section
+        @type bool
         @param largefilesData dictionary with data for the largefiles
-            section of the data dialog (dict)
+            section of the data dialog
+        @type dict
         """
-        dname, fname = self.splitPath(name)
+        if repoName is None:
+            repoName = self.__repoDir
         
-        # find the root of the repo
-        repodir = dname
-        while not os.path.isdir(os.path.join(repodir, self.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
-        cfgFile = os.path.join(repodir, self.adminDir, "hgrc")
+        cfgFile = os.path.join(repoName, self.adminDir, "hgrc")
         if not os.path.exists(cfgFile):
             # open dialog to enter the initial data
             withLargefiles = (self.isExtensionActive("largefiles") and
@@ -1950,7 +1951,7 @@
                                 cfg.write("patterns =\n")
                                 cfg.write("  {0}\n".format(
                                     "\n  ".join(lfPattern)))
-                self.__monitorRepoIniFile(repodir)
+                self.__monitorRepoIniFile(repoName)
                 self.__iniFileChanged(cfgFile)
             except OSError:
                 pass
@@ -2606,14 +2607,7 @@
         """
         Public method to delete all backup bundles in the backup area.
         """
-        # find the root of the repo
-        repodir = self.__projectHelper.getProject().getProjectPath()
-        while not os.path.isdir(os.path.join(repodir, self.adminDir)):
-            repodir = os.path.dirname(repodir)
-            if os.path.splitdrive(repodir)[1] == os.sep:
-                return
-        
-        backupdir = os.path.join(repodir, self.adminDir, "strip-backup")
+        backupdir = os.path.join(self.__repodir, self.adminDir, "strip-backup")
         yes = E5MessageBox.yesNo(
             self.__ui,
             self.tr("Delete All Backups"),

eric ide

mercurial