|
|
||
|---|---|---|
| .. | ||
| README.md | ||
| gerrit.py | ||
| repo_patch.py | ||
| repo_pull.py | ||
| repo_review.py | ||
README.md
Repo Pull
repo_pull.py pulls multiple change lists from a Gerrit code review website.
A user may specify a query string and repo_pull.py will pull the matching
change lists.
For example, to pull the repo-pull-initial-cl topic from AOSP, run this
command:
repo_pull.py pull 'topic:repo-pull-initial-cl' \
-g https://android-review.googlesource.com
Read Usage and Examples for more details.
Installation
repo_pull.py requires .gitcookies to access Gerrit APIs. Please
check whether the Gerrit Code Review URL is in ~/.gitcookies.
If you don't have an entry, follow these steps:
-
Visit the Gerrit Code Review.
-
Click Obtain password
-
Copy the highlighted shell commands and paste them in a terminal.
Note: You must repeat these for each Gerrit Code Review websites.
Usages
Command line usages:
$ repo_pull.py [sub-command] [query] \
[-g gerrit] \
[-b local-topic-branch] \
[-j num-threads] \
[--limits max-num-changes]
Three sub-commands are supported:
-
repo_pull.py jsonprints the change lists in the JSON file format. -
repo_pull.py bashprints the bash commands that can pull the change lists. -
repo_pull.py pullpulls the change lists immediately.
Query String
[query] is the query string that can be entered to the Gerrit search box.
These are common queries:
topic:namehashtag:namebranch:nameproject:nameowner:nameis:open|is:merged|is:abandonedmessage:text
Options
-
-gor--gerritspecifies the URL of the Gerrit Code Review website. -
-bor--branchspecifies the local branch name that will be passed torepo start. -
-jor--parallelspecifies the number of parallel threads while pulling change lists. -
-nor--limitsspecifies the maximum number of change lists. (default: 1000) -
-mor--mergespecifies the method to pick the merge commits. (default:merge-ff-only) -
-por--pickspecifies the method to pick the non-merge commits. (default:pick)pickmaps togit cherry-pick --allow-emptymergemaps togit merge --no-editmerge-ff-onlymaps togit merge --no-edit --ff-onlymerge-no-ffmaps togit merge --no-edit --no-ffresetmaps togit reset --hardcheckoutmaps togit checkout
Examples
To print the change lists with the topic repo-pull-initial-cl in JSON file
format:
repo_pull.py json 'topic:repo-pull-initial-cl' \
-g https://android-review.googlesource.com
To print the bash commands that can pull the change lists, use the bash
command:
repo_pull.py bash 'topic:repo-pull-initial-cl' \
-g https://android-review.googlesource.com \
-b my-local-topic-branch
To pull the change lists immediately, use the pull command:
repo_pull.py pull 'topic:repo-pull-initial-cl' \
-g https://android-review.googlesource.com \
-b my-local-topic-branch