소스 검색

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
David Pursehouse 13 년 전
부모
커밋
52f1e5d911
2개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 0
      docs/manifest-format.txt
  2. 1 1
      manifest_xml.py

+ 6 - 0
docs/manifest-format.txt

@@ -249,7 +249,13 @@ Users may add projects to the local manifest(s) prior to a `repo sync`
 invocation, instructing repo to automatically download and manage
 these extra projects.
 
+Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
+be loaded in alphabetical order.
+
 Additional remotes and projects may also be added through a local
 manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method
 is deprecated in favor of using multiple manifest files as mentioned
 above.
+
+If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before
+any manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.

+ 1 - 1
manifest_xml.py

@@ -312,7 +312,7 @@ class XmlManifest(object):
 
       local_dir = os.path.abspath(os.path.join(self.repodir, LOCAL_MANIFESTS_DIR_NAME))
       try:
-        for local_file in os.listdir(local_dir):
+        for local_file in sorted(os.listdir(local_dir)):
           if local_file.endswith('.xml'):
             try:
               nodes.append(self._ParseManifestXml(local_file, self.repodir))