Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit aef3667b authored by Dan Pasanen's avatar Dan Pasanen Committed by Adrian DC
Browse files

repopick: try to use remote's default revision

* If the project doesn't have a revision specified, try
  to see if it's remote has one specified before falling back
  to the global default.

RM-290

Change-Id: I05129413b154e5d08d0fa9ef0ce853631b7e1562
parent 1a101ec2
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -209,6 +209,7 @@ if __name__ == '__main__':
    manifest = subprocess.check_output(['repo', 'manifest'])
    xml_root = ElementTree.fromstring(manifest)
    projects = xml_root.findall('project')
    remotes = xml_root.findall('remote')
    default_revision = xml_root.findall('default')[0].get('revision').split('/')[-1]

    #dump project data into the a list of dicts with the following data:
@@ -218,6 +219,10 @@ if __name__ == '__main__':
        name = project.get('name')
        path = project.get('path')
        revision = project.get('revision')
        if revision is None:
            for remote in remotes:
                if remote.get('name') == project.get('remote'):
                    revision = remote.get('revision')
            if revision is None:
                revision = default_revision