eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/histedit.py

branch
maintenance
changeset 8043
0acf98cd089a
parent 7924
8a96736d465e
parent 7971
ff2971513d6d
child 8176
31965986ecd1
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/histedit.py	Sun Jan 17 13:53:08 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/histedit.py	Mon Feb 01 10:38:16 2021 +0100
@@ -29,29 +29,20 @@
         """
         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
-        @keyparam rev revision to start histedit at
+        @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(repodir),
-                                     self.vcs.hgGetBranchesList(repodir),
-                                     self.vcs.hgGetBookmarksList(repodir),
+        dlg = HgHisteditConfigDialog(self.vcs.hgGetTagsList(),
+                                     self.vcs.hgGetBranchesList(),
+                                     self.vcs.hgGetBookmarksList(),
                                      rev)
         if dlg.exec() == QDialog.Accepted:
             rev, force, keep = dlg.getData()
@@ -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()

eric ide

mercurial