diff options
author | Pierre Tardy <pierre.tardy@intel.com> | 2011-03-24 16:28:18 +0100 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2012-05-24 09:02:38 -0700 |
commit | e5a2122e6429b5eee861807e7050eb02045a7d4f (patch) | |
tree | b58878391a4a6a80bdda7edf096d22cff8b7f1c4 /subcmds/download.py | |
parent | ccf86432b39ce2506fca472bbdbe379fdc53d3e3 (diff) | |
download | git-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 'subcmds/download.py')
-rw-r--r-- | subcmds/download.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/subcmds/download.py b/subcmds/download.py index 61eadd54..79d0192d 100644 --- a/subcmds/download.py +++ b/subcmds/download.py | |||
@@ -33,7 +33,9 @@ makes it available in your project's local working directory. | |||
33 | """ | 33 | """ |
34 | 34 | ||
35 | def _Options(self, p): | 35 | def _Options(self, p): |
36 | pass | 36 | p.add_option('-c','--cherry-pick', |
37 | dest='cherrypick', action='store_true', | ||
38 | help="cherry-pick instead of checkout") | ||
37 | 39 | ||
38 | def _ParseChangeIds(self, args): | 40 | def _ParseChangeIds(self, args): |
39 | if not args: | 41 | if not args: |
@@ -78,4 +80,7 @@ makes it available in your project's local working directory. | |||
78 | % (project.name, change_id, ps_id, len(dl.commits)) | 80 | % (project.name, change_id, ps_id, len(dl.commits)) |
79 | for c in dl.commits: | 81 | for c in dl.commits: |
80 | print >>sys.stderr, ' %s' % (c) | 82 | print >>sys.stderr, ' %s' % (c) |
81 | project._Checkout(dl.commit) | 83 | if opt.cherrypick: |
84 | project._CherryPick(dl.commit) | ||
85 | else: | ||
86 | project._Checkout(dl.commit) | ||