init: rename --repo-branch to --repo-rev We refer to this as "revision" in help text, and in REPO_REV envvar, so rename to --repo-rev to be consistent. We keep --repo-branch for backwards compatibility, but as a hidden option. Bug: https://crbug.com/gerrit/11045 Change-Id: I1ecc282fba32917ed78a63850360c08469db849a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259352 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
diff --git a/docs/internal-fs-layout.md b/docs/internal-fs-layout.md index b06e898..5e8690b 100644 --- a/docs/internal-fs-layout.md +++ b/docs/internal-fs-layout.md
@@ -34,7 +34,7 @@ It tracks the git repository at `REPO_URL` using the `REPO_REV` branch. Those are specified at `repo init` time using the `--repo-url=<REPO_URL>` - and `--repo-branch=<REPO_REV>` options. + and `--repo-rev=<REPO_REV>` options. Any changes made to this directory will usually be automatically discarded by repo itself when it checks for updates. If you want to update to the
diff --git a/docs/release-process.md b/docs/release-process.md index 121c3bf..93a0f3e 100644 --- a/docs/release-process.md +++ b/docs/release-process.md
@@ -49,11 +49,11 @@ * `--repo-url`: This tells repo where to clone the full repo project itself. It defaults to the official project (`REPO_URL` in the launcher script). -* `--repo-branch`: This tells repo which branch to use for the full project. +* `--repo-rev`: This tells repo which branch to use for the full project. It defaults to the `stable` branch (`REPO_REV` in the launcher script). Whenever `repo sync` is run, repo will check to see if an update is available. -It fetches the latest repo-branch from the repo-url. +It fetches the latest repo-rev from the repo-url. Then it verifies that the latest commit in the branch has a valid signed tag using `git tag -v` (which uses gpg). If the tag is valid, then repo will update its internal checkout to it. @@ -91,7 +91,7 @@ create a signed tag using a key registered in repo itself. Typically we just tag the latest version of the `master` branch. The tag could be pushed now, but it won't be used by clients normally (since the -default `repo-branch` setting is `stable`). +default `repo-rev` setting is `stable`). This would allow some early testing on systems who explicitly select `master`. ### Creating a signed tag
diff --git a/repo b/repo index c6a56c6..6670c0d 100755 --- a/repo +++ b/repo
@@ -328,8 +328,10 @@ group = parser.add_option_group('repo Version options') group.add_option('--repo-url', metavar='URL', help='repo repository location ($REPO_URL)') - group.add_option('--repo-branch', metavar='REVISION', + group.add_option('--repo-rev', metavar='REV', help='repo branch or revision ($REPO_REV)') + group.add_option('--repo-branch', dest='repo_rev', + help=optparse.SUPPRESS_HELP) group.add_option('--no-repo-verify', dest='repo_verify', default=True, action='store_false', help='do not verify repo source code') @@ -473,7 +475,7 @@ opt.verbose = opt.output_mode is True url = opt.repo_url or REPO_URL - branch = opt.repo_branch or REPO_REV + branch = opt.repo_rev or REPO_REV if branch.startswith('refs/heads/'): branch = branch[len('refs/heads/'):]
diff --git a/subcmds/init.py b/subcmds/init.py index 94bd44c..431165d 100644 --- a/subcmds/init.py +++ b/subcmds/init.py
@@ -166,9 +166,10 @@ g.add_option('--repo-url', dest='repo_url', help='repo repository location', metavar='URL') - g.add_option('--repo-branch', - dest='repo_branch', - help='repo branch or revision', metavar='REVISION') + g.add_option('--repo-rev', metavar='REV', + help='repo branch or revision') + g.add_option('--repo-branch', dest='repo_rev', + help=optparse.SUPPRESS_HELP) g.add_option('--no-repo-verify', dest='repo_verify', default=True, action='store_false', help='do not verify repo source code')
diff --git a/subcmds/sync.py b/subcmds/sync.py index dadf2e4..de6deec 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py
@@ -850,7 +850,7 @@ base = rp.GetBranch(cb).merge if not base or not base.startswith('refs/heads/'): print('warning: repo is not tracking a remote branch, so it will not ' - 'receive updates; run `repo init --repo-branch=stable` to fix.', + 'receive updates; run `repo init --repo-rev=stable` to fix.', file=sys.stderr) mp = self.manifest.manifestProject