diff options
author | Conley Owens <cco3@android.com> | 2013-10-08 17:26:57 -0700 |
---|---|---|
committer | Conley Owens <cco3@android.com> | 2013-10-08 17:26:57 -0700 |
commit | 1e7ab2a63f7ec53aa649015dff8d46ad2501d993 (patch) | |
tree | 511ced99493616dc55231a95885f670407becd3a /manifest_xml.py | |
parent | e76efdd7b342577c40aa271fa5ded9d66a783a9b (diff) | |
download | git-repo-1e7ab2a63f7ec53aa649015dff8d46ad2501d993.tar.gz |
Respect remote aliases
Previously, change I7150e449341ed8655d398956a095261978d95870
had broken alias support in order to fix the manifest command to keep
it from spitting projects that point to an alias that wasn't recorded.
This commit reverts that commit and instead solves the issue more
correctly, outputting the alias in the remote node of the manifest and
respecting that alias when outputting the list of projects.
Change-Id: I941fc4adb7121d2e61cedc5838e80d3918c977c3
Diffstat (limited to 'manifest_xml.py')
-rw-r--r-- | manifest_xml.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index e40e6fac..bdbb1d40 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
@@ -91,6 +91,8 @@ class _XmlRemote(object): | |||
91 | def ToRemoteSpec(self, projectName): | 91 | def ToRemoteSpec(self, projectName): |
92 | url = self.resolvedFetchUrl.rstrip('/') + '/' + projectName | 92 | url = self.resolvedFetchUrl.rstrip('/') + '/' + projectName |
93 | remoteName = self.name | 93 | remoteName = self.name |
94 | if self.remoteAlias: | ||
95 | remoteName = self.remoteAlias | ||
94 | return RemoteSpec(remoteName, url, self.reviewUrl) | 96 | return RemoteSpec(remoteName, url, self.reviewUrl) |
95 | 97 | ||
96 | class XmlManifest(object): | 98 | class XmlManifest(object): |
@@ -145,6 +147,8 @@ class XmlManifest(object): | |||
145 | root.appendChild(e) | 147 | root.appendChild(e) |
146 | e.setAttribute('name', r.name) | 148 | e.setAttribute('name', r.name) |
147 | e.setAttribute('fetch', r.fetchUrl) | 149 | e.setAttribute('fetch', r.fetchUrl) |
150 | if r.remoteAlias is not None: | ||
151 | e.setAttribute('alias', r.remoteAlias) | ||
148 | if r.reviewUrl is not None: | 152 | if r.reviewUrl is not None: |
149 | e.setAttribute('review', r.reviewUrl) | 153 | e.setAttribute('review', r.reviewUrl) |
150 | 154 | ||
@@ -223,7 +227,8 @@ class XmlManifest(object): | |||
223 | e.setAttribute('name', name) | 227 | e.setAttribute('name', name) |
224 | if relpath != name: | 228 | if relpath != name: |
225 | e.setAttribute('path', relpath) | 229 | e.setAttribute('path', relpath) |
226 | if not d.remote or p.remote.name != d.remote.name: | 230 | remoteName = d.remote.remoteAlias or d.remote.name |
231 | if not d.remote or p.remote.name != remoteName: | ||
227 | e.setAttribute('remote', p.remote.name) | 232 | e.setAttribute('remote', p.remote.name) |
228 | if peg_rev: | 233 | if peg_rev: |
229 | if self.IsMirror: | 234 | if self.IsMirror: |