2

Lots of places suggest using the -c or --current-branch option to the repo command to reduce the amount of code downloaded. However, it no longer seems to be available:

repo --time -c -j2 sync
Usage: repo [-p|--paginate|--no-pager] COMMAND [ARGS]

main.py: error: no such option: -c

Is there an alternative switch now or has the functionality been completely removed?

Can I get an old version of the repo wrapper from somewhere that still has the -c switch and use that?

Is there a problem with using -c?

My use case is to get a specific branch of CyanogenMod and build a ROM for my phone.

EDIT: Interestingly, the sync.py appears to have the option in it.

grep -a2 current-branch .repo/repo/subcmds/sync.py
of a project from server.

The -c/--current-branch option can be used to only fetch objects that
are on the branch specified by a project's revision.

--
                 dest='detach_head', action='store_true',
                 help='detach projects back to manifest revision')
    p.add_option('-c', '--current-branch',
                 dest='current_branch_only', action='store_true',
                 help='fetch only current branch from server')
opticyclic
  • 7,412
  • 12
  • 81
  • 155

2 Answers2

0

Maybe attribute upstream of project element in manifest.xml is a solution for your question.

According to the document of manifest file

Attribute upstream: Name of the Git ref in which a sha1 can be found. Used when syncing a revision locked manifest in -c mode to avoid having to sync the entire ref space.

gzh
  • 3,507
  • 2
  • 19
  • 23
0

As noted in the edit to the question, the switch is still available.

The confusion has come from the fact that there are actually 2 python scripts in use in repo --time -c -j2 sync.

repo is one script, it then sends parameters to the sync script.

-c and -j are parameters to the sync script and --time is a parameter to the repo script.

Therefore, the command should be

repo --time sync -c -j2 
opticyclic
  • 7,412
  • 12
  • 81
  • 155