Commit Graph

20 Commits

Author SHA1 Message Date
Junghoon Jang
ac6afae3d6 repo-pull: Introduce --ignore-unknown-changes arg
In the case of pulling changes of a topic which is shared by multiple
repos, if the target source tree doesn't contain all of those repos,
the script will fail to apply changes.

Introduce a new argument, --ignore-unknown-changes, which ignores
changes whose repo is not in the manifest.xml.

Test: Pulling changes of a topic which is shared by multiple repos to
  the source tree which contains part of those repos was done
  successfully with the newly introduce argument.
Change-Id: Ie999121415bc1888b714d023ca251ad89701df11
Signed-off-by: Junghoon Jang <junghoonjang@google.com>
2023-04-18 15:52:07 +00:00
Junghoon Jang
108c36c52b repo-pull: Introduce --current-branch argument
To make the script can be used from automatic scripts, introduce
`--current-branch` argument which allows pulling commits to the current
branch without creating a local branch. It will skip the prompt which
asking about the creation of a local branch.

Test: With --current-branch argument, the script doesn't ask setting
  local branch name.
Change-Id: Iff3cdebe6338bb2be738e60047d5c4dd81cde4f0
Signed-off-by: Junghoon Jang <junghoonjang@google.com>
2023-04-14 12:25:29 +00:00
Junghoon Jang
172ccfe52d repo-pull: Consider branch of repo
In the case of one source tree containing multiple repos with the same
project, but different branches, the script won't sync them properly.
To fix it, make it consider the branch along with the project.

Test: Tested syncing well in the directory which contains multiple repos
  with the same project, but different branches.
Change-Id: I9d1add4ffe85f80f8f9d6a3ae2c046473d7c4631
Signed-off-by: Junghoon Jang <junghoonjang@google.com>
2023-04-14 12:24:51 +00:00
Logan Chien
5cf3c7b443 [repo-pull] Support curl hook
This commit adds a CURL command hook. This enables the Gerrit REST API
access through other authentication mechanisms.

Bug: b/269362063
Test: Run gerrit.py, repo_patch.py, repo_review.py with --use-curl=curl
Change-Id: I6dc4eb78760ee598df5065665c15d689916706f0
2023-02-23 08:32:41 -08:00
Luca Stefani
396466344b repo_pull: Attempt to fetch via ssh first
This is usually preferred if supported by the server

Change-Id: Ie15df0231a679d55ba1adfd7e7d86f4999828e27
2022-07-12 13:02:59 +00:00
Rob Seymour
7f265b92fa Extend gerrit query to handle all changes in a topic.
Handle _more_changes property to download all changes in a query
Add multiple print formats (JSON, oneline) to gerrit.py  CLI

Bug: 200079625
Test: gerrit.py
Test: gerrit.py --verbose
Test: gerrit.py --start 10 --limits 10
Test: gerrity.py --start 50000 // Validate bad start index
Test: repo_review.py  // Validate Change Lists: returned
Test: repo_patch.py   // Validate patch created for all changes
Test: repo_pull.py bash // Validate commands exists for all changes
Change-Id: I532eb2f709aff29cf9c8ff7fc428d53b5c607101
2021-09-23 19:26:13 +00:00
Logan Chien
4ee322f25b repo-review: Trim trailing slashes to avoid errors
Bug: b/170858163
Change-Id: I3de16ad77f0436af97eae26816fc99493fba30c3
2021-07-19 14:59:29 -07:00
Luca Stefani
edc569c60c repo_pull: Disable bare-except warning
Change-Id: I6a4af635811dc5d807196812e7782070fe230990
2020-07-16 11:58:31 +00:00
Luca Stefani
bd2e580b4d repo_pull: Automatically extract gerrit instance from repo manifest
Test: ./development/tools/repo_pull/repo_pull.py pull topic:hidl-vndk
Change-Id: I44974ec5df65e404591d35c39238d58207001110
2020-07-13 18:02:45 +00:00
Yo Chiang
8eb3d4fae0 Refine repo_pull.py
Use `repo manifest` command to retrieve manifest.
Change working directory to $ANDROID_BUILD_TOP before executing
commands.

Bug: 159346230
Test: ./repo_pull.py bash '<some commit query>' \
  -g https://android-review.googlesource.com
Change-Id: Ie5d29a4ae7b4b0e00c0900c8445e318dac807c77
2020-06-24 18:54:15 +08:00
Martin Stjernholm
0c28099695 Support <include> directives in manifests.
Test: "development/tools/repo_pull/repo_pull.py pull ..." on a large topic
  from a manifest with includes.
Bug: 140113116
Change-Id: I781c9a3ca0bcdf53cc8ed1896b3ec12389e4e797
2019-08-27 18:45:46 +01:00
Logan Chien
028c2c112b repo-pull: Handle project-not-found error
This commit add an error handler for project-not-found errors, so that
the failure of mapping one project does not stop us from pulling CLs for
other projects.

Test: repo_pull -g [gerrit] [query]
Change-Id: Ied9d400a09c032418cd345dc076948b06058aec4
2018-08-08 17:00:52 +08:00
Logan Chien
bfb414f033 repo-pull: Fix pylint errors
This commit adds several pylint fixes.

Test: for i in *.py; do pylint $i; done
Change-Id: Ie7318b616ef75c2944a4c03185f49b2a3f02db50
2018-06-15 16:06:56 +08:00
Logan Chien
ecd9846942 repo-pull: Fix undefined variable in except clause
This commit renames `process` to `proc` to eliminate an undefined
variable in the except clause.

Test: pylint repo_pull.py
Change-Id: Ie0d350f2c2e0b0e3eed037227dd15839e460d44e
2018-06-15 14:39:24 +08:00
Logan Chien
e9b0d96cf0 repo-pull: Support more git fetch protocols
This commit adds sso and rpc to git fetch commands.

Test: repo_pull.py pull -g [gerrit] [query]
Change-Id: Iad120cef4460ccc67b723467be638cc9299925fe
2018-06-06 18:32:50 +08:00
Logan Chien
3f67c28b52 repo-pull: Check Gerrit Code Review domain name
This commit adds a search on Gerrit Code Review URL so that a better
error message can be shown to users and the setup instructions can be
presented.

Test: repo_pull.py json -g [gerrit] [query]
Test: repo_review.py -g [gerrit] [query] -l Code-Review 2
Change-Id: I1f819c51e34c573f526ca3e30e237cdaf8a27160
2018-06-06 18:16:31 +08:00
Logan Chien
36d5edd405 repo-pull: Add --pick for non-merge commits
This commit adds the `--pick` command line option so that users can
choose the git command for the non-merge commits.

Test: repo_pull.py pull -g GERRIT QUERY -p merge-ff-only
Change-Id: Ib8bdaa1418dc2fb48d0f0e3c4eb995a23c007563
2018-04-20 18:29:48 +08:00
Logan Chien
1e026cfcc4 repo-pull: Allow to ignore local branch name
This commit allows users to omit `--branch` from command line options.
`repo_pull.py` will not call `repo start` if `--branch` is unspecified.

Test: repo_pull.py bash -g GERRIT QUERY
Change-Id: I62380485f057bd35ab8ae4d5e70372ff5d05fcc5
2018-04-20 18:29:48 +08:00
Logan Chien
9d19090823 repo-pull: Add checkout for merge commits
This commit adds `-m checkout` for merge commits.  If `-m checkout` is
specified, `repo_pull.py` will pull the merge commits with
`git checkout FETCH_HEAD`.

Test: repo_pull.py bash -g GERRIT QUERY -m checkout -b local_branch_name
Change-Id: I6cbedbd2941c63c8bb0591b6033a136829ffda47
2018-04-20 18:29:44 +08:00
Logan Chien
9fefa74796 repo-pull: Add repo_pull.py to pull multiple CLs
With `repo_pull.py`, users can specify a query string and pull all
matching change lists from Gerrit.

Test: repo_pull.py pull -g GERRIT QUERY
Change-Id: I1c64c9d630ab37f94276fde7a654f322ac3aa43c
2018-03-27 20:35:23 +08:00