summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorAkshay Verma <akshayverma948@gmail.com>2018-03-15 21:56:30 +0530
committerAkshay Verma <akshayverma948@gmail.com>2018-03-17 16:29:23 +0530
commitcf7c0834cfc24c5c9584695c657c6baf97d0fbb3 (patch)
tree49be7db9b2f7b0e0cf9026a84b81716ddfc66034 /project.py
parent4ea1f0cabdda28fdee837ee2f99e14375028b5f4 (diff)
downloadgit-repo-cf7c0834cfc24c5c9584695c657c6baf97d0fbb3.tar.gz
Download latest patch when no patch is specified
When someone does "repo download -c <project> <change>" without specifying a patch number, by default patch 1 is downloaded. An alternative is to look for the latest patch and download the same when no explicit patch is given. This commit does the same by identifying the latest patch using "git ls-remote". Change-Id: Ia5fa7364415f53a3d9436df4643e38f3c90ded58
Diffstat (limited to 'project.py')
-rwxr-xr-x[-rw-r--r--]project.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/project.py b/project.py
index e4682e6a..5297a5cb 100644..100755
--- a/project.py
+++ b/project.py
@@ -2270,6 +2270,16 @@ class Project(object):
2270 if self._allrefs: 2270 if self._allrefs:
2271 raise GitError('%s cherry-pick %s ' % (self.name, rev)) 2271 raise GitError('%s cherry-pick %s ' % (self.name, rev))
2272 2272
2273 def _LsRemote(self):
2274 cmd = ['ls-remote']
2275 p = GitCommand(self, cmd, capture_stdout=True)
2276 if p.Wait() == 0:
2277 if hasattr(p.stdout, 'decode'):
2278 return p.stdout.decode('utf-8')
2279 else:
2280 return p.stdout
2281 return None
2282
2273 def _Revert(self, rev): 2283 def _Revert(self, rev):
2274 cmd = ['revert'] 2284 cmd = ['revert']
2275 cmd.append('--no-edit') 2285 cmd.append('--no-edit')