diff options
author | David Pursehouse <david.pursehouse@sonymobile.com> | 2012-11-14 04:53:24 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2012-11-14 05:05:32 +0900 |
commit | 52f1e5d9111c586624de48b5f705e10b67d109b3 (patch) | |
tree | 64861a0d67e6194626a5fa8cd1c8d044bd353e1b | |
parent | 8e3d355d448671e7c9b3409a3bbde971f90d7c28 (diff) | |
download | git-repo-52f1e5d9111c586624de48b5f705e10b67d109b3.tar.gz |
Make load order of local manifests deterministic
Local manifest files stored in the local_manifests folder are loaded
in alphabetical order, so it's easier to know in which order project
removals/additions/modifications will be applied.
If local_manifests.xml exists, it will be loaded before the files in
local_manifests.
Change-Id: Ia5c0349608f1823b4662cd6b340b99915bd973d5
-rw-r--r-- | docs/manifest-format.txt | 6 | ||||
-rw-r--r-- | manifest_xml.py | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/docs/manifest-format.txt b/docs/manifest-format.txt index 9589352e..20ab9eb0 100644 --- a/docs/manifest-format.txt +++ b/docs/manifest-format.txt | |||
@@ -249,7 +249,13 @@ Users may add projects to the local manifest(s) prior to a `repo sync` | |||
249 | invocation, instructing repo to automatically download and manage | 249 | invocation, instructing repo to automatically download and manage |
250 | these extra projects. | 250 | these extra projects. |
251 | 251 | ||
252 | Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will | ||
253 | be loaded in alphabetical order. | ||
254 | |||
252 | Additional remotes and projects may also be added through a local | 255 | Additional remotes and projects may also be added through a local |
253 | manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method | 256 | manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method |
254 | is deprecated in favor of using multiple manifest files as mentioned | 257 | is deprecated in favor of using multiple manifest files as mentioned |
255 | above. | 258 | above. |
259 | |||
260 | If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before | ||
261 | any manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`. | ||
diff --git a/manifest_xml.py b/manifest_xml.py index a3e78fe9..31987248 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
@@ -312,7 +312,7 @@ class XmlManifest(object): | |||
312 | 312 | ||
313 | local_dir = os.path.abspath(os.path.join(self.repodir, LOCAL_MANIFESTS_DIR_NAME)) | 313 | local_dir = os.path.abspath(os.path.join(self.repodir, LOCAL_MANIFESTS_DIR_NAME)) |
314 | try: | 314 | try: |
315 | for local_file in os.listdir(local_dir): | 315 | for local_file in sorted(os.listdir(local_dir)): |
316 | if local_file.endswith('.xml'): | 316 | if local_file.endswith('.xml'): |
317 | try: | 317 | try: |
318 | nodes.append(self._ParseManifestXml(local_file, self.repodir)) | 318 | nodes.append(self._ParseManifestXml(local_file, self.repodir)) |