[java] Android source code and repo - What exactly is happening when getting code


Answers

Question

I have come across plenty of short questions on minimal aspects of using repo to get Android source or very broad definitions of what repo does and as a result don't really understand what is happening when I use repo. I am following the instructions on the Android Source site. I do this all while in my repodir so all mention of files are relative to this.

Init and sync repo:

repo init -u https://android.googlesource.com/platform/manifest
repo sync

After this completes, my folder is full of android type folders (bionic, bootable, etc etc) and a hidden .repo folder. Notably, there is a folder called ics-mr1 which relates to a specific version and it contains mostly the same folders in my repodir inside itself.

Pull down a specific branch:

repo init -u https://android.googlesource.com/platform/manifest -b gingerbread
repo sync

This completes relatively quickly and the main change I see is there is now a folder called gingerbread (all the original folders seem to remain).

I now try this and it takes AGES:

repo init -u https://android.googlesource.com/platform/manifest -b android_4.2.2_r1
repo sync

After, it still contains the same gingerbread and ics-mr1 and a few new random folders (like abi) but nothing that seems to be of that new version.

The question

From the results of this, I am seeing I really don't understand what exactly my actions are doing and how to achieve what I am trying to.

How can I obtain a local version of the entire master branch of the source, and then correctly change between branches as I see fit? The way I am at the moment seems wrong as the files left after branch changes seem illogical.

To further that, is there an efficient way to have local copies of numerous branches simultaneously such that I can compare the components of each (obviously without re-downloading them each time)?

I am asking these questions with big holes in understanding (ones which I have been unable to find clear consistent information for), so any extra information about the answer to assist in understanding of what is actually being done would really be of value.




Related