eric6/Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py

changeset 7970
c4ee8a81584c
parent 7923
91e843545d9a
child 7971
ff2971513d6d
equal deleted inserted replaced
7969:62eff8b34a8d 7970:c4ee8a81584c
1306 self.hgOutgoingAct.setEnabled(self.vcs.canPush()) 1306 self.hgOutgoingAct.setEnabled(self.vcs.canPush())
1307 self.hgBookmarkPushAct.setEnabled(self.vcs.canPush()) 1307 self.hgBookmarkPushAct.setEnabled(self.vcs.canPush())
1308 self.hgBookmarkOutgoingAct.setEnabled(self.vcs.canPush()) 1308 self.hgBookmarkOutgoingAct.setEnabled(self.vcs.canPush())
1309 if self.vcs.version >= (3, 8): 1309 if self.vcs.version >= (3, 8):
1310 self.hgBookmarkPushCurrentAct.setEnabled(self.vcs.canPull()) 1310 self.hgBookmarkPushCurrentAct.setEnabled(self.vcs.canPull())
1311 self.hgCommitMergeAct.setEnabled( 1311 self.hgCommitMergeAct.setEnabled(self.vcs.canCommitMerge())
1312 self.vcs.canCommitMerge(self.project.ppath))
1313 1312
1314 def initMenu(self, menu): 1313 def initMenu(self, menu):
1315 """ 1314 """
1316 Public method to generate the VCS menu. 1315 Public method to generate the VCS menu.
1317 1316
1652 def __hgIncoming(self): 1651 def __hgIncoming(self):
1653 """ 1652 """
1654 Private slot used to show the log of changes coming into the 1653 Private slot used to show the log of changes coming into the
1655 repository. 1654 repository.
1656 """ 1655 """
1657 self.vcs.hgIncoming(self.project.ppath) 1656 self.vcs.hgIncoming()
1658 1657
1659 def __hgOutgoing(self): 1658 def __hgOutgoing(self):
1660 """ 1659 """
1661 Private slot used to show the log of changes going out of the 1660 Private slot used to show the log of changes going out of the
1662 repository. 1661 repository.
1663 """ 1662 """
1664 self.vcs.hgOutgoing(self.project.ppath) 1663 self.vcs.hgOutgoing()
1665 1664
1666 def __hgPull(self): 1665 def __hgPull(self):
1667 """ 1666 """
1668 Private slot used to pull changes from a remote repository. 1667 Private slot used to pull changes from a remote repository.
1669 """ 1668 """
1670 shouldReopen = self.vcs.hgPull(self.project.ppath) 1669 shouldReopen = self.vcs.hgPull()
1671 if shouldReopen: 1670 if shouldReopen:
1672 res = E5MessageBox.yesNo( 1671 res = E5MessageBox.yesNo(
1673 self.parent(), 1672 self.parent(),
1674 self.tr("Pull"), 1673 self.tr("Pull"),
1675 self.tr("""The project should be reread. Do this now?"""), 1674 self.tr("""The project should be reread. Do this now?"""),
1679 1678
1680 def __hgPush(self): 1679 def __hgPush(self):
1681 """ 1680 """
1682 Private slot used to push changes to a remote repository. 1681 Private slot used to push changes to a remote repository.
1683 """ 1682 """
1684 self.vcs.hgPush(self.project.ppath) 1683 self.vcs.hgPush()
1685 1684
1686 def __hgPushForced(self): 1685 def __hgPushForced(self):
1687 """ 1686 """
1688 Private slot used to push changes to a remote repository using 1687 Private slot used to push changes to a remote repository using
1689 the force option. 1688 the force option.
1690 """ 1689 """
1691 self.vcs.hgPush(self.project.ppath, force=True) 1690 self.vcs.hgPush(force=True)
1692 1691
1693 def __hgHeads(self): 1692 def __hgHeads(self):
1694 """ 1693 """
1695 Private slot used to show the heads of the repository. 1694 Private slot used to show the heads of the repository.
1696 """ 1695 """
1697 self.vcs.hgInfo(self.project.ppath, mode="heads") 1696 self.vcs.hgInfo(mode="heads")
1698 1697
1699 def __hgParents(self): 1698 def __hgParents(self):
1700 """ 1699 """
1701 Private slot used to show the parents of the repository. 1700 Private slot used to show the parents of the repository.
1702 """ 1701 """
1703 self.vcs.hgInfo(self.project.ppath, mode="parents") 1702 self.vcs.hgInfo(mode="parents")
1704 1703
1705 def __hgTip(self): 1704 def __hgTip(self):
1706 """ 1705 """
1707 Private slot used to show the tip of the repository. 1706 Private slot used to show the tip of the repository.
1708 """ 1707 """
1709 self.vcs.hgInfo(self.project.ppath, mode="tip") 1708 self.vcs.hgInfo(mode="tip")
1710 1709
1711 def __hgResolved(self): 1710 def __hgResolved(self):
1712 """ 1711 """
1713 Private slot used to mark conflicts of the local project as being 1712 Private slot used to mark conflicts of the local project as being
1714 resolved. 1713 resolved.
1730 1729
1731 def __hgAbortMerge(self): 1730 def __hgAbortMerge(self):
1732 """ 1731 """
1733 Private slot used to abort an uncommitted merge. 1732 Private slot used to abort an uncommitted merge.
1734 """ 1733 """
1735 self.vcs.hgAbortMerge(self.project.ppath) 1734 self.vcs.hgAbortMerge()
1736 1735
1737 def __hgShowConflicts(self): 1736 def __hgShowConflicts(self):
1738 """ 1737 """
1739 Private slot used to list all files with conflicts. 1738 Private slot used to list all files with conflicts.
1740 """ 1739 """
1741 self.vcs.hgConflicts(self.project.ppath) 1740 self.vcs.hgConflicts()
1742 1741
1743 def __hgReMerge(self): 1742 def __hgReMerge(self):
1744 """ 1743 """
1745 Private slot used to list all files with conflicts. 1744 Private slot used to list all files with conflicts.
1746 """ 1745 """
1748 1747
1749 def __hgTagList(self): 1748 def __hgTagList(self):
1750 """ 1749 """
1751 Private slot used to list the tags of the project. 1750 Private slot used to list the tags of the project.
1752 """ 1751 """
1753 self.vcs.hgListTagBranch(self.project.ppath, True) 1752 self.vcs.hgListTagBranch(True)
1754 1753
1755 def __hgBranchList(self): 1754 def __hgBranchList(self):
1756 """ 1755 """
1757 Private slot used to list the branches of the project. 1756 Private slot used to list the branches of the project.
1758 """ 1757 """
1759 self.vcs.hgListTagBranch(self.project.ppath, False) 1758 self.vcs.hgListTagBranch(False)
1760 1759
1761 def __hgBranch(self): 1760 def __hgBranch(self):
1762 """ 1761 """
1763 Private slot used to create a new branch for the project. 1762 Private slot used to create a new branch for the project.
1764 """ 1763 """
1765 self.vcs.hgBranch(self.project.ppath) 1764 self.vcs.hgBranch()
1766 1765
1767 def __hgShowBranch(self): 1766 def __hgShowBranch(self):
1768 """ 1767 """
1769 Private slot used to show the current branch for the project. 1768 Private slot used to show the current branch for the project.
1770 """ 1769 """
1771 self.vcs.hgShowBranch(self.project.ppath) 1770 self.vcs.hgShowBranch()
1772 1771
1773 def __hgConfigure(self): 1772 def __hgConfigure(self):
1774 """ 1773 """
1775 Private method to open the configuration dialog. 1774 Private method to open the configuration dialog.
1776 """ 1775 """
1788 1787
1789 def __hgPushNewBranch(self): 1788 def __hgPushNewBranch(self):
1790 """ 1789 """
1791 Private slot to push a new named branch. 1790 Private slot to push a new named branch.
1792 """ 1791 """
1793 self.vcs.hgPush(self.project.ppath, newBranch=True) 1792 self.vcs.hgPush(newBranch=True)
1794 1793
1795 def __hgEditUserConfig(self): 1794 def __hgEditUserConfig(self):
1796 """ 1795 """
1797 Private slot used to edit the user configuration file. 1796 Private slot used to edit the user configuration file.
1798 """ 1797 """
1806 1805
1807 def __hgShowConfig(self): 1806 def __hgShowConfig(self):
1808 """ 1807 """
1809 Private slot used to show the combined configuration. 1808 Private slot used to show the combined configuration.
1810 """ 1809 """
1811 self.vcs.hgShowConfig(self.project.ppath) 1810 self.vcs.hgShowConfig()
1812 1811
1813 def __hgVerify(self): 1812 def __hgVerify(self):
1814 """ 1813 """
1815 Private slot used to verify the integrity of the repository. 1814 Private slot used to verify the integrity of the repository.
1816 """ 1815 """
1817 self.vcs.hgVerify(self.project.ppath) 1816 self.vcs.hgVerify()
1818 1817
1819 def __hgShowPaths(self): 1818 def __hgShowPaths(self):
1820 """ 1819 """
1821 Private slot used to show the aliases for remote repositories. 1820 Private slot used to show the aliases for remote repositories.
1822 """ 1821 """
1823 self.vcs.hgShowPaths(self.project.ppath) 1822 self.vcs.hgShowPaths()
1824 1823
1825 def __hgRecover(self): 1824 def __hgRecover(self):
1826 """ 1825 """
1827 Private slot used to recover from an interrupted transaction. 1826 Private slot used to recover from an interrupted transaction.
1828 """ 1827 """
1829 self.vcs.hgRecover(self.project.ppath) 1828 self.vcs.hgRecover()
1830 1829
1831 def __hgIdentify(self): 1830 def __hgIdentify(self):
1832 """ 1831 """
1833 Private slot used to identify the project directory. 1832 Private slot used to identify the project directory.
1834 """ 1833 """
1835 self.vcs.hgIdentify(self.project.ppath) 1834 self.vcs.hgIdentify()
1836 1835
1837 def __hgCreateIgnore(self): 1836 def __hgCreateIgnore(self):
1838 """ 1837 """
1839 Private slot used to create a .hgignore file for the project. 1838 Private slot used to create a .hgignore file for the project.
1840 """ 1839 """
1842 1841
1843 def __hgBundle(self): 1842 def __hgBundle(self):
1844 """ 1843 """
1845 Private slot used to create a changegroup file. 1844 Private slot used to create a changegroup file.
1846 """ 1845 """
1847 self.vcs.hgBundle(self.project.ppath) 1846 self.vcs.hgBundle()
1848 1847
1849 def __hgPreviewBundle(self): 1848 def __hgPreviewBundle(self):
1850 """ 1849 """
1851 Private slot used to preview a changegroup file. 1850 Private slot used to preview a changegroup file.
1852 """ 1851 """
1853 self.vcs.hgPreviewBundle(self.project.ppath) 1852 self.vcs.hgPreviewBundle()
1854 1853
1855 def __hgUnbundle(self): 1854 def __hgUnbundle(self):
1856 """ 1855 """
1857 Private slot used to apply changegroup files. 1856 Private slot used to apply changegroup files.
1858 """ 1857 """
1859 shouldReopen = self.vcs.hgUnbundle(self.project.ppath) 1858 shouldReopen = self.vcs.hgUnbundle()
1860 if shouldReopen: 1859 if shouldReopen:
1861 res = E5MessageBox.yesNo( 1860 res = E5MessageBox.yesNo(
1862 self.parent(), 1861 self.parent(),
1863 self.tr("Apply changegroups"), 1862 self.tr("Apply changegroups"),
1864 self.tr("""The project should be reread. Do this now?"""), 1863 self.tr("""The project should be reread. Do this now?"""),
1868 1867
1869 def __hgBisectGood(self): 1868 def __hgBisectGood(self):
1870 """ 1869 """
1871 Private slot used to execute the bisect --good command. 1870 Private slot used to execute the bisect --good command.
1872 """ 1871 """
1873 self.vcs.hgBisect(self.project.ppath, "good") 1872 self.vcs.hgBisect("good")
1874 1873
1875 def __hgBisectBad(self): 1874 def __hgBisectBad(self):
1876 """ 1875 """
1877 Private slot used to execute the bisect --bad command. 1876 Private slot used to execute the bisect --bad command.
1878 """ 1877 """
1879 self.vcs.hgBisect(self.project.ppath, "bad") 1878 self.vcs.hgBisect("bad")
1880 1879
1881 def __hgBisectSkip(self): 1880 def __hgBisectSkip(self):
1882 """ 1881 """
1883 Private slot used to execute the bisect --skip command. 1882 Private slot used to execute the bisect --skip command.
1884 """ 1883 """
1885 self.vcs.hgBisect(self.project.ppath, "skip") 1884 self.vcs.hgBisect("skip")
1886 1885
1887 def __hgBisectReset(self): 1886 def __hgBisectReset(self):
1888 """ 1887 """
1889 Private slot used to execute the bisect --reset command. 1888 Private slot used to execute the bisect --reset command.
1890 """ 1889 """
1891 self.vcs.hgBisect(self.project.ppath, "reset") 1890 self.vcs.hgBisect("reset")
1892 1891
1893 def __hgBackout(self): 1892 def __hgBackout(self):
1894 """ 1893 """
1895 Private slot used to back out changes of a changeset. 1894 Private slot used to back out changes of a changeset.
1896 """ 1895 """
1897 self.vcs.hgBackout(self.project.ppath) 1896 self.vcs.hgBackout()
1898 1897
1899 def __hgRollback(self): 1898 def __hgRollback(self):
1900 """ 1899 """
1901 Private slot used to rollback the last transaction. 1900 Private slot used to rollback the last transaction.
1902 """ 1901 """
1903 self.vcs.hgRollback(self.project.ppath) 1902 self.vcs.hgRollback()
1904 1903
1905 def __hgServe(self): 1904 def __hgServe(self):
1906 """ 1905 """
1907 Private slot used to serve the project. 1906 Private slot used to serve the project.
1908 """ 1907 """
1910 1909
1911 def __hgImport(self): 1910 def __hgImport(self):
1912 """ 1911 """
1913 Private slot used to import a patch file. 1912 Private slot used to import a patch file.
1914 """ 1913 """
1915 shouldReopen = self.vcs.hgImport(self.project.ppath) 1914 shouldReopen = self.vcs.hgImport()
1916 if shouldReopen: 1915 if shouldReopen:
1917 res = E5MessageBox.yesNo( 1916 res = E5MessageBox.yesNo(
1918 self.parent(), 1917 self.parent(),
1919 self.tr("Import Patch"), 1918 self.tr("Import Patch"),
1920 self.tr("""The project should be reread. Do this now?"""), 1919 self.tr("""The project should be reread. Do this now?"""),
1924 1923
1925 def __hgExport(self): 1924 def __hgExport(self):
1926 """ 1925 """
1927 Private slot used to export revisions to patch files. 1926 Private slot used to export revisions to patch files.
1928 """ 1927 """
1929 self.vcs.hgExport(self.project.ppath) 1928 self.vcs.hgExport()
1930 1929
1931 def __hgRevert(self): 1930 def __hgRevert(self):
1932 """ 1931 """
1933 Private slot used to revert changes made to the local project. 1932 Private slot used to revert changes made to the local project.
1934 """ 1933 """
1944 1943
1945 def __hgPhase(self): 1944 def __hgPhase(self):
1946 """ 1945 """
1947 Private slot used to change the phase of revisions. 1946 Private slot used to change the phase of revisions.
1948 """ 1947 """
1949 self.vcs.hgPhase(self.project.ppath) 1948 self.vcs.hgPhase()
1950 1949
1951 def __hgGraft(self): 1950 def __hgGraft(self):
1952 """ 1951 """
1953 Private slot used to copy changesets from another branch. 1952 Private slot used to copy changesets from another branch.
1954 """ 1953 """
1955 shouldReopen = self.vcs.hgGraft(self.project.getProjectPath()) 1954 shouldReopen = self.vcs.hgGraft()
1956 if shouldReopen: 1955 if shouldReopen:
1957 res = E5MessageBox.yesNo( 1956 res = E5MessageBox.yesNo(
1958 None, 1957 None,
1959 self.tr("Copy Changesets"), 1958 self.tr("Copy Changesets"),
1960 self.tr("""The project should be reread. Do this now?"""), 1959 self.tr("""The project should be reread. Do this now?"""),
1965 def __hgGraftContinue(self): 1964 def __hgGraftContinue(self):
1966 """ 1965 """
1967 Private slot used to continue the last copying session after conflicts 1966 Private slot used to continue the last copying session after conflicts
1968 were resolved. 1967 were resolved.
1969 """ 1968 """
1970 shouldReopen = self.vcs.hgGraftContinue(self.project.getProjectPath()) 1969 shouldReopen = self.vcs.hgGraftContinue()
1971 if shouldReopen: 1970 if shouldReopen:
1972 res = E5MessageBox.yesNo( 1971 res = E5MessageBox.yesNo(
1973 None, 1972 None,
1974 self.tr("Copy Changesets (Continue)"), 1973 self.tr("Copy Changesets (Continue)"),
1975 self.tr("""The project should be reread. Do this now?"""), 1974 self.tr("""The project should be reread. Do this now?"""),
1979 1978
1980 def __hgGraftStop(self): 1979 def __hgGraftStop(self):
1981 """ 1980 """
1982 Private slot used to stop an interrupted copying session. 1981 Private slot used to stop an interrupted copying session.
1983 """ 1982 """
1984 shouldReopen = self.vcs.hgGraftStop(self.project.getProjectPath()) 1983 shouldReopen = self.vcs.hgGraftStop()
1985 if shouldReopen: 1984 if shouldReopen:
1986 res = E5MessageBox.yesNo( 1985 res = E5MessageBox.yesNo(
1987 None, 1986 None,
1988 self.tr("Copy Changesets (Stop)"), 1987 self.tr("Copy Changesets (Stop)"),
1989 self.tr("""The project should be reread. Do this now?"""), 1988 self.tr("""The project should be reread. Do this now?"""),
1994 def __hgGraftAbort(self): 1993 def __hgGraftAbort(self):
1995 """ 1994 """
1996 Private slot used to abort an interrupted copying session and perform 1995 Private slot used to abort an interrupted copying session and perform
1997 a rollback. 1996 a rollback.
1998 """ 1997 """
1999 shouldReopen = self.vcs.hgGraftAbort(self.project.getProjectPath()) 1998 shouldReopen = self.vcs.hgGraftAbort()
2000 if shouldReopen: 1999 if shouldReopen:
2001 res = E5MessageBox.yesNo( 2000 res = E5MessageBox.yesNo(
2002 None, 2001 None,
2003 self.tr("Copy Changesets (Abort)"), 2002 self.tr("Copy Changesets (Abort)"),
2004 self.tr("""The project should be reread. Do this now?"""), 2003 self.tr("""The project should be reread. Do this now?"""),
2032 2031
2033 def __hgBookmarksList(self): 2032 def __hgBookmarksList(self):
2034 """ 2033 """
2035 Private slot used to list the bookmarks. 2034 Private slot used to list the bookmarks.
2036 """ 2035 """
2037 self.vcs.hgListBookmarks(self.project.getProjectPath()) 2036 self.vcs.hgListBookmarks()
2038 2037
2039 def __hgBookmarkDefine(self): 2038 def __hgBookmarkDefine(self):
2040 """ 2039 """
2041 Private slot used to define a bookmark. 2040 Private slot used to define a bookmark.
2042 """ 2041 """
2043 self.vcs.hgBookmarkDefine(self.project.getProjectPath()) 2042 self.vcs.hgBookmarkDefine()
2044 2043
2045 def __hgBookmarkDelete(self): 2044 def __hgBookmarkDelete(self):
2046 """ 2045 """
2047 Private slot used to delete a bookmark. 2046 Private slot used to delete a bookmark.
2048 """ 2047 """
2049 self.vcs.hgBookmarkDelete(self.project.getProjectPath()) 2048 self.vcs.hgBookmarkDelete()
2050 2049
2051 def __hgBookmarkRename(self): 2050 def __hgBookmarkRename(self):
2052 """ 2051 """
2053 Private slot used to rename a bookmark. 2052 Private slot used to rename a bookmark.
2054 """ 2053 """
2055 self.vcs.hgBookmarkRename(self.project.getProjectPath()) 2054 self.vcs.hgBookmarkRename()
2056 2055
2057 def __hgBookmarkMove(self): 2056 def __hgBookmarkMove(self):
2058 """ 2057 """
2059 Private slot used to move a bookmark. 2058 Private slot used to move a bookmark.
2060 """ 2059 """
2061 self.vcs.hgBookmarkMove(self.project.getProjectPath()) 2060 self.vcs.hgBookmarkMove()
2062 2061
2063 def __hgBookmarkIncoming(self): 2062 def __hgBookmarkIncoming(self):
2064 """ 2063 """
2065 Private slot used to show a list of incoming bookmarks. 2064 Private slot used to show a list of incoming bookmarks.
2066 """ 2065 """
2067 self.vcs.hgBookmarkIncoming(self.project.getProjectPath()) 2066 self.vcs.hgBookmarkIncoming()
2068 2067
2069 def __hgBookmarkOutgoing(self): 2068 def __hgBookmarkOutgoing(self):
2070 """ 2069 """
2071 Private slot used to show a list of outgoing bookmarks. 2070 Private slot used to show a list of outgoing bookmarks.
2072 """ 2071 """
2073 self.vcs.hgBookmarkOutgoing(self.project.getProjectPath()) 2072 self.vcs.hgBookmarkOutgoing()
2074 2073
2075 def __hgBookmarkPull(self): 2074 def __hgBookmarkPull(self):
2076 """ 2075 """
2077 Private slot used to pull a bookmark from a remote repository. 2076 Private slot used to pull a bookmark from a remote repository.
2078 """ 2077 """
2079 self.vcs.hgBookmarkPull(self.project.getProjectPath()) 2078 self.vcs.hgBookmarkPull()
2080 2079
2081 def __hgBookmarkPullCurrent(self): 2080 def __hgBookmarkPullCurrent(self):
2082 """ 2081 """
2083 Private slot used to pull the current bookmark from a remote 2082 Private slot used to pull the current bookmark from a remote
2084 repository. 2083 repository.
2085 """ 2084 """
2086 self.vcs.hgBookmarkPull(self.project.getProjectPath(), current=True) 2085 self.vcs.hgBookmarkPull(current=True)
2087 2086
2088 def __hgBookmarkPush(self): 2087 def __hgBookmarkPush(self):
2089 """ 2088 """
2090 Private slot used to push a bookmark to a remote repository. 2089 Private slot used to push a bookmark to a remote repository.
2091 """ 2090 """
2092 self.vcs.hgBookmarkPush(self.project.getProjectPath()) 2091 self.vcs.hgBookmarkPush()
2093 2092
2094 def __hgBookmarkPushCurrent(self): 2093 def __hgBookmarkPushCurrent(self):
2095 """ 2094 """
2096 Private slot used to push the current bookmark to a remote repository. 2095 Private slot used to push the current bookmark to a remote repository.
2097 """ 2096 """
2098 self.vcs.hgBookmarkPush(self.project.getProjectPath(), current=True) 2097 self.vcs.hgBookmarkPush(current=True)
2099 2098
2100 def __hgDeleteBackups(self): 2099 def __hgDeleteBackups(self):
2101 """ 2100 """
2102 Private slot used to delete all backup bundles. 2101 Private slot used to delete all backup bundles.
2103 """ 2102 """

eric ide

mercurial