diff options
author | Conley Owens <cco3@android.com> | 2015-07-10 14:54:54 -0700 |
---|---|---|
committer | Conley Owens <cco3@android.com> | 2015-07-10 14:59:10 -0700 |
commit | 551dfecea9667c8ae68e51a327f1ad9712573e27 (patch) | |
tree | aefc1d4d14ee6078363bfda3acb4e182f7499ebd | |
parent | c5ceeb16258d5d787845840036c57f9fdfdcad34 (diff) | |
download | git-repo-551dfecea9667c8ae68e51a327f1ad9712573e27.tar.gz |
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
-rw-r--r-- | manifest_xml.py | 12 |
1 files 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): | |||
253 | else: | 253 | else: |
254 | value = p.work_git.rev_parse(HEAD + '^0') | 254 | value = p.work_git.rev_parse(HEAD + '^0') |
255 | e.setAttribute('revision', value) | 255 | e.setAttribute('revision', value) |
256 | if peg_rev_upstream and value != p.revisionExpr: | 256 | if peg_rev_upstream: |
257 | # Only save the origin if the origin is not a sha1, and the default | 257 | if p.upstream: |
258 | # isn't our value, and the if the default doesn't already have that | 258 | e.setAttribute('upstream', p.upstream) |
259 | # covered. | 259 | elif value != p.revisionExpr: |
260 | e.setAttribute('upstream', p.revisionExpr) | 260 | # Only save the origin if the origin is not a sha1, and the default |
261 | # isn't our value | ||
262 | e.setAttribute('upstream', p.revisionExpr) | ||
261 | else: | 263 | else: |
262 | revision = self.remotes[remoteName].revision or d.revisionExpr | 264 | revision = self.remotes[remoteName].revision or d.revisionExpr |
263 | if not revision or revision != p.revisionExpr: | 265 | if not revision or revision != p.revisionExpr: |