Search code examples
androidgerritrepo

gerrit default.xml is not reflecting after the init in manifest.xml


Hi I set up my Gerrit with for the latest android aosp 5.1.1_r3.

repo init --mirror -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r3

Update the default.xml with the below changes.

<remote  name="aosp"
           fetch="ssh://xx.xx.xx.xx:29418/" />
  <default revision="refs/tags/android-5.1.1_r3"
           remote="http://xx.xx.xx.xx:8080/"
           sync-j="4" />

I have created a mirror for this version on my AWS instance under /git/ But when i do a : repo init -u http://xx.xx.xx.xx:8080/platform/manifest -b android-5.1.1_r3

The manifest is still showing as below. Does it mean its going to sync from AOSP or from my AWS server?

 <remote  name="aosp"
               fetch=".." />
      <default revision="refs/tags/android-5.1.1_r3"
               remote="aosp"
               sync-j="4" />

Please help me to fix this issue. Many thanks


Solution

  • You apparently didn't push your change to your server (which is why the manifest file doesn't include your change). However, you don't have to change the manifest in order to sync code. The fetch=".." part in the original manifest means that the gits are going to be synced from the same source as the manifest itself.

    However, you do have to change the manifest if you want Repo to send commits to your Gerrit server when running repo upload. Make sure you push your manifest change, e.g. like this:

    git push ssh://xx.xx.xx.xx:29418/platform/manifest HEAD:refs/for/name-of-your-branch
    

    Finally, do not change the "remote" attribute of the <default> element. It shouldn't contain a URL but the name of a remote specified in the manifest, in this case "aosp".

    Setting up a local AOSP mirror and allowing local code reviews requires some thinking about the branching strategy and how you mirror branches. The following questions discuss this topic: