41 from .SvnNewProjectOptionsDialog import SvnNewProjectOptionsDialog |
41 from .SvnNewProjectOptionsDialog import SvnNewProjectOptionsDialog |
42 from .SvnBlameDialog import SvnBlameDialog |
42 from .SvnBlameDialog import SvnBlameDialog |
43 from .SvnRelocateDialog import SvnRelocateDialog |
43 from .SvnRelocateDialog import SvnRelocateDialog |
44 from .SvnUrlSelectionDialog import SvnUrlSelectionDialog |
44 from .SvnUrlSelectionDialog import SvnUrlSelectionDialog |
45 from .SvnRepoBrowserDialog import SvnRepoBrowserDialog |
45 from .SvnRepoBrowserDialog import SvnRepoBrowserDialog |
|
46 from .SvnChangeListsDialog import SvnChangeListsDialog |
46 from .SvnStatusMonitorThread import SvnStatusMonitorThread |
47 from .SvnStatusMonitorThread import SvnStatusMonitorThread |
47 from .SvnUtilities import getConfigPath, amendConfig, createDefaultConfig |
48 from .SvnUtilities import getConfigPath, amendConfig, createDefaultConfig |
48 |
49 |
49 from .ProjectBrowserHelper import SvnProjectBrowserHelper |
50 from .ProjectBrowserHelper import SvnProjectBrowserHelper |
50 |
51 |
1927 Note: Directories will be added recursively. |
1928 Note: Directories will be added recursively. |
1928 |
1929 |
1929 @param names name or list of names of file or directory to add |
1930 @param names name or list of names of file or directory to add |
1930 (string) |
1931 (string) |
1931 """ |
1932 """ |
1932 clname, ok = QInputDialog.getText( |
1933 clname, ok = QInputDialog.getItem( |
1933 None, |
1934 None, |
1934 self.trUtf8("Add to changelist"), |
1935 self.trUtf8("Add to changelist"), |
1935 self.trUtf8("Enter name of the changelist:"), |
1936 self.trUtf8("Enter name of the changelist:"), |
1936 QLineEdit.Normal) |
1937 sorted(self.svnGetChangelists()), |
|
1938 0, True) |
1937 if not ok or not clname: |
1939 if not ok or not clname: |
1938 return |
1940 return |
1939 |
1941 |
1940 args = [] |
1942 args = [] |
1941 args.append('changelist') |
1943 args.append('changelist') |
1951 |
1953 |
1952 dia = SvnDialog(self.trUtf8('Remove from changelist')) |
1954 dia = SvnDialog(self.trUtf8('Remove from changelist')) |
1953 res = dia.startProcess(args, dname) |
1955 res = dia.startProcess(args, dname) |
1954 if res: |
1956 if res: |
1955 dia.exec_() |
1957 dia.exec_() |
|
1958 |
|
1959 def svnShowChangelists(self, path): |
|
1960 """ |
|
1961 Public method used to inspect the change lists defined for the project. |
|
1962 |
|
1963 @param path directory name to show change lists for (string) |
|
1964 """ |
|
1965 self.changeLists = SvnChangeListsDialog(self) |
|
1966 self.changeLists.show() |
|
1967 QApplication.processEvents() |
|
1968 self.changeLists.start(path) |
|
1969 |
|
1970 def svnGetChangelists(self): |
|
1971 """ |
|
1972 Public method to get a list of all defined change lists. |
|
1973 |
|
1974 @return list of defined change list names (list of strings) |
|
1975 """ |
|
1976 changelists = [] |
|
1977 rx_changelist = \ |
|
1978 QRegExp('--- \\S+ .([\\w\\s]+).:\\s*') |
|
1979 # three dashes, Changelist (translated), quote, |
|
1980 # changelist name, quote, : |
|
1981 |
|
1982 args = [] |
|
1983 args.append("status") |
|
1984 args.append("--non-interactive") |
|
1985 args.append(".") |
|
1986 |
|
1987 ppath = e5App().getObject("Project").getProjectPath() |
|
1988 process = QProcess() |
|
1989 process.setWorkingDirectory(ppath) |
|
1990 process.start('svn', args) |
|
1991 procStarted = process.waitForStarted() |
|
1992 if procStarted: |
|
1993 finished = process.waitForFinished(30000) |
|
1994 if finished and process.exitCode() == 0: |
|
1995 output = \ |
|
1996 str(process.readAllStandardOutput(), |
|
1997 Preferences.getSystem("IOEncoding"), |
|
1998 'replace') |
|
1999 if output: |
|
2000 for line in output.splitlines(): |
|
2001 if rx_changelist.exactMatch(line): |
|
2002 changelist = rx_changelist.cap(1) |
|
2003 if changelist not in changelists: |
|
2004 changelists.append(changelist) |
|
2005 |
|
2006 return changelists |
1956 |
2007 |
1957 ############################################################################ |
2008 ############################################################################ |
1958 ## Private Subversion specific methods are below. |
2009 ## Private Subversion specific methods are below. |
1959 ############################################################################ |
2010 ############################################################################ |
1960 |
2011 |