summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorPierre Tardy <pierre.tardy@intel.com>2011-03-24 16:28:18 +0100
committerShawn O. Pearce <sop@google.com>2012-05-24 09:02:38 -0700
commite5a2122e6429b5eee861807e7050eb02045a7d4f (patch)
treeb58878391a4a6a80bdda7edf096d22cff8b7f1c4 /project.py
parentccf86432b39ce2506fca472bbdbe379fdc53d3e3 (diff)
downloadgit-repo-e5a2122e6429b5eee861807e7050eb02045a7d4f.tar.gz
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 <pierre.tardy@intel.com>
Diffstat (limited to 'project.py')
-rw-r--r--project.py8
1 files changed, 8 insertions, 0 deletions
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):
1637 if self._allrefs: 1637 if self._allrefs:
1638 raise GitError('%s checkout %s ' % (self.name, rev)) 1638 raise GitError('%s checkout %s ' % (self.name, rev))
1639 1639
1640 def _CherryPick(self, rev, quiet=False):
1641 cmd = ['cherry-pick']
1642 cmd.append(rev)
1643 cmd.append('--')
1644 if GitCommand(self, cmd).Wait() != 0:
1645 if self._allrefs:
1646 raise GitError('%s cherry-pick %s ' % (self.name, rev))
1647
1640 def _ResetHard(self, rev, quiet=True): 1648 def _ResetHard(self, rev, quiet=True):
1641 cmd = ['reset', '--hard'] 1649 cmd = ['reset', '--hard']
1642 if quiet: 1650 if quiet: