Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Repo is a tool built on top of Git. Repo helps manage many Git repositories, does the uploads to revision control systems, and automates parts of the development workflow. Repo is not meant to replace Git, only to make it easier to work with Git.

The repo command is an executable Python script that you can put anywhere in your path.

init

Installs Repo repo in the current directory. This creates a .repo/ directory with Git repositories for the Repo repo source code and the standard Android manifest files. 

Code Block
$ repo init -u url [options]

Options:

  • -u: Specify a URL from which to retrieve a manifest repository.
  • -m: Select a manifest file within the repository. If no manifest name is selected, the default is

...

  • default.xml.

  • -b: Specify a revision, that is, a particular manifest-branch.

Panel

Example:

repo init -u https://user@code.rdkcentral.com/r/manifests

sync

Downloads new changes and updates the working files in your local environment, essentially accomplishing git fetch across all Git repositories. If you run

 repo sync without arguments, it synchronizes the files for all projects.

Code Block
$ repo sync [project-list]

Options:

  • -c: Fetch only the current manifest branch from the server.

  • -d: Switch specified projects back to the manifest revision. This is helpful if the project is currently on a topic branch, but the manifest revision is temporarily needed.

  • -f: Proceed with syncing other projects even if a project fails to sync.

  • -j threadcount: Split the sync across threads for faster completion. Make sure not to overwhelm your machine by leaving some CPU reserved for other tasks. To see the number of available CPUs, first run: nproc --all
  • -q: Run quietly by suppressing status messages.

  • -s: Sync to a known good build as specified by the manifest-server element in the current manifest.

Panel

Example:

repo sync 

Upload

For the specified projects, Repo compares the local branches to the remote branches updated during the last Repo repo sync.

Repo prompts you prompts  to select one or more of the branches that haven't been uploaded for review. 

If you run repo upload without arguments, it searches all of the projects for changes to upload.

Code Block
$ repo upload [project-list]
Panel
repo upload

Diff

Shows outstanding changes between the commit and the working tree using 

...

repo diff.

Code Block
$ repo diff [project-list]

forall

Executes the given shell command in each project.

Code Block
$ repo forall [project-list] -c command

The following additional environment variables are made available

...

by repo forall:

  • REPO_

...

  • PROJECT is set to the unique name of the project.

  • REPO_PATH  is the path relative to the root of the client.

  • REPO_

...

  • REMOTE is the name of the remote system from the manifest.

  • REPO_

...

  • LREV is the name of the revision from the manifest, translated to a local tracking branch. Use this if you need to pass the manifest revision to a locally executed Git command.

  • REPO_

...

  • RREV is the name of the revision from the manifest, exactly as written in the manifest.

Options:

  • -c: Command and arguments to execute. The command is evaluated through

...

  • /bin/sh and any arguments after it are passed through as shell positional parameters.

  • -p: Show project headers before output of the specified command. This is achieved by binding pipes to the command's stdin, stdout, and sterr streams, and piping all output into a continuous stream that is displayed in a single pager session.

  • -v: Show messages the command writes to stderr.

Panel

Example: 

repo forall -c 'git push -u cmf branch-name'

start

Begins a new branch for development, starting from the revision specified in the manifest.

Code Block
$ repo start branch-name [project-list]

...


Options:
 -h, --help  show this help message and exit
 --all       begin branch in all projects

The BRANCH_NAME argument provides a short description of the change you're trying to make to the projects. If you don't know, consider using the

...

name default.

...

The project-list

...

argument specifies which projects participate in this topic branch.

status

Compares the working tree to the staging area (index) and the most recent commit on this branch (HEAD) in each project specified. Displays a summary line for each file where there is a difference between these three states.

Code Block
$ repo status [project-list]