From e5a2122e6429b5eee861807e7050eb02045a7d4f Mon Sep 17 00:00:00 2001 From: Pierre Tardy Date: Thu, 24 Mar 2011 16:28:18 +0100 Subject: repo download: add --cherry-pick option default option uses git checkout, and thus overwrite the previous checkouts. this is a problem for automated builds of several changesets in the same project for daily builds of pending submission You can now use: repo download [--cherry-pick|-c] project changeid/patchnumber This will parse the manifest, cd to the corresponding project download the changes to FETCH_HEAD and cherry-pick the result. This is useful to automate cherry-picking of a patch in the context of build automation, and commit gating (e.g. buildbot) Change-Id: Ib638afd87677f1be197afb7b0f73c70fb98909fe Signed-off-by: Pierre Tardy --- project.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'project.py') diff --git a/project.py b/project.py index 40f6f317..49da34a8 100644 --- a/project.py +++ b/project.py @@ -1637,6 +1637,14 @@ class Project(object): if self._allrefs: raise GitError('%s checkout %s ' % (self.name, rev)) + def _CherryPick(self, rev, quiet=False): + cmd = ['cherry-pick'] + cmd.append(rev) + cmd.append('--') + if GitCommand(self, cmd).Wait() != 0: + if self._allrefs: + raise GitError('%s cherry-pick %s ' % (self.name, rev)) + def _ResetHard(self, rev, quiet=True): cmd = ['reset', '--hard'] if quiet: -- cgit v1.2.3-54-g00ecf