summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2012-11-14 04:53:24 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2012-11-14 05:05:32 +0900
commit52f1e5d9111c586624de48b5f705e10b67d109b3 (patch)
tree64861a0d67e6194626a5fa8cd1c8d044bd353e1b
parent8e3d355d448671e7c9b3409a3bbde971f90d7c28 (diff)
downloadgit-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.txt6
-rw-r--r--manifest_xml.py2
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`
249invocation, instructing repo to automatically download and manage 249invocation, instructing repo to automatically download and manage
250these extra projects. 250these extra projects.
251 251
252Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
253be loaded in alphabetical order.
254
252Additional remotes and projects may also be added through a local 255Additional remotes and projects may also be added through a local
253manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method 256manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method
254is deprecated in favor of using multiple manifest files as mentioned 257is deprecated in favor of using multiple manifest files as mentioned
255above. 258above.
259
260If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before
261any 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))