From 551dfecea9667c8ae68e51a327f1ad9712573e27 Mon Sep 17 00:00:00 2001 From: Conley Owens Date: Fri, 10 Jul 2015 14:54:54 -0700 Subject: [PATCH] Always output upstream if specified Previously, in running the `manifest` command, we wouldn't output the upstream if the default upstream would include the pinned sha1. However, now that fetching refs/heads/* doesn't guarantee that we will have the sha1, we need to always output the specified upstream branch. Change-Id: Ib8b409a8ecd439397b38ee9649c530407797f841 --- manifest_xml.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/manifest_xml.py b/manifest_xml.py index cfbd9efa..130e17c2 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -253,11 +253,13 @@ class XmlManifest(object): else: value = p.work_git.rev_parse(HEAD + '^0') e.setAttribute('revision', value) - if peg_rev_upstream and value != p.revisionExpr: - # Only save the origin if the origin is not a sha1, and the default - # isn't our value, and the if the default doesn't already have that - # covered. - e.setAttribute('upstream', p.revisionExpr) + if peg_rev_upstream: + if p.upstream: + e.setAttribute('upstream', p.upstream) + elif value != p.revisionExpr: + # Only save the origin if the origin is not a sha1, and the default + # isn't our value + e.setAttribute('upstream', p.revisionExpr) else: revision = self.remotes[remoteName].revision or d.revisionExpr if not revision or revision != p.revisionExpr: