699 force = True |
699 force = True |
700 accepted = True |
700 accepted = True |
701 else: |
701 else: |
702 from .HgCopyDialog import HgCopyDialog |
702 from .HgCopyDialog import HgCopyDialog |
703 dlg = HgCopyDialog(name, None, True) |
703 dlg = HgCopyDialog(name, None, True) |
704 accepted = dlg.exec() == QDialog.Accepted |
704 accepted = dlg.exec() == QDialog.DialogCode.Accepted |
705 if accepted: |
705 if accepted: |
706 target, force = dlg.getData() |
706 target, force = dlg.getData() |
707 |
707 |
708 if accepted: |
708 if accepted: |
709 args = self.initCommand("rename") |
709 args = self.initCommand("rename") |
810 @return flag indicating a performed tag action (boolean) |
810 @return flag indicating a performed tag action (boolean) |
811 """ |
811 """ |
812 from .HgTagDialog import HgTagDialog |
812 from .HgTagDialog import HgTagDialog |
813 dlg = HgTagDialog(self.hgGetTagsList(withType=True), |
813 dlg = HgTagDialog(self.hgGetTagsList(withType=True), |
814 revision, tagName) |
814 revision, tagName) |
815 if dlg.exec() == QDialog.Accepted: |
815 if dlg.exec() == QDialog.DialogCode.Accepted: |
816 tag, revision, tagOp, force = dlg.getParameters() |
816 tag, revision, tagOp, force = dlg.getParameters() |
817 else: |
817 else: |
818 return False |
818 return False |
819 |
819 |
820 args = self.initCommand("tag") |
820 args = self.initCommand("tag") |
878 self.tr("Revert changes"), |
878 self.tr("Revert changes"), |
879 self.tr( |
879 self.tr( |
880 "Do you really want to revert all changes to these files" |
880 "Do you really want to revert all changes to these files" |
881 " or directories?"), |
881 " or directories?"), |
882 names) |
882 names) |
883 yes = dlg.exec() == QDialog.Accepted |
883 yes = dlg.exec() == QDialog.DialogCode.Accepted |
884 else: |
884 else: |
885 yes = E5MessageBox.yesNo( |
885 yes = E5MessageBox.yesNo( |
886 None, |
886 None, |
887 self.tr("Revert changes"), |
887 self.tr("Revert changes"), |
888 self.tr("""Do you really want to revert all changes of""" |
888 self.tr("""Do you really want to revert all changes of""" |
911 if not rev: |
911 if not rev: |
912 from .HgMergeDialog import HgMergeDialog |
912 from .HgMergeDialog import HgMergeDialog |
913 dlg = HgMergeDialog(self.hgGetTagsList(), |
913 dlg = HgMergeDialog(self.hgGetTagsList(), |
914 self.hgGetBranchesList(), |
914 self.hgGetBranchesList(), |
915 self.hgGetBookmarksList()) |
915 self.hgGetBookmarksList()) |
916 if dlg.exec() == QDialog.Accepted: |
916 if dlg.exec() == QDialog.DialogCode.Accepted: |
917 rev, force = dlg.getParameters() |
917 rev, force = dlg.getParameters() |
918 else: |
918 else: |
919 return |
919 return |
920 else: |
920 else: |
921 force = False |
921 force = False |
991 from .HgRevisionSelectionDialog import HgRevisionSelectionDialog |
991 from .HgRevisionSelectionDialog import HgRevisionSelectionDialog |
992 dlg = HgRevisionSelectionDialog(self.hgGetTagsList(), |
992 dlg = HgRevisionSelectionDialog(self.hgGetTagsList(), |
993 self.hgGetBranchesList(), |
993 self.hgGetBranchesList(), |
994 self.hgGetBookmarksList(), |
994 self.hgGetBookmarksList(), |
995 self.tr("Current branch tip")) |
995 self.tr("Current branch tip")) |
996 if dlg.exec() == QDialog.Accepted: |
996 if dlg.exec() == QDialog.DialogCode.Accepted: |
997 rev = dlg.getRevision() |
997 rev = dlg.getRevision() |
998 return self.vcsUpdate(name, revision=rev) |
998 return self.vcsUpdate(name, revision=rev) |
999 |
999 |
1000 return False |
1000 return False |
1001 |
1001 |
1152 |
1152 |
1153 @param name directory name of the working directory (string) |
1153 @param name directory name of the working directory (string) |
1154 """ |
1154 """ |
1155 from .HgCommandDialog import HgCommandDialog |
1155 from .HgCommandDialog import HgCommandDialog |
1156 dlg = HgCommandDialog(self.commandHistory, name) |
1156 dlg = HgCommandDialog(self.commandHistory, name) |
1157 if dlg.exec() == QDialog.Accepted: |
1157 if dlg.exec() == QDialog.DialogCode.Accepted: |
1158 command = dlg.getData() |
1158 command = dlg.getData() |
1159 commandList = Utilities.parseOptionString(command) |
1159 commandList = Utilities.parseOptionString(command) |
1160 |
1160 |
1161 # This moves any previous occurrence of these arguments to the head |
1161 # This moves any previous occurrence of these arguments to the head |
1162 # of the list. |
1162 # of the list. |
1310 @return flag indicating successful operation (boolean) |
1310 @return flag indicating successful operation (boolean) |
1311 """ |
1311 """ |
1312 from .HgCopyDialog import HgCopyDialog |
1312 from .HgCopyDialog import HgCopyDialog |
1313 dlg = HgCopyDialog(name) |
1313 dlg = HgCopyDialog(name) |
1314 res = False |
1314 res = False |
1315 if dlg.exec() == QDialog.Accepted: |
1315 if dlg.exec() == QDialog.DialogCode.Accepted: |
1316 target, force = dlg.getData() |
1316 target, force = dlg.getData() |
1317 |
1317 |
1318 args = self.initCommand("copy") |
1318 args = self.initCommand("copy") |
1319 args.append("-v") |
1319 args.append("-v") |
1320 args.append(name) |
1320 args.append(name) |
1473 |
1473 |
1474 from .HgRevisionsSelectionDialog import HgRevisionsSelectionDialog |
1474 from .HgRevisionsSelectionDialog import HgRevisionsSelectionDialog |
1475 dlg = HgRevisionsSelectionDialog(self.hgGetTagsList(), |
1475 dlg = HgRevisionsSelectionDialog(self.hgGetTagsList(), |
1476 self.hgGetBranchesList(), |
1476 self.hgGetBranchesList(), |
1477 self.hgGetBookmarksList()) |
1477 self.hgGetBookmarksList()) |
1478 if dlg.exec() == QDialog.Accepted: |
1478 if dlg.exec() == QDialog.DialogCode.Accepted: |
1479 revisions = dlg.getRevisions() |
1479 revisions = dlg.getRevisions() |
1480 if self.diff is None: |
1480 if self.diff is None: |
1481 from .HgDiffDialog import HgDiffDialog |
1481 from .HgDiffDialog import HgDiffDialog |
1482 self.diff = HgDiffDialog(self) |
1482 self.diff = HgDiffDialog(self) |
1483 self.diff.show() |
1483 self.diff.show() |
1520 if extended: |
1520 if extended: |
1521 from .HgRevisionsSelectionDialog import HgRevisionsSelectionDialog |
1521 from .HgRevisionsSelectionDialog import HgRevisionsSelectionDialog |
1522 dlg = HgRevisionsSelectionDialog(self.hgGetTagsList(), |
1522 dlg = HgRevisionsSelectionDialog(self.hgGetTagsList(), |
1523 self.hgGetBranchesList(), |
1523 self.hgGetBranchesList(), |
1524 self.hgGetBookmarksList()) |
1524 self.hgGetBookmarksList()) |
1525 if dlg.exec() == QDialog.Accepted: |
1525 if dlg.exec() == QDialog.DialogCode.Accepted: |
1526 rev1, rev2 = dlg.getRevisions() |
1526 rev1, rev2 = dlg.getRevisions() |
1527 else: |
1527 else: |
1528 return |
1528 return |
1529 elif revisions: |
1529 elif revisions: |
1530 rev1, rev2 = revisions[0], revisions[1] |
1530 rev1, rev2 = revisions[0], revisions[1] |
1831 """ |
1831 """ |
1832 Public method used to create a branch in the Mercurial repository. |
1832 Public method used to create a branch in the Mercurial repository. |
1833 """ |
1833 """ |
1834 from .HgBranchInputDialog import HgBranchInputDialog |
1834 from .HgBranchInputDialog import HgBranchInputDialog |
1835 dlg = HgBranchInputDialog(self.hgGetBranchesList()) |
1835 dlg = HgBranchInputDialog(self.hgGetBranchesList()) |
1836 if dlg.exec() == QDialog.Accepted: |
1836 if dlg.exec() == QDialog.DialogCode.Accepted: |
1837 name, commit = dlg.getData() |
1837 name, commit = dlg.getData() |
1838 name = name.strip().replace(" ", "_") |
1838 name = name.strip().replace(" ", "_") |
1839 args = self.initCommand("branch") |
1839 args = self.initCommand("branch") |
1840 args.append(name) |
1840 args.append(name) |
1841 |
1841 |
1906 withLargefiles = (self.isExtensionActive("largefiles") and |
1906 withLargefiles = (self.isExtensionActive("largefiles") and |
1907 withLargefiles) |
1907 withLargefiles) |
1908 from .HgRepoConfigDataDialog import HgRepoConfigDataDialog |
1908 from .HgRepoConfigDataDialog import HgRepoConfigDataDialog |
1909 dlg = HgRepoConfigDataDialog(withLargefiles=withLargefiles, |
1909 dlg = HgRepoConfigDataDialog(withLargefiles=withLargefiles, |
1910 largefilesData=largefilesData) |
1910 largefilesData=largefilesData) |
1911 if dlg.exec() == QDialog.Accepted: |
1911 if dlg.exec() == QDialog.DialogCode.Accepted: |
1912 createContents = True |
1912 createContents = True |
1913 defaultUrl, defaultPushUrl = dlg.getData() |
1913 defaultUrl, defaultPushUrl = dlg.getData() |
1914 if withLargefiles: |
1914 if withLargefiles: |
1915 lfMinSize, lfPattern = dlg.getLargefilesData() |
1915 lfMinSize, lfPattern = dlg.getLargefilesData() |
1916 else: |
1916 else: |
2070 from .HgBundleDialog import HgBundleDialog |
2070 from .HgBundleDialog import HgBundleDialog |
2071 dlg = HgBundleDialog(self.hgGetTagsList(), |
2071 dlg = HgBundleDialog(self.hgGetTagsList(), |
2072 self.hgGetBranchesList(), |
2072 self.hgGetBranchesList(), |
2073 self.hgGetBookmarksList(), |
2073 self.hgGetBookmarksList(), |
2074 version=self.version) |
2074 version=self.version) |
2075 if dlg.exec() != QDialog.Accepted: |
2075 if dlg.exec() != QDialog.DialogCode.Accepted: |
2076 return |
2076 return |
2077 |
2077 |
2078 revs, baseRevs, compression, bundleAll = dlg.getParameters() |
2078 revs, baseRevs, compression, bundleAll = dlg.getParameters() |
2079 else: |
2079 else: |
2080 revs = bundleData["revs"] |
2080 revs = bundleData["revs"] |
2214 if subcommand in ("good", "bad", "skip"): |
2214 if subcommand in ("good", "bad", "skip"): |
2215 from .HgRevisionSelectionDialog import HgRevisionSelectionDialog |
2215 from .HgRevisionSelectionDialog import HgRevisionSelectionDialog |
2216 dlg = HgRevisionSelectionDialog(self.hgGetTagsList(), |
2216 dlg = HgRevisionSelectionDialog(self.hgGetTagsList(), |
2217 self.hgGetBranchesList(), |
2217 self.hgGetBranchesList(), |
2218 self.hgGetBookmarksList()) |
2218 self.hgGetBookmarksList()) |
2219 if dlg.exec() == QDialog.Accepted: |
2219 if dlg.exec() == QDialog.DialogCode.Accepted: |
2220 rev = dlg.getRevision() |
2220 rev = dlg.getRevision() |
2221 else: |
2221 else: |
2222 return |
2222 return |
2223 |
2223 |
2224 args = self.initCommand("bisect") |
2224 args = self.initCommand("bisect") |
2267 """ |
2267 """ |
2268 from .HgBackoutDialog import HgBackoutDialog |
2268 from .HgBackoutDialog import HgBackoutDialog |
2269 dlg = HgBackoutDialog(self.hgGetTagsList(), |
2269 dlg = HgBackoutDialog(self.hgGetTagsList(), |
2270 self.hgGetBranchesList(), |
2270 self.hgGetBranchesList(), |
2271 self.hgGetBookmarksList()) |
2271 self.hgGetBookmarksList()) |
2272 if dlg.exec() == QDialog.Accepted: |
2272 if dlg.exec() == QDialog.DialogCode.Accepted: |
2273 rev, merge, date, user, message = dlg.getParameters() |
2273 rev, merge, date, user, message = dlg.getParameters() |
2274 if not rev: |
2274 if not rev: |
2275 E5MessageBox.warning( |
2275 E5MessageBox.warning( |
2276 self.__ui, |
2276 self.__ui, |
2277 self.tr("Backing out changeset"), |
2277 self.tr("Backing out changeset"), |
2331 @return flag indicating, that the import contained an add, a delete |
2331 @return flag indicating, that the import contained an add, a delete |
2332 or a change to the project file (boolean) |
2332 or a change to the project file (boolean) |
2333 """ |
2333 """ |
2334 from .HgImportDialog import HgImportDialog |
2334 from .HgImportDialog import HgImportDialog |
2335 dlg = HgImportDialog(self) |
2335 dlg = HgImportDialog(self) |
2336 if dlg.exec() == QDialog.Accepted: |
2336 if dlg.exec() == QDialog.DialogCode.Accepted: |
2337 (patchFile, noCommit, message, date, user, withSecret, stripCount, |
2337 (patchFile, noCommit, message, date, user, withSecret, stripCount, |
2338 force) = dlg.getParameters() |
2338 force) = dlg.getParameters() |
2339 |
2339 |
2340 args = self.initCommand("import") |
2340 args = self.initCommand("import") |
2341 args.append("--verbose") |
2341 args.append("--verbose") |
2376 Public method to export patches to files. |
2376 Public method to export patches to files. |
2377 """ |
2377 """ |
2378 from .HgExportDialog import HgExportDialog |
2378 from .HgExportDialog import HgExportDialog |
2379 dlg = HgExportDialog(self.hgGetBookmarksList(), |
2379 dlg = HgExportDialog(self.hgGetBookmarksList(), |
2380 self.version >= (4, 7, 0)) |
2380 self.version >= (4, 7, 0)) |
2381 if dlg.exec() == QDialog.Accepted: |
2381 if dlg.exec() == QDialog.DialogCode.Accepted: |
2382 (filePattern, revisions, bookmark, switchParent, allText, |
2382 (filePattern, revisions, bookmark, switchParent, allText, |
2383 noDates, git) = dlg.getParameters() |
2383 noDates, git) = dlg.getParameters() |
2384 |
2384 |
2385 args = self.initCommand("export") |
2385 args = self.initCommand("export") |
2386 args.append("--output") |
2386 args.append("--output") |
2416 @exception ValueError raised to indicate an invalid phase |
2416 @exception ValueError raised to indicate an invalid phase |
2417 """ |
2417 """ |
2418 if data is None: |
2418 if data is None: |
2419 from .HgPhaseDialog import HgPhaseDialog |
2419 from .HgPhaseDialog import HgPhaseDialog |
2420 dlg = HgPhaseDialog() |
2420 dlg = HgPhaseDialog() |
2421 if dlg.exec() == QDialog.Accepted: |
2421 if dlg.exec() == QDialog.DialogCode.Accepted: |
2422 data = dlg.getData() |
2422 data = dlg.getData() |
2423 |
2423 |
2424 if data: |
2424 if data: |
2425 revs, phase, force = data |
2425 revs, phase, force = data |
2426 |
2426 |
2457 @return flag indicating that the project should be reread (boolean) |
2457 @return flag indicating that the project should be reread (boolean) |
2458 """ |
2458 """ |
2459 from .HgGraftDialog import HgGraftDialog |
2459 from .HgGraftDialog import HgGraftDialog |
2460 res = False |
2460 res = False |
2461 dlg = HgGraftDialog(self, revs) |
2461 dlg = HgGraftDialog(self, revs) |
2462 if dlg.exec() == QDialog.Accepted: |
2462 if dlg.exec() == QDialog.DialogCode.Accepted: |
2463 (revs, |
2463 (revs, |
2464 (userData, currentUser, userName), |
2464 (userData, currentUser, userName), |
2465 (dateData, currentDate, dateStr), |
2465 (dateData, currentDate, dateStr), |
2466 log, dryrun, noCommit) = dlg.getData() |
2466 log, dryrun, noCommit) = dlg.getData() |
2467 |
2467 |
2559 """ |
2559 """ |
2560 Public method to create an unversioned archive from the repository. |
2560 Public method to create an unversioned archive from the repository. |
2561 """ |
2561 """ |
2562 from .HgArchiveDialog import HgArchiveDialog |
2562 from .HgArchiveDialog import HgArchiveDialog |
2563 dlg = HgArchiveDialog(self) |
2563 dlg = HgArchiveDialog(self) |
2564 if dlg.exec() == QDialog.Accepted: |
2564 if dlg.exec() == QDialog.DialogCode.Accepted: |
2565 archive, type_, prefix, subrepos = dlg.getData() |
2565 archive, type_, prefix, subrepos = dlg.getData() |
2566 |
2566 |
2567 args = self.initCommand("archive") |
2567 args = self.initCommand("archive") |
2568 if type_: |
2568 if type_: |
2569 args.append("--type") |
2569 args.append("--type") |
2624 """ |
2624 """ |
2625 from .HgAddSubrepositoryDialog import HgAddSubrepositoryDialog |
2625 from .HgAddSubrepositoryDialog import HgAddSubrepositoryDialog |
2626 ppath = self.__projectHelper.getProject().getProjectPath() |
2626 ppath = self.__projectHelper.getProject().getProjectPath() |
2627 hgsub = self.getHgSubPath() |
2627 hgsub = self.getHgSubPath() |
2628 dlg = HgAddSubrepositoryDialog(ppath) |
2628 dlg = HgAddSubrepositoryDialog(ppath) |
2629 if dlg.exec() == QDialog.Accepted: |
2629 if dlg.exec() == QDialog.DialogCode.Accepted: |
2630 relPath, subrepoType, subrepoUrl = dlg.getData() |
2630 relPath, subrepoType, subrepoUrl = dlg.getData() |
2631 if subrepoType == "hg": |
2631 if subrepoType == "hg": |
2632 url = subrepoUrl |
2632 url = subrepoUrl |
2633 else: |
2633 else: |
2634 url = "[{0}]{1}".format(subrepoType, subrepoUrl) |
2634 url = "[{0}]{1}".format(subrepoType, subrepoUrl) |
2712 |
2712 |
2713 from .HgRemoveSubrepositoriesDialog import ( |
2713 from .HgRemoveSubrepositoriesDialog import ( |
2714 HgRemoveSubrepositoriesDialog |
2714 HgRemoveSubrepositoriesDialog |
2715 ) |
2715 ) |
2716 dlg = HgRemoveSubrepositoriesDialog(subrepositories) |
2716 dlg = HgRemoveSubrepositoriesDialog(subrepositories) |
2717 if dlg.exec() == QDialog.Accepted: |
2717 if dlg.exec() == QDialog.DialogCode.Accepted: |
2718 subrepositories, removedSubrepos, deleteSubrepos = dlg.getData() |
2718 subrepositories, removedSubrepos, deleteSubrepos = dlg.getData() |
2719 contents = "\n".join(subrepositories) + "\n" |
2719 contents = "\n".join(subrepositories) + "\n" |
2720 try: |
2720 try: |
2721 with open(hgsub, "w") as f: |
2721 with open(hgsub, "w") as f: |
2722 f.write(contents) |
2722 f.write(contents) |
3041 from .HgBookmarkDialog import HgBookmarkDialog |
3041 from .HgBookmarkDialog import HgBookmarkDialog |
3042 dlg = HgBookmarkDialog(HgBookmarkDialog.DEFINE_MODE, |
3042 dlg = HgBookmarkDialog(HgBookmarkDialog.DEFINE_MODE, |
3043 self.hgGetTagsList(), |
3043 self.hgGetTagsList(), |
3044 self.hgGetBranchesList(), |
3044 self.hgGetBranchesList(), |
3045 self.hgGetBookmarksList()) |
3045 self.hgGetBookmarksList()) |
3046 if dlg.exec() == QDialog.Accepted: |
3046 if dlg.exec() == QDialog.DialogCode.Accepted: |
3047 revision, bookmark = dlg.getData() |
3047 revision, bookmark = dlg.getData() |
3048 ok = True |
3048 ok = True |
3049 else: |
3049 else: |
3050 ok = False |
3050 ok = False |
3051 |
3051 |
3094 @type tuple of str and str |
3094 @type tuple of str and str |
3095 """ |
3095 """ |
3096 if not renameInfo: |
3096 if not renameInfo: |
3097 from .HgBookmarkRenameDialog import HgBookmarkRenameDialog |
3097 from .HgBookmarkRenameDialog import HgBookmarkRenameDialog |
3098 dlg = HgBookmarkRenameDialog(self.hgGetBookmarksList()) |
3098 dlg = HgBookmarkRenameDialog(self.hgGetBookmarksList()) |
3099 if dlg.exec() == QDialog.Accepted: |
3099 if dlg.exec() == QDialog.DialogCode.Accepted: |
3100 renameInfo = dlg.getData() |
3100 renameInfo = dlg.getData() |
3101 |
3101 |
3102 if renameInfo: |
3102 if renameInfo: |
3103 args = self.initCommand("bookmarks") |
3103 args = self.initCommand("bookmarks") |
3104 args.append("--rename") |
3104 args.append("--rename") |
3123 from .HgBookmarkDialog import HgBookmarkDialog |
3123 from .HgBookmarkDialog import HgBookmarkDialog |
3124 dlg = HgBookmarkDialog(HgBookmarkDialog.MOVE_MODE, |
3124 dlg = HgBookmarkDialog(HgBookmarkDialog.MOVE_MODE, |
3125 self.hgGetTagsList(), |
3125 self.hgGetTagsList(), |
3126 self.hgGetBranchesList(), |
3126 self.hgGetBranchesList(), |
3127 self.hgGetBookmarksList()) |
3127 self.hgGetBookmarksList()) |
3128 if dlg.exec() == QDialog.Accepted: |
3128 if dlg.exec() == QDialog.DialogCode.Accepted: |
3129 revision, bookmark = dlg.getData() |
3129 revision, bookmark = dlg.getData() |
3130 ok = True |
3130 ok = True |
3131 else: |
3131 else: |
3132 ok = False |
3132 ok = False |
3133 |
3133 |