diff -r c4ee8a81584c -r ff2971513d6d eric6/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/rebase.py --- 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()