--- a/eric6/Plugins/VcsPlugins/vcsMercurial/hg.py Sat Sep 21 20:30:56 2019 +0200 +++ b/eric6/Plugins/VcsPlugins/vcsMercurial/hg.py Sat Sep 21 22:03:03 2019 +0200 @@ -11,8 +11,9 @@ import os import shutil -from PyQt5.QtCore import QProcess, pyqtSignal, QFileInfo, QFileSystemWatcher, \ - QCoreApplication +from PyQt5.QtCore import ( + QProcess, pyqtSignal, QFileInfo, QFileSystemWatcher, QCoreApplication +) from PyQt5.QtWidgets import QApplication, QDialog, QInputDialog from E5Gui.E5Application import e5App @@ -462,14 +463,16 @@ if os.path.isdir(nam): project = e5App().getObject("Project") if nam == project.getProjectPath(): - ok &= \ + ok &= ( project.checkAllScriptsDirty( - reportSyntaxErrors=True) and \ + reportSyntaxErrors=True) and project.checkDirty() + ) continue elif os.path.isfile(nam): - editor = \ + editor = ( e5App().getObject("ViewManager").getOpenEditor(nam) + ) if editor: ok &= editor.checkDirty() if not ok: @@ -499,8 +502,8 @@ return if self.__commitDialog is not None: - msg, amend, commitSubrepositories, author, dateTime = \ - self.__commitDialog.getCommitData() + (msg, amend, commitSubrepositories, author, + dateTime) = self.__commitDialog.getCommitData() self.__commitDialog.deleteLater() self.__commitDialog = None if amend and not msg: @@ -995,8 +998,9 @@ project = e5App().getObject("Project") names = [project.getRelativePath(nam) for nam in names] if names[0]: - from UI.DeleteFilesConfirmationDialog import \ + from UI.DeleteFilesConfirmationDialog import ( DeleteFilesConfirmationDialog + ) dlg = DeleteFilesConfirmationDialog( self.parent(), self.tr("Revert changes"), @@ -1098,8 +1102,9 @@ project = e5App().getObject("Project") names = [project.getRelativePath(nam) for nam in names] if names[0]: - from UI.DeleteFilesConfirmationDialog import \ + from UI.DeleteFilesConfirmationDialog import ( DeleteFilesConfirmationDialog + ) dlg = DeleteFilesConfirmationDialog( self.parent(), self.tr("Re-Merge"), @@ -1425,8 +1430,8 @@ index = 0 for line in output.splitlines(): index += 1 - changeset, tags, author, date, branches, bookmarks = \ - line.split("@@@") + (changeset, tags, author, date, branches, + bookmarks) = line.split("@@@") cdate, ctime = date.split()[:2] info = [] info.append(QCoreApplication.translate( @@ -1553,8 +1558,10 @@ if res: dia.exec_() res = dia.normalExit() - if res and \ - target.startswith(project.getProjectPath()): + if ( + res and + target.startswith(project.getProjectPath()) + ): if os.path.isdir(name): project.copyDirectory(name, target) else: @@ -1930,10 +1937,12 @@ or delete @rtype bool """ - if self.getPlugin().getPreferences("PreferUnbundle") and \ - self.bundleFile and \ - os.path.exists(self.bundleFile) and \ - revisions is None: + if ( + self.getPlugin().getPreferences("PreferUnbundle") and + self.bundleFile and + os.path.exists(self.bundleFile) and + revisions is None + ): command = "unbundle" title = self.tr('Apply changegroups') else: @@ -1963,8 +1972,10 @@ if res: dia.exec_() res = dia.hasAddOrDelete() - if self.bundleFile and \ - os.path.exists(self.bundleFile): + if ( + self.bundleFile and + os.path.exists(self.bundleFile) + ): os.remove(self.bundleFile) self.bundleFile = None self.checkVCSStatus() @@ -2046,8 +2057,8 @@ index = 0 for line in output.splitlines(): index += 1 - changeset, tags, author, date, branches, parents, bookmarks = \ - line.split("@@@") + (changeset, tags, author, date, branches, parents, + bookmarks) = line.split("@@@") cdate, ctime = date.split()[:2] info.append("""<p><table>""") if mode == "heads": @@ -2320,8 +2331,10 @@ if defaultPushUrl: cfg.write("default-push = {0}\n".format( defaultPushUrl)) - if withLargefiles and \ - (lfMinSize, lfPattern) != (None, None): + if ( + withLargefiles and + (lfMinSize, lfPattern) != (None, None) + ): cfg.write("\n[largefiles]\n") if lfMinSize is not None: cfg.write("minsize = {0}\n".format(lfMinSize)) @@ -2620,8 +2633,8 @@ if self.logBrowserIncoming is None: from .HgLogBrowserDialog import HgLogBrowserDialog - self.logBrowserIncoming = \ - HgLogBrowserDialog(self, mode="incoming") + self.logBrowserIncoming = HgLogBrowserDialog( + self, mode="incoming") self.logBrowserIncoming.show() self.logBrowserIncoming.raise_() self.logBrowserIncoming.start(name, bundle=file) @@ -2875,8 +2888,8 @@ from .HgImportDialog import HgImportDialog dlg = HgImportDialog() if dlg.exec_() == QDialog.Accepted: - patchFile, noCommit, message, date, user, stripCount, force = \ - dlg.getParameters() + (patchFile, noCommit, message, date, user, stripCount, + force) = dlg.getParameters() args = self.initCommand("import") args.append("--verbose") @@ -2929,8 +2942,8 @@ dlg = HgExportDialog(self.hgGetBookmarksList(repodir), self.version >= (4, 7, 0)) if dlg.exec_() == QDialog.Accepted: - filePattern, revisions, bookmark, switchParent, allText, noDates, \ - git = dlg.getParameters() + (filePattern, revisions, bookmark, switchParent, allText, + noDates, git) = dlg.getParameters() args = self.initCommand("export") args.append("--output") @@ -3028,9 +3041,10 @@ res = False dlg = HgGraftDialog(self, revs) if dlg.exec_() == QDialog.Accepted: - revs, (userData, currentUser, userName), \ - (dateData, currentDate, dateStr), log, dryrun, \ - noCommit = dlg.getData() + (revs, + (userData, currentUser, userName), + (dateData, currentDate, dateStr), + log, dryrun, noCommit) = dlg.getData() args = self.initCommand("graft") args.append("--verbose") @@ -3302,8 +3316,9 @@ .format(str(err))) return - from .HgRemoveSubrepositoriesDialog import \ + from .HgRemoveSubrepositoriesDialog import ( HgRemoveSubrepositoriesDialog + ) dlg = HgRemoveSubrepositoriesDialog(subrepositories) if dlg.exec_() == QDialog.Accepted: subrepositories, removedSubrepos, deleteSubrepos = dlg.getData() @@ -3359,11 +3374,15 @@ self.__defaultPushConfigured = False if output: for line in output.splitlines(): - if line.startswith("paths.default=") and \ - not line.strip().endswith("="): + if ( + line.startswith("paths.default=") and + not line.strip().endswith("=") + ): self.__defaultConfigured = True - if line.startswith("paths.default-push=") and \ - not line.strip().endswith("="): + if ( + line.startswith("paths.default-push=") and + not line.strip().endswith("=") + ): self.__defaultPushConfigured = True def canCommitMerge(self, name): @@ -3495,8 +3514,9 @@ if output: for line in output.splitlines(): - extensionName = \ + extensionName = ( line.split("=", 1)[0].strip().split(".")[-1].strip() + ) self.__activeExtensions.append(extensionName) if self.version < (4, 8, 0) and "closehead" in self.__activeExtensions: self.__activeExtensions.remove["closehead"]