Merge "Always output upstream if specified"

This commit is contained in:
Conley Owens 2015-07-13 16:36:27 +00:00 committed by Gerrit Code Review
commit 97836cf09f

View File

@ -253,11 +253,13 @@ class XmlManifest(object):
else: else:
value = p.work_git.rev_parse(HEAD + '^0') value = p.work_git.rev_parse(HEAD + '^0')
e.setAttribute('revision', value) e.setAttribute('revision', value)
if peg_rev_upstream and value != p.revisionExpr: if peg_rev_upstream:
# Only save the origin if the origin is not a sha1, and the default if p.upstream:
# isn't our value, and the if the default doesn't already have that e.setAttribute('upstream', p.upstream)
# covered. elif value != p.revisionExpr:
e.setAttribute('upstream', 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: else:
revision = self.remotes[remoteName].revision or d.revisionExpr revision = self.remotes[remoteName].revision or d.revisionExpr
if not revision or revision != p.revisionExpr: if not revision or revision != p.revisionExpr: