diff --git a/docs/manifest-format.md b/docs/manifest-format.md
index 0d26296d..bcdf5a8e 100644
--- a/docs/manifest-format.md
+++ b/docs/manifest-format.md
@@ -105,6 +105,8 @@ following DTD:
+
+
@@ -423,6 +425,12 @@ project. Same syntax as the corresponding element of `project`.
Attribute `remote`: If specified, overrides the remote of the original
project. Same syntax as the corresponding element of `project`.
+Attribute `dest-branch`: If specified, overrides the dest-branch of the original
+project. Same syntax as the corresponding element of `project`.
+
+Attribute `upstream`: If specified, overrides the upstream of the original
+project. Same syntax as the corresponding element of `project`.
+
### Element annotation
Zero or more annotation elements may be specified as children of a
diff --git a/manifest_xml.py b/manifest_xml.py
index b7579d5d..129eb3f7 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -1289,6 +1289,8 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
remote = self._default.remote
else:
remote = self._get_remote(node)
+ dest_branch = node.getAttribute('dest-branch')
+ upstream = node.getAttribute('upstream')
named_projects = self._projects[name]
if dest_path and not path and len(named_projects) > 1:
@@ -1304,6 +1306,10 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
if remote_name:
p.remote = remote.ToRemoteSpec(name)
+ if dest_branch:
+ p.dest_branch = dest_branch
+ if upstream:
+ p.upstream = upstream
if dest_path:
del self._paths[p.relpath]
diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py
index 48403c0d..e181b642 100644
--- a/tests/test_manifest_xml.py
+++ b/tests/test_manifest_xml.py
@@ -874,3 +874,27 @@ class ExtendProjectElementTests(ManifestParseTestCase):
else:
self.assertEqual(manifest.projects[0].relpath, 'bar')
self.assertEqual(manifest.projects[1].relpath, 'y')
+
+ def test_extend_project_dest_branch(self):
+ manifest = self.getXmlManifest("""
+
+
+
+
+
+
+""")
+ self.assertEqual(len(manifest.projects), 1)
+ self.assertEqual(manifest.projects[0].dest_branch, 'bar')
+
+ def test_extend_project_upstream(self):
+ manifest = self.getXmlManifest("""
+
+
+
+
+
+
+""")
+ self.assertEqual(len(manifest.projects), 1)
+ self.assertEqual(manifest.projects[0].upstream, 'bar')