--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/hg.py Fri Oct 25 09:47:48 2024 +0200 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/hg.py Fri Oct 25 17:58:59 2024 +0200 @@ -153,15 +153,15 @@ # instantiate the extensions self.__extensions = { - "mq": Queues(self), - "purge": Purge(self), - "gpg": Gpg(self), - "rebase": Rebase(self), - "shelve": Shelve(self), - "largefiles": Largefiles(self), - "strip": Strip(self), - "histedit": Histedit(self), - "closehead": Closehead(self), + "mq": Queues(self, ui=self.__ui), + "purge": Purge(self, ui=self.__ui), + "gpg": Gpg(self, ui=self.__ui), + "rebase": Rebase(self, ui=self.__ui), + "shelve": Shelve(self, ui=self.__ui), + "largefiles": Largefiles(self, ui=self.__ui), + "strip": Strip(self, ui=self.__ui), + "histedit": Histedit(self, ui=self.__ui), + "closehead": Closehead(self, ui=self.__ui), } def getPlugin(self): @@ -331,7 +331,9 @@ args = self.initCommand("init") args.append(projectDir) - dia = HgDialog(self.tr("Creating Mercurial repository"), self) + dia = HgDialog( + self.tr("Creating Mercurial repository"), hg=self, parent=self.__ui + ) res = dia.startProcess(args) if res: dia.exec() @@ -350,7 +352,11 @@ args.append("--addremove") args.append("--message") args.append(msg) - dia = HgDialog(self.tr("Initial commit to Mercurial repository"), self) + dia = HgDialog( + self.tr("Initial commit to Mercurial repository"), + hg=self, + parent=self.__ui, + ) res = dia.startProcess(args) if res: dia.exec() @@ -392,7 +398,11 @@ _out, err = self.__client.runcommand(args) return err == "" else: - dia = HgDialog(self.tr("Cloning project from a Mercurial repository"), self) + dia = HgDialog( + self.tr("Cloning project from a Mercurial repository"), + hg=self, + parent=self.__ui, + ) res = dia.startProcess(args) if res: dia.exec() @@ -563,7 +573,11 @@ else: args.append(name) - dia = HgDialog(self.tr("Committing changes to Mercurial repository"), self) + dia = HgDialog( + self.tr("Committing changes to Mercurial repository"), + hg=self, + parent=self.__ui, + ) res = dia.startProcess(args) if res: dia.exec() @@ -658,7 +672,11 @@ _out, err = self.__client.runcommand(args) res = False else: - dia = HgDialog(self.tr("Synchronizing with the Mercurial repository"), self) + dia = HgDialog( + self.tr("Synchronizing with the Mercurial repository"), + hg=self, + parent=self.__ui, + ) res = dia.startProcess(args) if res: dia.exec() @@ -689,7 +707,9 @@ _out, err = self.__client.runcommand(args) else: dia = HgDialog( - self.tr("Adding files/directories to the Mercurial repository"), self + self.tr("Adding files/directories to the Mercurial repository"), + hg=self, + parent=self.__ui, ) res = dia.startProcess(args) if res: @@ -749,7 +769,8 @@ else: dia = HgDialog( self.tr("Removing files/directories from the Mercurial repository"), - self, + hg=self, + parent=self.__ui, ) res = dia.startProcess(args) if res: @@ -784,7 +805,7 @@ force = True accepted = True else: - dlg = HgCopyDialog(name, None, True) + dlg = HgCopyDialog(name, parent=self.__ui, move=True) accepted = dlg.exec() == QDialog.DialogCode.Accepted if accepted: target, force = dlg.getData() @@ -801,7 +822,9 @@ _out, err = self.__client.runcommand(args) res = err == "" else: - dia = HgDialog(self.tr("Renaming {0}").format(name), self) + dia = HgDialog( + self.tr("Renaming {0}").format(name), hg=self, parent=self.__ui + ) res = dia.startProcess(args) if res: dia.exec() @@ -901,7 +924,9 @@ """ from .HgTagDialog import HgTagDialog, HgTagOperation - dlg = HgTagDialog(self.hgGetTagsList(withType=True), revision, tagName) + dlg = HgTagDialog( + self.hgGetTagsList(withType=True), revision, tagName, parent=self.__ui + ) if dlg.exec() == QDialog.DialogCode.Accepted: tag, revision, tagOp, force = dlg.getParameters() else: @@ -932,7 +957,9 @@ args.append("Removed {1}tag <{0}>.".format(tag, msgPart)) args.append(tag) - dia = HgDialog(self.tr("Tagging in the Mercurial repository"), self) + dia = HgDialog( + self.tr("Tagging in the Mercurial repository"), hg=self, parent=self.__ui + ) res = dia.startProcess(args) if res: dia.exec() @@ -985,7 +1012,7 @@ ), ) if yes: - dia = HgDialog(self.tr("Reverting changes"), self) + dia = HgDialog(self.tr("Reverting changes"), hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -1012,6 +1039,7 @@ self.hgGetTagsList(), self.hgGetBranchesList(), self.hgGetBookmarksList(), + parent=self.__ui, ) if dlg.exec() == QDialog.DialogCode.Accepted: rev, force = dlg.getParameters() @@ -1030,7 +1058,7 @@ args.append("--rev") args.append(rev) - dia = HgDialog(self.tr("Merging"), self) + dia = HgDialog(self.tr("Merging"), hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -1073,7 +1101,9 @@ self.tr("""Do you really want to re-merge the project?"""), ) if yes: - dia = HgDialog(self.tr("Re-Merging").format(name), self) + dia = HgDialog( + self.tr("Re-Merging").format(name), hg=self, parent=self.__ui + ) res = dia.startProcess(args) if res: dia.exec() @@ -1096,6 +1126,7 @@ self.hgGetBranchesList(), bookmarksList=self.hgGetBookmarksList(), noneLabel=self.tr("Current branch tip"), + parent=self.__ui, ) if dlg.exec() == QDialog.DialogCode.Accepted: rev = dlg.getRevision() @@ -1263,7 +1294,7 @@ """ from .HgCommandDialog import HgCommandDialog - dlg = HgCommandDialog(self.commandHistory, name) + dlg = HgCommandDialog(self.commandHistory, name, parent=self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: command = dlg.getData() commandList = Utilities.parseOptionString(command) @@ -1277,7 +1308,7 @@ args = [] self.addArguments(args, commandList) - dia = HgDialog(self.tr("Mercurial command"), self) + dia = HgDialog(self.tr("Mercurial command"), hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -1444,7 +1475,7 @@ """ from .HgCopyDialog import HgCopyDialog - dlg = HgCopyDialog(name) + dlg = HgCopyDialog(name, parent=self.__ui) res = False if dlg.exec() == QDialog.DialogCode.Accepted: target, force = dlg.getData() @@ -1454,7 +1485,9 @@ args.append(name) args.append(target) - dia = HgDialog(self.tr("Copying {0}").format(name), self) + dia = HgDialog( + self.tr("Copying {0}").format(name), hg=self, parent=self.__ui + ) res = dia.startProcess(args) if res: dia.exec() @@ -1626,6 +1659,7 @@ self.hgGetTagsList(), self.hgGetBranchesList(), bookmarksList=self.hgGetBookmarksList(), + parent=self.__ui, ) if dlg.exec() == QDialog.DialogCode.Accepted: revisions = dlg.getRevisions() @@ -1683,6 +1717,7 @@ self.hgGetTagsList(), self.hgGetBranchesList(), bookmarksList=self.hgGetBookmarksList(), + parent=self.__ui, ) if dlg.exec() == QDialog.DialogCode.Accepted: rev1, rev2 = dlg.getRevisions() @@ -1810,7 +1845,7 @@ args.append("--rev") args.append(rev) - dia = HgDialog(title, self) + dia = HgDialog(title, hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -1842,7 +1877,11 @@ args.append("--rev") args.append(rev) - dia = HgDialog(self.tr("Pushing to a remote Mercurial repository"), self) + dia = HgDialog( + self.tr("Pushing to a remote Mercurial repository"), + hg=self, + parent=self.__ui, + ) res = dia.startProcess(args) if res: dia.exec() @@ -1945,7 +1984,7 @@ ).format(author, cdate, ctime) ) - dlg = VcsRepositoryInfoDialog(None, "\n".join(info)) + dlg = VcsRepositoryInfoDialog(self.__ui, "\n".join(info)) dlg.exec() def hgConflicts(self): @@ -1986,7 +2025,7 @@ if unresolve else self.tr("Marking as 'resolved'") ) - dia = HgDialog(title, self) + dia = HgDialog(title, hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -2006,7 +2045,7 @@ args = self.initCommand("update") args.append("--clean") - dia = HgDialog(self.tr("Aborting uncommitted merge"), self) + dia = HgDialog(self.tr("Aborting uncommitted merge"), hg=self, parent=self.__ui) res = dia.startProcess(args, showArgs=False) if res: dia.exec() @@ -2020,7 +2059,7 @@ """ from .HgBranchInputDialog import HgBranchInputDialog - dlg = HgBranchInputDialog(self.hgGetBranchesList()) + dlg = HgBranchInputDialog(self.hgGetBranchesList(), parent=self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: name, commit, force = dlg.getData() name = name.strip().replace(" ", "_") @@ -2029,7 +2068,11 @@ args.append("--force") args.append(name) - dia = HgDialog(self.tr("Creating branch in the Mercurial repository"), self) + dia = HgDialog( + self.tr("Creating branch in the Mercurial repository"), + hg=self, + parent=self.__ui, + ) res = dia.startProcess(args) if res: dia.exec() @@ -2046,7 +2089,7 @@ """ args = self.initCommand("branch") - dia = HgDialog(self.tr("Showing current branch"), self) + dia = HgDialog(self.tr("Showing current branch"), hg=self, parent=self.__ui) res = dia.startProcess(args, showArgs=False) if res: dia.exec() @@ -2070,7 +2113,7 @@ """ from .HgUserConfigDialog import HgUserConfigDialog - dlg = HgUserConfigDialog(version=self.version) + dlg = HgUserConfigDialog(version=self.version, parent=self.__ui) dlg.exec() def hgEditConfig(self, repoName=None, withLargefiles=True, largefilesData=None): @@ -2096,7 +2139,9 @@ # open dialog to enter the initial data withLargefiles = self.isExtensionActive("largefiles") and withLargefiles dlg = HgRepoConfigDataDialog( - withLargefiles=withLargefiles, largefilesData=largefilesData + withLargefiles=withLargefiles, + largefilesData=largefilesData, + parent=self.__ui, ) if dlg.exec() == QDialog.DialogCode.Accepted: createContents = True @@ -2133,7 +2178,9 @@ args = self.initCommand("verify") dia = HgDialog( - self.tr("Verifying the integrity of the Mercurial repository"), self + self.tr("Verifying the integrity of the Mercurial repository"), + hg=self, + parent=self.__ui, ) res = dia.startProcess(args) if res: @@ -2146,7 +2193,11 @@ args = self.initCommand("showconfig") args.append("--untrusted") - dia = HgDialog(self.tr("Showing the combined configuration settings"), self) + dia = HgDialog( + self.tr("Showing the combined configuration settings"), + hg=self, + parent=self.__ui, + ) res = dia.startProcess(args, showArgs=False) if res: dia.exec() @@ -2157,7 +2208,11 @@ """ args = self.initCommand("paths") - dia = HgDialog(self.tr("Showing aliases for remote repositories"), self) + dia = HgDialog( + self.tr("Showing aliases for remote repositories"), + hg=self, + parent=self.__ui, + ) res = dia.startProcess(args, showArgs=False) if res: dia.exec() @@ -2168,7 +2223,11 @@ """ args = self.initCommand("recover") - dia = HgDialog(self.tr("Recovering from interrupted transaction"), self) + dia = HgDialog( + self.tr("Recovering from interrupted transaction"), + hg=self, + parent=self.__ui, + ) res = dia.startProcess(args, showArgs=False) if res: dia.exec() @@ -2179,7 +2238,9 @@ """ args = self.initCommand("identify") - dia = HgDialog(self.tr("Identifying project directory"), self) + dia = HgDialog( + self.tr("Identifying project directory"), hg=self, parent=self.__ui + ) res = dia.startProcess(args, showArgs=False) if res: dia.exec() @@ -2266,6 +2327,7 @@ self.hgGetBranchesList(), self.hgGetBookmarksList(), version=self.version, + parent=self.__ui, ) if dlg.exec() != QDialog.DialogCode.Accepted: return @@ -2326,7 +2388,7 @@ args.append(compression) args.append(str(fpath)) - dia = HgDialog(self.tr("Create changegroup"), self) + dia = HgDialog(self.tr("Create changegroup"), hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -2388,7 +2450,7 @@ args.append("--verbose") args.extend(files) - dia = HgDialog(self.tr("Apply changegroups"), self) + dia = HgDialog(self.tr("Apply changegroups"), hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -2419,6 +2481,7 @@ self.hgGetTagsList(), self.hgGetBranchesList(), bookmarksList=self.hgGetBookmarksList(), + parent=self.__ui, ) if dlg.exec() == QDialog.DialogCode.Accepted: rev = dlg.getRevision() @@ -2430,7 +2493,11 @@ if rev: args.append(rev) - dia = HgDialog(self.tr("Mercurial Bisect ({0})").format(subcommand), self) + dia = HgDialog( + self.tr("Mercurial Bisect ({0})").format(subcommand), + hg=self, + parent=self.__ui, + ) res = dia.startProcess(args) if res: dia.exec() @@ -2453,7 +2520,9 @@ args.append(name) dia = HgDialog( - self.tr("Removing files from the Mercurial repository only"), self + self.tr("Removing files from the Mercurial repository only"), + hg=self, + parent=self.__ui, ) res = dia.startProcess(args) if res: @@ -2471,7 +2540,10 @@ from .HgBackoutDialog import HgBackoutDialog dlg = HgBackoutDialog( - self.hgGetTagsList(), self.hgGetBranchesList(), self.hgGetBookmarksList() + self.hgGetTagsList(), + self.hgGetBranchesList(), + self.hgGetBookmarksList(), + parent=self.__ui, ) if dlg.exec() == QDialog.DialogCode.Accepted: rev, merge, date, user, message = dlg.getParameters() @@ -2497,7 +2569,7 @@ args.append(message) args.append(rev) - dia = HgDialog(self.tr("Backing out changeset"), self) + dia = HgDialog(self.tr("Backing out changeset"), hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -2513,7 +2585,9 @@ icon=EricMessageBox.Warning, ) if res: - dia = HgDialog(self.tr("Rollback last transaction"), self) + dia = HgDialog( + self.tr("Rollback last transaction"), hg=self, parent=self.__ui + ) res = dia.startProcess(["rollback"]) if res: dia.exec() @@ -2540,7 +2614,7 @@ """ from .HgImportDialog import HgImportDialog - dlg = HgImportDialog(self) + dlg = HgImportDialog(self, parent=self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: ( patchFile, @@ -2576,7 +2650,7 @@ args.append("--secret") args.append(patchFile) - dia = HgDialog(self.tr("Import Patch"), self) + dia = HgDialog(self.tr("Import Patch"), hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -2593,7 +2667,9 @@ """ from .HgExportDialog import HgExportDialog - dlg = HgExportDialog(self.hgGetBookmarksList(), self.version >= (4, 7, 0)) + dlg = HgExportDialog( + self.hgGetBookmarksList(), self.version >= (4, 7, 0), parent=self.__ui + ) if dlg.exec() == QDialog.DialogCode.Accepted: ( filePattern, @@ -2624,7 +2700,7 @@ for rev in revisions: args.append(rev) - dia = HgDialog(self.tr("Export Patches"), self) + dia = HgDialog(self.tr("Export Patches"), hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -2643,7 +2719,7 @@ from .HgPhaseDialog import HgPhaseDialog if data is None: - dlg = HgPhaseDialog() + dlg = HgPhaseDialog(parent=self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: data = dlg.getData() @@ -2666,7 +2742,7 @@ for rev in revs: args.append(rev) - dia = HgDialog(self.tr("Change Phase"), self) + dia = HgDialog(self.tr("Change Phase"), hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -2688,7 +2764,7 @@ from .HgGraftDialog import HgGraftDialog res = False - dlg = HgGraftDialog(self, revs) + dlg = HgGraftDialog(self, revs, parent=self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: ( revs, @@ -2721,7 +2797,7 @@ args.append("--no-commit") args.extend(revs) - dia = HgDialog(self.tr("Copy Changesets"), self) + dia = HgDialog(self.tr("Copy Changesets"), hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -2744,7 +2820,7 @@ args.append(subcommand) args.append("--verbose") - dia = HgDialog(title, self) + dia = HgDialog(title, hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -2788,7 +2864,7 @@ """ from .HgArchiveDialog import HgArchiveDialog - dlg = HgArchiveDialog(self) + dlg = HgArchiveDialog(self, parent=self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: archive, type_, prefix, subrepos = dlg.getData() @@ -2803,7 +2879,9 @@ args.append("--subrepos") args.append(archive) - dia = HgDialog(self.tr("Create Unversioned Archive"), self) + dia = HgDialog( + self.tr("Create Unversioned Archive"), hg=self, parent=self.__ui + ) res = dia.startProcess(args) if res: dia.exec() @@ -2859,7 +2937,7 @@ ppath = self.__projectHelper.getProject().getProjectPath() hgsub = self.getHgSubPath() - dlg = HgAddSubrepositoryDialog(ppath) + dlg = HgAddSubrepositoryDialog(ppath, parent=self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: relPath, subrepoType, subrepoUrl = dlg.getData() if subrepoType == "hg": @@ -2955,7 +3033,7 @@ ) return - dlg = HgRemoveSubrepositoriesDialog(subrepositories) + dlg = HgRemoveSubrepositoriesDialog(subrepositories, parent=self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: subrepositories, removedSubrepos, deleteSubrepos = dlg.getData() contents = "\n".join(subrepositories) + "\n" @@ -3312,6 +3390,7 @@ self.hgGetTagsList(), self.hgGetBranchesList(), self.hgGetBookmarksList(), + parent=self.__ui, ) if dlg.exec() == QDialog.DialogCode.Accepted: revision, bookmark = dlg.getData() @@ -3326,7 +3405,7 @@ args.append(revision) args.append(bookmark) - dia = HgDialog(self.tr("Mercurial Bookmark"), self) + dia = HgDialog(self.tr("Mercurial Bookmark"), hg=self, parent=self.__ui) res = dia.startProcess(args) if res: dia.exec() @@ -3354,7 +3433,9 @@ args.append("--delete") args.append(bookmark) - dia = HgDialog(self.tr("Delete Mercurial Bookmark"), self) + dia = HgDialog( + self.tr("Delete Mercurial Bookmark"), hg=self, parent=self.__ui + ) res = dia.startProcess(args) if res: dia.exec() @@ -3369,7 +3450,7 @@ from .HgBookmarkRenameDialog import HgBookmarkRenameDialog if not renameInfo: - dlg = HgBookmarkRenameDialog(self.hgGetBookmarksList()) + dlg = HgBookmarkRenameDialog(self.hgGetBookmarksList(), parent=self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: renameInfo = dlg.getData() @@ -3379,7 +3460,9 @@ args.append(renameInfo[0]) args.append(renameInfo[1]) - dia = HgDialog(self.tr("Rename Mercurial Bookmark"), self) + dia = HgDialog( + self.tr("Rename Mercurial Bookmark"), hg=self, parent=self.__ui + ) res = dia.startProcess(args) if res: dia.exec() @@ -3403,6 +3486,7 @@ self.hgGetTagsList(), self.hgGetBranchesList(), self.hgGetBookmarksList(), + parent=self.__ui, ) if dlg.exec() == QDialog.DialogCode.Accepted: revision, bookmark = dlg.getData() @@ -3418,7 +3502,9 @@ args.append(revision) args.append(bookmark) - dia = HgDialog(self.tr("Move Mercurial Bookmark"), self) + dia = HgDialog( + self.tr("Move Mercurial Bookmark"), hg=self, parent=self.__ui + ) res = dia.startProcess(args) if res: dia.exec() @@ -3512,7 +3598,9 @@ args.append(bookmark) dia = HgDialog( - self.tr("Pulling bookmark from a remote Mercurial repository"), self + self.tr("Pulling bookmark from a remote Mercurial repository"), + hg=self, + parent=self.__ui, ) res = dia.startProcess(args) if res: @@ -3554,7 +3642,9 @@ args.append(bookmark) dia = HgDialog( - self.tr("Pushing bookmark to a remote Mercurial repository"), self + self.tr("Pushing bookmark to a remote Mercurial repository"), + hg=self, + parent=self.__ui, ) res = dia.startProcess(args) if res: