diff -r c4ee8a81584c -r ff2971513d6d eric6/Plugins/VcsPlugins/vcsMercurial/hg.py --- 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"),