From 9aa34c95a61c57512cc7973740c34ab3e61983c5 Mon Sep 17 00:00:00 2001 From: Dan Pasanen Date: Thu, 25 Aug 2016 09:39:27 -0500 Subject: 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 --- tools/repopick.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/repopick.py b/tools/repopick.py index a53c043..2b0aab4 100755 --- a/tools/repopick.py +++ b/tools/repopick.py @@ -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: @@ -219,7 +220,11 @@ if __name__ == '__main__': path = project.get('path') revision = project.get('revision') if revision is None: - revision = default_revision + for remote in remotes: + if remote.get('name') == project.get('remote'): + revision = remote.get('revision') + if revision is None: + revision = default_revision if not name in project_name_to_data: project_name_to_data[name] = {} -- cgit v1.1