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
This commit is contained in:
parent
4ea1f0cabd
commit
cf7c0834cf
2 changed files with 18 additions and 0 deletions
10
project.py
Normal file → Executable file
10
project.py
Normal file → Executable file
|
@ -2270,6 +2270,16 @@ class Project(object):
|
|||
if self._allrefs:
|
||||
raise GitError('%s cherry-pick %s ' % (self.name, rev))
|
||||
|
||||
def _LsRemote(self):
|
||||
cmd = ['ls-remote']
|
||||
p = GitCommand(self, cmd, capture_stdout=True)
|
||||
if p.Wait() == 0:
|
||||
if hasattr(p.stdout, 'decode'):
|
||||
return p.stdout.decode('utf-8')
|
||||
else:
|
||||
return p.stdout
|
||||
return None
|
||||
|
||||
def _Revert(self, rev):
|
||||
cmd = ['revert']
|
||||
cmd.append('--no-edit')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue