diff options
| -rw-r--r-- | docs/internal-fs-layout.md | 13 | ||||
| -rw-r--r-- | manifest_xml.py | 27 |
2 files changed, 31 insertions, 9 deletions
diff --git a/docs/internal-fs-layout.md b/docs/internal-fs-layout.md index 0b6c4709..8050e4f0 100644 --- a/docs/internal-fs-layout.md +++ b/docs/internal-fs-layout.md | |||
| @@ -68,13 +68,20 @@ support, see the [manifest-format.md] file. | |||
| 68 | If you want to switch the tracking settings, re-run `repo init` with the | 68 | If you want to switch the tracking settings, re-run `repo init` with the |
| 69 | new settings. | 69 | new settings. |
| 70 | 70 | ||
| 71 | * `manifest.xml`: The manifest that repo uses. It is generated at `repo init` | ||
| 72 | and uses the `--manifest-name` to determine what manifest file to load next | ||
| 73 | out of `manifests/`. | ||
| 74 | |||
| 75 | Do not try to modify this to load other manifests as it will confuse repo. | ||
| 76 | If you want to switch manifest files, re-run `repo init` with the new | ||
| 77 | setting. | ||
| 78 | |||
| 79 | Older versions of repo managed this with symlinks. | ||
| 80 | |||
| 71 | * `manifest.xml -> manifests/<manifest-name>.xml`: A symlink to the manifest | 81 | * `manifest.xml -> manifests/<manifest-name>.xml`: A symlink to the manifest |
| 72 | that the user wishes to sync. It is specified at `repo init` time via | 82 | that the user wishes to sync. It is specified at `repo init` time via |
| 73 | `--manifest-name`. | 83 | `--manifest-name`. |
| 74 | 84 | ||
| 75 | Do not try to repoint this symlink to other files as it will confuse repo. | ||
| 76 | If you want to switch manifest files, re-run `repo init` with the new | ||
| 77 | setting. | ||
| 78 | 85 | ||
| 79 | * `manifests.git/.repo_config.json`: JSON cache of the `manifests.git/config` | 86 | * `manifests.git/.repo_config.json`: JSON cache of the `manifests.git/config` |
| 80 | file for repo to read/process quickly. | 87 | file for repo to read/process quickly. |
diff --git a/manifest_xml.py b/manifest_xml.py index fe0735a8..a3effd11 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
| @@ -191,12 +191,27 @@ class XmlManifest(object): | |||
| 191 | """ | 191 | """ |
| 192 | self.Override(name) | 192 | self.Override(name) |
| 193 | 193 | ||
| 194 | try: | 194 | # Old versions of repo would generate symlinks we need to clean up. |
| 195 | if os.path.lexists(self.manifestFile): | 195 | if os.path.lexists(self.manifestFile): |
| 196 | platform_utils.remove(self.manifestFile) | 196 | platform_utils.remove(self.manifestFile) |
| 197 | platform_utils.symlink(os.path.join('manifests', name), self.manifestFile) | 197 | # This file is interpreted as if it existed inside the manifest repo. |
| 198 | except OSError as e: | 198 | # That allows us to use <include> with the relative file name. |
| 199 | raise ManifestParseError('cannot link manifest %s: %s' % (name, str(e))) | 199 | with open(self.manifestFile, 'w') as fp: |
| 200 | fp.write("""<?xml version="1.0" encoding="UTF-8"?> | ||
| 201 | <!-- | ||
| 202 | DO NOT EDIT THIS FILE! It is generated by repo and changes will be discarded. | ||
| 203 | If you want to use a different manifest, use `repo init -m <file>` instead. | ||
| 204 | |||
| 205 | If you want to customize your checkout by overriding manifest settings, use | ||
| 206 | the local_manifests/ directory instead. | ||
| 207 | |||
| 208 | For more information on repo manifests, check out: | ||
| 209 | https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | ||
| 210 | --> | ||
| 211 | <manifest> | ||
| 212 | <include name="%s" /> | ||
| 213 | </manifest> | ||
| 214 | """ % (name,)) | ||
| 200 | 215 | ||
| 201 | def _RemoteToXml(self, r, doc, root): | 216 | def _RemoteToXml(self, r, doc, root): |
| 202 | e = doc.createElement('remote') | 217 | e = doc.createElement('remote') |
