Home | History | Annotate | only in /development/tools/repo_pull
Up to higher level directory
NameDateSize
gerrit.py22-Oct-20207.4K
README.md22-Oct-20203.2K
repo_patch.py22-Oct-20202.2K
repo_pull.py22-Oct-202014.9K
repo_review.py22-Oct-20207.4K

README.md

      1 Repo Pull
      2 =========
      3 
      4 `repo_pull.py` pulls multiple change lists from a Gerrit code review website.
      5 A user may specify a query string and `repo_pull.py` will pull the matching
      6 change lists.
      7 
      8 For example, to pull the `repo-pull-initial-cl` topic from AOSP, run this
      9 command:
     10 
     11     repo_pull.py pull 'topic:repo-pull-initial-cl' \
     12         -g https://android-review.googlesource.com
     13 
     14 Read [Usage](#Usages) and [Examples](#Examples) for more details.
     15 
     16 
     17 ## Installation
     18 
     19 `repo_pull.py` requires `.gitcookies` to access Gerrit APIs.  Please
     20 check whether the Gerrit Code Review URL is in `~/.gitcookies`.
     21 
     22 If you don't have an entry, follow these steps:
     23 
     24 1. Visit the [Gerrit Code Review](https://android-review.googlesource.com).
     25 
     26 2. Click [Settings -> HTTP Credentials](https://android-review.googlesource.com/settings/#HTTPCredentials)
     27 
     28 3. Click **Obtain password**
     29 
     30 4. Copy the highlighted shell commands and paste them in a terminal.
     31 
     32 Note: You must repeat these for each Gerrit Code Review websites.
     33 
     34 
     35 ## Usages
     36 
     37 Command line usages:
     38 
     39     $ repo_pull.py [sub-command] [query] \
     40                    [-g gerrit] \
     41                    [-b local-topic-branch] \
     42                    [-j num-threads] \
     43                    [--limits max-num-changes]
     44 
     45 
     46 Three sub-commands are supported:
     47 
     48 * `repo_pull.py json` prints the change lists in the JSON file format.
     49 
     50 * `repo_pull.py bash` prints the *bash commands* that can pull the change lists.
     51 
     52 * `repo_pull.py pull` *pulls the change lists* immediately.
     53 
     54 
     55 ### Query String
     56 
     57 `[query]` is the query string that can be entered to the Gerrit search box.
     58 
     59 These are common queries:
     60 
     61 * `topic:name`
     62 * `hashtag:name`
     63 * `branch:name`
     64 * `project:name`
     65 * `owner:name`
     66 * `is:open` | `is:merged` | `is:abandoned`
     67 * `message:text`
     68 
     69 
     70 ### Options
     71 
     72 * `-g` or `--gerrit` specifies the URL of the Gerrit Code Review website.
     73   *(required)*
     74 
     75 * `-b` or `--branch` specifies the local branch name that will be passed to
     76   `repo start`.
     77 
     78 * `-j` or `--parallel` specifies the number of parallel threads while pulling
     79   change lists.
     80 
     81 * `-n` or `--limits` specifies the maximum number of change lists.  (default:
     82   1000)
     83 
     84 * `-m` or `--merge` specifies the method to pick the merge commits.  (default:
     85   `merge-ff-only`)
     86 
     87 * `-p` or `--pick` specifies the method to pick the non-merge commits.
     88   (default: `pick`)
     89 
     90   * `pick` maps to `git cherry-pick --allow-empty`
     91   * `merge` maps to `git merge --no-edit`
     92   * `merge-ff-only` maps to `git merge --no-edit --ff-only`
     93   * `merge-no-ff` maps to `git merge --no-edit --no-ff`
     94   * `reset` maps to `git reset --hard`
     95   * `checkout` maps to `git checkout`
     96 
     97 
     98 ## Examples
     99 
    100 To print the change lists with the topic `repo-pull-initial-cl` in JSON file
    101 format:
    102 
    103 ```
    104 repo_pull.py json 'topic:repo-pull-initial-cl' \
    105     -g https://android-review.googlesource.com
    106 ```
    107 
    108 To print the bash commands that can pull the change lists, use the `bash`
    109 command:
    110 
    111 ```
    112 repo_pull.py bash 'topic:repo-pull-initial-cl' \
    113     -g https://android-review.googlesource.com \
    114     -b my-local-topic-branch
    115 ```
    116 
    117 To pull the change lists immediately, use the `pull` command:
    118 
    119 ```
    120 repo_pull.py pull 'topic:repo-pull-initial-cl' \
    121     -g https://android-review.googlesource.com \
    122     -b my-local-topic-branch
    123 ```
    124