1932 self, mode="outgoing") |
1932 self, mode="outgoing") |
1933 self.logBrowserOutgoing.show() |
1933 self.logBrowserOutgoing.show() |
1934 self.logBrowserOutgoing.raise_() |
1934 self.logBrowserOutgoing.raise_() |
1935 self.logBrowserOutgoing.start(name) |
1935 self.logBrowserOutgoing.start(name) |
1936 |
1936 |
1937 def hgPull(self, name): |
1937 def hgPull(self, name, revisions=None): |
1938 """ |
1938 """ |
1939 Public method used to pull changes from a remote Mercurial repository. |
1939 Public method used to pull changes from a remote Mercurial repository. |
1940 |
1940 |
1941 @param name directory name of the project to be pulled to (string) |
1941 @param name directory name of the project to be pulled to |
|
1942 @type str |
|
1943 @param revisions list of revisions to be pulled |
|
1944 @type list of str |
1942 @return flag indicating, that the update contained an add |
1945 @return flag indicating, that the update contained an add |
1943 or delete (boolean) |
1946 or delete |
|
1947 @rtype bool |
1944 """ |
1948 """ |
1945 if self.getPlugin().getPreferences("PreferUnbundle") and \ |
1949 if self.getPlugin().getPreferences("PreferUnbundle") and \ |
1946 self.bundleFile and \ |
1950 self.bundleFile and \ |
1947 os.path.exists(self.bundleFile): |
1951 os.path.exists(self.bundleFile) and \ |
|
1952 revisions is None: |
1948 command = "unbundle" |
1953 command = "unbundle" |
1949 title = self.tr('Apply changegroups') |
1954 title = self.tr('Apply changegroups') |
1950 else: |
1955 else: |
1951 command = "pull" |
1956 command = "pull" |
1952 title = self.tr('Pulling from a remote Mercurial repository') |
1957 title = self.tr('Pulling from a remote Mercurial repository') |
1955 args.append('-v') |
1960 args.append('-v') |
1956 if self.getPlugin().getPreferences("PullUpdate"): |
1961 if self.getPlugin().getPreferences("PullUpdate"): |
1957 args.append('--update') |
1962 args.append('--update') |
1958 if command == "unbundle": |
1963 if command == "unbundle": |
1959 args.append(self.bundleFile) |
1964 args.append(self.bundleFile) |
|
1965 if revisions: |
|
1966 for rev in revisions: |
|
1967 args.append("--rev") |
|
1968 args.append(rev) |
1960 |
1969 |
1961 # find the root of the repo |
1970 # find the root of the repo |
1962 repodir = self.splitPath(name)[0] |
1971 repodir = self.splitPath(name)[0] |
1963 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
1972 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
1964 repodir = os.path.dirname(repodir) |
1973 repodir = os.path.dirname(repodir) |