eric6/Plugins/VcsPlugins/vcsGit/git.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8176
31965986ecd1
child 8222
5994b80b8760
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
687 force = True 687 force = True
688 accepted = True 688 accepted = True
689 else: 689 else:
690 from .GitCopyDialog import GitCopyDialog 690 from .GitCopyDialog import GitCopyDialog
691 dlg = GitCopyDialog(name, None, True) 691 dlg = GitCopyDialog(name, None, True)
692 accepted = dlg.exec() == QDialog.Accepted 692 accepted = dlg.exec() == QDialog.DialogCode.Accepted
693 if accepted: 693 if accepted:
694 target, force = dlg.getData() 694 target, force = dlg.getData()
695 695
696 if accepted: 696 if accepted:
697 args = self.initCommand("mv") 697 args = self.initCommand("mv")
884 self.tr("Revert changes"), 884 self.tr("Revert changes"),
885 self.tr( 885 self.tr(
886 "Do you really want to revert all changes to these files" 886 "Do you really want to revert all changes to these files"
887 " or directories?"), 887 " or directories?"),
888 names) 888 names)
889 yes = dlg.exec() == QDialog.Accepted 889 yes = dlg.exec() == QDialog.DialogCode.Accepted
890 else: 890 else:
891 yes = E5MessageBox.yesNo( 891 yes = E5MessageBox.yesNo(
892 None, 892 None,
893 self.tr("Revert changes"), 893 self.tr("Revert changes"),
894 self.tr("""Do you really want to revert all changes of""" 894 self.tr("""Do you really want to revert all changes of"""
923 from .GitMergeDialog import GitMergeDialog 923 from .GitMergeDialog import GitMergeDialog
924 dlg = GitMergeDialog(self.gitGetTagsList(repodir), 924 dlg = GitMergeDialog(self.gitGetTagsList(repodir),
925 self.gitGetBranchesList(repodir, withMaster=True), 925 self.gitGetBranchesList(repodir, withMaster=True),
926 self.gitGetCurrentBranch(repodir), 926 self.gitGetCurrentBranch(repodir),
927 self.gitGetBranchesList(repodir, remotes=True)) 927 self.gitGetBranchesList(repodir, remotes=True))
928 if dlg.exec() == QDialog.Accepted: 928 if dlg.exec() == QDialog.DialogCode.Accepted:
929 commit, doCommit, commitMessage, addLog, diffStat = ( 929 commit, doCommit, commitMessage, addLog, diffStat = (
930 dlg.getParameters() 930 dlg.getParameters()
931 ) 931 )
932 args = self.initCommand("merge") 932 args = self.initCommand("merge")
933 if doCommit: 933 if doCommit:
976 self.gitGetTagsList(repodir), 976 self.gitGetTagsList(repodir),
977 self.gitGetBranchesList(repodir), 977 self.gitGetBranchesList(repodir),
978 trackingBranchesList=self.gitGetBranchesList( 978 trackingBranchesList=self.gitGetBranchesList(
979 repodir, remotes=True), 979 repodir, remotes=True),
980 noneLabel=self.tr("Master branch head")) 980 noneLabel=self.tr("Master branch head"))
981 if dlg.exec() == QDialog.Accepted: 981 if dlg.exec() == QDialog.DialogCode.Accepted:
982 rev = dlg.getRevision() 982 rev = dlg.getRevision()
983 return self.vcsUpdate(name, revision=rev) 983 return self.vcsUpdate(name, revision=rev)
984 984
985 return False 985 return False
986 986
1181 1181
1182 @param name directory name of the working directory (string) 1182 @param name directory name of the working directory (string)
1183 """ 1183 """
1184 from .GitCommandDialog import GitCommandDialog 1184 from .GitCommandDialog import GitCommandDialog
1185 dlg = GitCommandDialog(self.commandHistory, name) 1185 dlg = GitCommandDialog(self.commandHistory, name)
1186 if dlg.exec() == QDialog.Accepted: 1186 if dlg.exec() == QDialog.DialogCode.Accepted:
1187 command = dlg.getData() 1187 command = dlg.getData()
1188 commandList = Utilities.parseOptionString(command) 1188 commandList = Utilities.parseOptionString(command)
1189 1189
1190 # This moves any previous occurrence of these arguments to the head 1190 # This moves any previous occurrence of these arguments to the head
1191 # of the list. 1191 # of the list.
1422 @param project reference to the project object 1422 @param project reference to the project object
1423 @return flag indicating successful operation (boolean) 1423 @return flag indicating successful operation (boolean)
1424 """ 1424 """
1425 from .GitCopyDialog import GitCopyDialog 1425 from .GitCopyDialog import GitCopyDialog
1426 dlg = GitCopyDialog(name) 1426 dlg = GitCopyDialog(name)
1427 if dlg.exec() == QDialog.Accepted: 1427 if dlg.exec() == QDialog.DialogCode.Accepted:
1428 target, force = dlg.getData() 1428 target, force = dlg.getData()
1429 1429
1430 # step 1: copy the file/directory: 1430 # step 1: copy the file/directory:
1431 if os.path.isdir(name): 1431 if os.path.isdir(name):
1432 try: 1432 try:
1511 return 1511 return
1512 1512
1513 from .GitRevisionsSelectionDialog import GitRevisionsSelectionDialog 1513 from .GitRevisionsSelectionDialog import GitRevisionsSelectionDialog
1514 dlg = GitRevisionsSelectionDialog(self.gitGetTagsList(repodir), 1514 dlg = GitRevisionsSelectionDialog(self.gitGetTagsList(repodir),
1515 self.gitGetBranchesList(repodir)) 1515 self.gitGetBranchesList(repodir))
1516 if dlg.exec() == QDialog.Accepted: 1516 if dlg.exec() == QDialog.DialogCode.Accepted:
1517 revisions = dlg.getRevisions() 1517 revisions = dlg.getRevisions()
1518 if self.diff is None: 1518 if self.diff is None:
1519 from .GitDiffDialog import GitDiffDialog 1519 from .GitDiffDialog import GitDiffDialog
1520 self.diff = GitDiffDialog(self) 1520 self.diff = GitDiffDialog(self)
1521 self.diff.show() 1521 self.diff.show()
1595 from .GitRevisionsSelectionDialog import ( 1595 from .GitRevisionsSelectionDialog import (
1596 GitRevisionsSelectionDialog 1596 GitRevisionsSelectionDialog
1597 ) 1597 )
1598 dlg = GitRevisionsSelectionDialog(self.gitGetTagsList(repodir), 1598 dlg = GitRevisionsSelectionDialog(self.gitGetTagsList(repodir),
1599 self.gitGetBranchesList(repodir)) 1599 self.gitGetBranchesList(repodir))
1600 if dlg.exec() == QDialog.Accepted: 1600 if dlg.exec() == QDialog.DialogCode.Accepted:
1601 rev1, rev2 = dlg.getRevisions() 1601 rev1, rev2 = dlg.getRevisions()
1602 elif revisions: 1602 elif revisions:
1603 rev1, rev2 = revisions[0], revisions[1] 1603 rev1, rev2 = revisions[0], revisions[1]
1604 else: 1604 else:
1605 rev1, rev2 = "", "" 1605 rev1, rev2 = "", ""
1659 if os.path.splitdrive(repodir)[1] == os.sep: 1659 if os.path.splitdrive(repodir)[1] == os.sep:
1660 return 1660 return
1661 1661
1662 from .GitFetchDialog import GitFetchDialog 1662 from .GitFetchDialog import GitFetchDialog
1663 dlg = GitFetchDialog(self, repodir) 1663 dlg = GitFetchDialog(self, repodir)
1664 if dlg.exec() == QDialog.Accepted: 1664 if dlg.exec() == QDialog.DialogCode.Accepted:
1665 (remote, url, remoteBranches, localBranch, fetchAll, prune, 1665 (remote, url, remoteBranches, localBranch, fetchAll, prune,
1666 includeTags) = dlg.getData() 1666 includeTags) = dlg.getData()
1667 1667
1668 args = self.initCommand("fetch") 1668 args = self.initCommand("fetch")
1669 args.append('--verbose') 1669 args.append('--verbose')
1702 if os.path.splitdrive(repodir)[1] == os.sep: 1702 if os.path.splitdrive(repodir)[1] == os.sep:
1703 return False 1703 return False
1704 1704
1705 from .GitPullDialog import GitPullDialog 1705 from .GitPullDialog import GitPullDialog
1706 dlg = GitPullDialog(self, repodir) 1706 dlg = GitPullDialog(self, repodir)
1707 if dlg.exec() == QDialog.Accepted: 1707 if dlg.exec() == QDialog.DialogCode.Accepted:
1708 remote, url, branches, pullAll, prune = dlg.getData() 1708 remote, url, branches, pullAll, prune = dlg.getData()
1709 1709
1710 args = self.initCommand('pull') 1710 args = self.initCommand('pull')
1711 args.append('--no-commit') 1711 args.append('--no-commit')
1712 args.append('--verbose') 1712 args.append('--verbose')
1742 if os.path.splitdrive(repodir)[1] == os.sep: 1742 if os.path.splitdrive(repodir)[1] == os.sep:
1743 return 1743 return
1744 1744
1745 from .GitPushDialog import GitPushDialog 1745 from .GitPushDialog import GitPushDialog
1746 dlg = GitPushDialog(self, repodir) 1746 dlg = GitPushDialog(self, repodir)
1747 if dlg.exec() == QDialog.Accepted: 1747 if dlg.exec() == QDialog.DialogCode.Accepted:
1748 remote, refspecs, tags, tracking, submodule = dlg.getData() 1748 remote, refspecs, tags, tracking, submodule = dlg.getData()
1749 1749
1750 args = self.initCommand("push") 1750 args = self.initCommand("push")
1751 args.append('--verbose') 1751 args.append('--verbose')
1752 args.append('--porcelain') 1752 args.append('--porcelain')
1869 if os.path.splitdrive(repodir)[1] == os.sep: 1869 if os.path.splitdrive(repodir)[1] == os.sep:
1870 return 1870 return
1871 1871
1872 from .GitPatchFilesDialog import GitPatchFilesDialog 1872 from .GitPatchFilesDialog import GitPatchFilesDialog
1873 dlg = GitPatchFilesDialog(repodir, self.__patchCheckData) 1873 dlg = GitPatchFilesDialog(repodir, self.__patchCheckData)
1874 if dlg.exec() == QDialog.Accepted: 1874 if dlg.exec() == QDialog.DialogCode.Accepted:
1875 patchFilesList, stripCount, inaccurateEof, recount = dlg.getData() 1875 patchFilesList, stripCount, inaccurateEof, recount = dlg.getData()
1876 if patchFilesList: 1876 if patchFilesList:
1877 args = self.initCommand("apply") 1877 args = self.initCommand("apply")
1878 if check: 1878 if check:
1879 args.append("--check") 1879 args.append("--check")
1936 if os.path.splitdrive(repodir)[1] == os.sep: 1936 if os.path.splitdrive(repodir)[1] == os.sep:
1937 return False 1937 return False
1938 1938
1939 from .GitTagDialog import GitTagDialog 1939 from .GitTagDialog import GitTagDialog
1940 dlg = GitTagDialog(self.gitGetTagsList(repodir), revision, tagName) 1940 dlg = GitTagDialog(self.gitGetTagsList(repodir), revision, tagName)
1941 if dlg.exec() == QDialog.Accepted: 1941 if dlg.exec() == QDialog.DialogCode.Accepted:
1942 tag, revision, tagOp, tagType, force = dlg.getParameters() 1942 tag, revision, tagOp, tagType, force = dlg.getParameters()
1943 else: 1943 else:
1944 return False 1944 return False
1945 1945
1946 args = self.initCommand("tag") 1946 args = self.initCommand("tag")
2132 2132
2133 from .GitBranchDialog import GitBranchDialog 2133 from .GitBranchDialog import GitBranchDialog
2134 dlg = GitBranchDialog( 2134 dlg = GitBranchDialog(
2135 self.gitGetBranchesList(repodir, allBranches=True), 2135 self.gitGetBranchesList(repodir, allBranches=True),
2136 revision, branchName, branchOp) 2136 revision, branchName, branchOp)
2137 if dlg.exec() == QDialog.Accepted: 2137 if dlg.exec() == QDialog.DialogCode.Accepted:
2138 branchOp, branch, revision, newBranch, remoteBranch, force = ( 2138 branchOp, branch, revision, newBranch, remoteBranch, force = (
2139 dlg.getParameters() 2139 dlg.getParameters()
2140 ) 2140 )
2141 else: 2141 else:
2142 return False, False 2142 return False, False
2222 2222
2223 from .GitBranchPushDialog import GitBranchPushDialog 2223 from .GitBranchPushDialog import GitBranchPushDialog
2224 dlg = GitBranchPushDialog(self.gitGetBranchesList(repodir), 2224 dlg = GitBranchPushDialog(self.gitGetBranchesList(repodir),
2225 self.gitGetRemotesList(repodir), 2225 self.gitGetRemotesList(repodir),
2226 delete=True) 2226 delete=True)
2227 if dlg.exec() == QDialog.Accepted: 2227 if dlg.exec() == QDialog.DialogCode.Accepted:
2228 branchName, remoteName = dlg.getData()[:2] 2228 branchName, remoteName = dlg.getData()[:2]
2229 2229
2230 args = self.initCommand("push") 2230 args = self.initCommand("push")
2231 args.append(remoteName) 2231 args.append(remoteName)
2232 args.append(":{0}".format(branchName)) 2232 args.append(":{0}".format(branchName))
2276 return 2276 return
2277 2277
2278 from .GitBundleDialog import GitBundleDialog 2278 from .GitBundleDialog import GitBundleDialog
2279 dlg = GitBundleDialog(self.gitGetTagsList(repodir), 2279 dlg = GitBundleDialog(self.gitGetTagsList(repodir),
2280 self.gitGetBranchesList(repodir)) 2280 self.gitGetBranchesList(repodir))
2281 if dlg.exec() == QDialog.Accepted: 2281 if dlg.exec() == QDialog.DialogCode.Accepted:
2282 revs = dlg.getData() 2282 revs = dlg.getData()
2283 2283
2284 fname, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( 2284 fname, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
2285 None, 2285 None,
2286 self.tr("Create Bundle"), 2286 self.tr("Create Bundle"),
2437 2437
2438 from .GitApplyBundleDataDialog import GitApplyBundleDataDialog 2438 from .GitApplyBundleDataDialog import GitApplyBundleDataDialog
2439 dlg = GitApplyBundleDataDialog( 2439 dlg = GitApplyBundleDataDialog(
2440 self.gitGetBundleHeads(repodir, fname), 2440 self.gitGetBundleHeads(repodir, fname),
2441 self.gitGetBranchesList(repodir)) 2441 self.gitGetBranchesList(repodir))
2442 if dlg.exec() == QDialog.Accepted: 2442 if dlg.exec() == QDialog.DialogCode.Accepted:
2443 bundleHead, branch = dlg.getData() 2443 bundleHead, branch = dlg.getData()
2444 2444
2445 args = self.initCommand("fetch") 2445 args = self.initCommand("fetch")
2446 args.append('--verbose') 2446 args.append('--verbose')
2447 args.append(fname) 2447 args.append(fname)
2485 2485
2486 from .GitApplyBundleDataDialog import GitApplyBundleDataDialog 2486 from .GitApplyBundleDataDialog import GitApplyBundleDataDialog
2487 dlg = GitApplyBundleDataDialog( 2487 dlg = GitApplyBundleDataDialog(
2488 self.gitGetBundleHeads(repodir, fname), 2488 self.gitGetBundleHeads(repodir, fname),
2489 self.gitGetBranchesList(repodir)) 2489 self.gitGetBranchesList(repodir))
2490 if dlg.exec() == QDialog.Accepted: 2490 if dlg.exec() == QDialog.DialogCode.Accepted:
2491 bundleHead, branch = dlg.getData() 2491 bundleHead, branch = dlg.getData()
2492 2492
2493 args = self.initCommand("pull") 2493 args = self.initCommand("pull")
2494 args.append('--verbose') 2494 args.append('--verbose')
2495 args.append(fname) 2495 args.append(fname)
2544 from .GitRevisionSelectionDialog import GitRevisionSelectionDialog 2544 from .GitRevisionSelectionDialog import GitRevisionSelectionDialog
2545 dlg = GitRevisionSelectionDialog(self.gitGetTagsList(repodir), 2545 dlg = GitRevisionSelectionDialog(self.gitGetTagsList(repodir),
2546 self.gitGetBranchesList(repodir), 2546 self.gitGetBranchesList(repodir),
2547 showBranches=showBranches, 2547 showBranches=showBranches,
2548 showHead=showHead) 2548 showHead=showHead)
2549 if dlg.exec() == QDialog.Accepted: 2549 if dlg.exec() == QDialog.DialogCode.Accepted:
2550 rev = dlg.getRevision() 2550 rev = dlg.getRevision()
2551 else: 2551 else:
2552 return False 2552 return False
2553 2553
2554 args = self.initCommand("bisect") 2554 args = self.initCommand("bisect")
2555 if subcommand == "start_extended": 2555 if subcommand == "start_extended":
2556 from .GitBisectStartDialog import GitBisectStartDialog 2556 from .GitBisectStartDialog import GitBisectStartDialog
2557 dlg = GitBisectStartDialog() 2557 dlg = GitBisectStartDialog()
2558 if dlg.exec() == QDialog.Accepted: 2558 if dlg.exec() == QDialog.DialogCode.Accepted:
2559 bad, good, noCheckout = dlg.getData() 2559 bad, good, noCheckout = dlg.getData()
2560 args.append("start") 2560 args.append("start")
2561 if noCheckout: 2561 if noCheckout:
2562 args.append("--no-checkout") 2562 args.append("--no-checkout")
2563 args.append(bad) 2563 args.append(bad)
2917 if os.path.splitdrive(repodir)[1] == os.sep: 2917 if os.path.splitdrive(repodir)[1] == os.sep:
2918 return 2918 return
2919 2919
2920 from .GitAddRemoteDialog import GitAddRemoteDialog 2920 from .GitAddRemoteDialog import GitAddRemoteDialog
2921 dlg = GitAddRemoteDialog() 2921 dlg = GitAddRemoteDialog()
2922 if dlg.exec() == QDialog.Accepted: 2922 if dlg.exec() == QDialog.DialogCode.Accepted:
2923 name, url = dlg.getData() 2923 name, url = dlg.getData()
2924 args = self.initCommand("remote") 2924 args = self.initCommand("remote")
2925 args.append("add") 2925 args.append("add")
2926 args.append(name) 2926 args.append(name)
2927 args.append(url) 2927 args.append(url)
2945 2945
2946 newName, ok = QInputDialog.getText( 2946 newName, ok = QInputDialog.getText(
2947 None, 2947 None,
2948 self.tr("Rename Remote Repository"), 2948 self.tr("Rename Remote Repository"),
2949 self.tr("Enter new name for remote repository:"), 2949 self.tr("Enter new name for remote repository:"),
2950 QLineEdit.Normal) 2950 QLineEdit.EchoMode.Normal)
2951 if ok and newName and newName != remoteName: 2951 if ok and newName and newName != remoteName:
2952 args = self.initCommand("remote") 2952 args = self.initCommand("remote")
2953 args.append("rename") 2953 args.append("rename")
2954 args.append(remoteName) 2954 args.append(remoteName)
2955 args.append(newName) 2955 args.append(newName)
2978 if not remoteUrl: 2978 if not remoteUrl:
2979 remoteUrl = self.gitGetRemoteUrl(repodir, remoteName) 2979 remoteUrl = self.gitGetRemoteUrl(repodir, remoteName)
2980 2980
2981 from .GitChangeRemoteUrlDialog import GitChangeRemoteUrlDialog 2981 from .GitChangeRemoteUrlDialog import GitChangeRemoteUrlDialog
2982 dlg = GitChangeRemoteUrlDialog(remoteName, remoteUrl) 2982 dlg = GitChangeRemoteUrlDialog(remoteName, remoteUrl)
2983 if dlg.exec() == QDialog.Accepted: 2983 if dlg.exec() == QDialog.DialogCode.Accepted:
2984 name, url = dlg.getData() 2984 name, url = dlg.getData()
2985 if url != remoteUrl: 2985 if url != remoteUrl:
2986 args = self.initCommand("remote") 2986 args = self.initCommand("remote")
2987 args.append("set-url") 2987 args.append("set-url")
2988 args.append(name) 2988 args.append(name)
3012 if not remoteUrl: 3012 if not remoteUrl:
3013 remoteUrl = self.gitGetRemoteUrl(repodir, remoteName) 3013 remoteUrl = self.gitGetRemoteUrl(repodir, remoteName)
3014 3014
3015 from .GitRemoteCredentialsDialog import GitRemoteCredentialsDialog 3015 from .GitRemoteCredentialsDialog import GitRemoteCredentialsDialog
3016 dlg = GitRemoteCredentialsDialog(remoteName, remoteUrl) 3016 dlg = GitRemoteCredentialsDialog(remoteName, remoteUrl)
3017 if dlg.exec() == QDialog.Accepted: 3017 if dlg.exec() == QDialog.DialogCode.Accepted:
3018 name, url = dlg.getData() 3018 name, url = dlg.getData()
3019 if url != remoteUrl: 3019 if url != remoteUrl:
3020 args = self.initCommand("remote") 3020 args = self.initCommand("remote")
3021 args.append("set-url") 3021 args.append("set-url")
3022 args.append(name) 3022 args.append(name)
3130 3130
3131 res = False 3131 res = False
3132 3132
3133 from .GitCherryPickDialog import GitCherryPickDialog 3133 from .GitCherryPickDialog import GitCherryPickDialog
3134 dlg = GitCherryPickDialog(commits) 3134 dlg = GitCherryPickDialog(commits)
3135 if dlg.exec() == QDialog.Accepted: 3135 if dlg.exec() == QDialog.DialogCode.Accepted:
3136 commits, cherrypickInfo, signoff, nocommit = ( 3136 commits, cherrypickInfo, signoff, nocommit = (
3137 dlg.getData() 3137 dlg.getData()
3138 ) 3138 )
3139 3139
3140 args = self.initCommand("cherry-pick") 3140 args = self.initCommand("cherry-pick")
3292 return False 3292 return False
3293 3293
3294 res = False 3294 res = False
3295 from .GitStashDataDialog import GitStashDataDialog 3295 from .GitStashDataDialog import GitStashDataDialog
3296 dlg = GitStashDataDialog() 3296 dlg = GitStashDataDialog()
3297 if dlg.exec() == QDialog.Accepted: 3297 if dlg.exec() == QDialog.DialogCode.Accepted:
3298 message, keepIndex, untracked = dlg.getData() 3298 message, keepIndex, untracked = dlg.getData()
3299 args = self.initCommand("stash") 3299 args = self.initCommand("stash")
3300 args.append("save") 3300 args.append("save")
3301 if keepIndex: 3301 if keepIndex:
3302 args.append("--keep-index") 3302 args.append("--keep-index")
3458 3458
3459 branchName, ok = QInputDialog.getText( 3459 branchName, ok = QInputDialog.getText(
3460 None, 3460 None,
3461 self.tr("Create Branch"), 3461 self.tr("Create Branch"),
3462 self.tr("Enter a branch name to restore a stash to:"), 3462 self.tr("Enter a branch name to restore a stash to:"),
3463 QLineEdit.Normal) 3463 QLineEdit.EchoMode.Normal)
3464 if not ok or branchName == "": 3464 if not ok or branchName == "":
3465 return False 3465 return False
3466 3466
3467 if not stashName: 3467 if not stashName:
3468 availableStashes = self.__gitGetStashesList(repodir) 3468 availableStashes = self.__gitGetStashesList(repodir)
3591 from .GitUtilities import getConfigPath 3591 from .GitUtilities import getConfigPath
3592 cfgFile = getConfigPath() 3592 cfgFile = getConfigPath()
3593 if not os.path.exists(cfgFile): 3593 if not os.path.exists(cfgFile):
3594 from .GitUserConfigDataDialog import GitUserConfigDataDialog 3594 from .GitUserConfigDataDialog import GitUserConfigDataDialog
3595 dlg = GitUserConfigDataDialog() 3595 dlg = GitUserConfigDataDialog()
3596 if dlg.exec() == QDialog.Accepted: 3596 if dlg.exec() == QDialog.DialogCode.Accepted:
3597 firstName, lastName, email = dlg.getData() 3597 firstName, lastName, email = dlg.getData()
3598 else: 3598 else:
3599 firstName, lastName, email = ( 3599 firstName, lastName, email = (
3600 "Firstname", "Lastname", "email_address") 3600 "Firstname", "Lastname", "email_address")
3601 try: 3601 try:
3805 dlg = GitArchiveDataDialog( 3805 dlg = GitArchiveDataDialog(
3806 self.gitGetTagsList(repodir), 3806 self.gitGetTagsList(repodir),
3807 self.gitGetBranchesList(repodir, withMaster=True), 3807 self.gitGetBranchesList(repodir, withMaster=True),
3808 self.gitGetArchiveFormats(repodir) 3808 self.gitGetArchiveFormats(repodir)
3809 ) 3809 )
3810 if dlg.exec() == QDialog.Accepted: 3810 if dlg.exec() == QDialog.DialogCode.Accepted:
3811 commit, archiveFormat, fileName, prefix = dlg.getData() 3811 commit, archiveFormat, fileName, prefix = dlg.getData()
3812 args = self.initCommand("archive") 3812 args = self.initCommand("archive")
3813 args.append("--format={0}".format(archiveFormat)) 3813 args.append("--format={0}".format(archiveFormat))
3814 args.append("--output={0}".format(fileName)) 3814 args.append("--output={0}".format(fileName))
3815 if prefix: 3815 if prefix:
3844 if os.path.splitdrive(repodir)[1] == os.sep: 3844 if os.path.splitdrive(repodir)[1] == os.sep:
3845 return 3845 return
3846 3846
3847 from .GitSubmoduleAddDialog import GitSubmoduleAddDialog 3847 from .GitSubmoduleAddDialog import GitSubmoduleAddDialog
3848 dlg = GitSubmoduleAddDialog(self, repodir) 3848 dlg = GitSubmoduleAddDialog(self, repodir)
3849 if dlg.exec() == QDialog.Accepted: 3849 if dlg.exec() == QDialog.DialogCode.Accepted:
3850 repo, branch, name, path, force = dlg.getData() 3850 repo, branch, name, path, force = dlg.getData()
3851 args = self.initCommand("submodule") 3851 args = self.initCommand("submodule")
3852 args.append("add") 3852 args.append("add")
3853 if branch: 3853 if branch:
3854 args.append("--branch") 3854 args.append("--branch")
3971 paths = [submodule["path"] 3971 paths = [submodule["path"]
3972 for submodule in self.__gitSubmodulesList(repodir)] 3972 for submodule in self.__gitSubmodulesList(repodir)]
3973 3973
3974 from .GitListDialog import GitListDialog 3974 from .GitListDialog import GitListDialog
3975 dlg = GitListDialog(sorted(paths)) 3975 dlg = GitListDialog(sorted(paths))
3976 if dlg.exec() == QDialog.Accepted: 3976 if dlg.exec() == QDialog.DialogCode.Accepted:
3977 selectedPaths = dlg.getSelection() 3977 selectedPaths = dlg.getSelection()
3978 return selectedPaths, True 3978 return selectedPaths, True
3979 else: 3979 else:
3980 return [], False 3980 return [], False
3981 3981
4023 paths = [submodule["path"] 4023 paths = [submodule["path"]
4024 for submodule in self.__gitSubmodulesList(repodir)] 4024 for submodule in self.__gitSubmodulesList(repodir)]
4025 4025
4026 from .GitSubmodulesDeinitDialog import GitSubmodulesDeinitDialog 4026 from .GitSubmodulesDeinitDialog import GitSubmodulesDeinitDialog
4027 dlg = GitSubmodulesDeinitDialog(paths) 4027 dlg = GitSubmodulesDeinitDialog(paths)
4028 if dlg.exec() == QDialog.Accepted: 4028 if dlg.exec() == QDialog.DialogCode.Accepted:
4029 deinitAll, submodulePaths, force = dlg.getData() 4029 deinitAll, submodulePaths, force = dlg.getData()
4030 args = self.initCommand("submodule") 4030 args = self.initCommand("submodule")
4031 args.append("deinit") 4031 args.append("deinit")
4032 if deinitAll: 4032 if deinitAll:
4033 args.append("--all") 4033 args.append("--all")
4098 4098
4099 from .GitSubmodulesUpdateOptionsDialog import ( 4099 from .GitSubmodulesUpdateOptionsDialog import (
4100 GitSubmodulesUpdateOptionsDialog 4100 GitSubmodulesUpdateOptionsDialog
4101 ) 4101 )
4102 dlg = GitSubmodulesUpdateOptionsDialog(paths) 4102 dlg = GitSubmodulesUpdateOptionsDialog(paths)
4103 if dlg.exec() == QDialog.Accepted: 4103 if dlg.exec() == QDialog.DialogCode.Accepted:
4104 procedure, init, remote, noFetch, force, submodulePaths = ( 4104 procedure, init, remote, noFetch, force, submodulePaths = (
4105 dlg.getData() 4105 dlg.getData()
4106 ) 4106 )
4107 4107
4108 args = self.initCommand("submodule") 4108 args = self.initCommand("submodule")
4142 paths = [submodule["path"] 4142 paths = [submodule["path"]
4143 for submodule in self.__gitSubmodulesList(repodir)] 4143 for submodule in self.__gitSubmodulesList(repodir)]
4144 4144
4145 from .GitSubmodulesSyncDialog import GitSubmodulesSyncDialog 4145 from .GitSubmodulesSyncDialog import GitSubmodulesSyncDialog
4146 dlg = GitSubmodulesSyncDialog(paths) 4146 dlg = GitSubmodulesSyncDialog(paths)
4147 if dlg.exec() == QDialog.Accepted: 4147 if dlg.exec() == QDialog.DialogCode.Accepted:
4148 submodulePaths, recursive = dlg.getData() 4148 submodulePaths, recursive = dlg.getData()
4149 args = self.initCommand("submodule") 4149 args = self.initCommand("submodule")
4150 args.append("sync") 4150 args.append("sync")
4151 if recursive: 4151 if recursive:
4152 args.append("--recursive") 4152 args.append("--recursive")
4192 4192
4193 from .GitSubmodulesSummaryOptionsDialog import ( 4193 from .GitSubmodulesSummaryOptionsDialog import (
4194 GitSubmodulesSummaryOptionsDialog 4194 GitSubmodulesSummaryOptionsDialog
4195 ) 4195 )
4196 dlg = GitSubmodulesSummaryOptionsDialog(paths) 4196 dlg = GitSubmodulesSummaryOptionsDialog(paths)
4197 if dlg.exec() == QDialog.Accepted: 4197 if dlg.exec() == QDialog.DialogCode.Accepted:
4198 submodulePaths, superProject, index, commit, limit = dlg.getData() 4198 submodulePaths, superProject, index, commit, limit = dlg.getData()
4199 args = self.initCommand("submodule") 4199 args = self.initCommand("submodule")
4200 args.append("summary") 4200 args.append("summary")
4201 if superProject: 4201 if superProject:
4202 args.append("--files") 4202 args.append("--files")

eric ide

mercurial