summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2013-02-14 16:28:44 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2013-02-17 21:23:33 +0900
commit4eb285cf902a46c3c99bc2c999e486d7c218354b (patch)
tree044641d5bea20fd499c7004246670dad8fc085f0
parent5f434ed723ac14cdcea12d038c066c0653e1ef3a (diff)
downloadgit-repo-4eb285cf902a46c3c99bc2c999e486d7c218354b.tar.gz
Fix: local manifest deprecation warning appears more than once
When running repo sync, the local_manifest.xml deprecation warning is shown twice. Add a flag to ensure that it is only displayed once. Change-Id: Icfa2b0b6249c037c29771f9860252e6eda3ae651
-rw-r--r--manifest_xml.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/manifest_xml.py b/manifest_xml.py
index 07f0c66a..50417c60 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -94,6 +94,7 @@ class XmlManifest(object):
94 self.topdir = os.path.dirname(self.repodir) 94 self.topdir = os.path.dirname(self.repodir)
95 self.manifestFile = os.path.join(self.repodir, MANIFEST_FILE_NAME) 95 self.manifestFile = os.path.join(self.repodir, MANIFEST_FILE_NAME)
96 self.globalConfig = GitConfig.ForUser() 96 self.globalConfig = GitConfig.ForUser()
97 self.localManifestWarning = False
97 98
98 self.repoProject = MetaProject(self, 'repo', 99 self.repoProject = MetaProject(self, 'repo',
99 gitdir = os.path.join(repodir, 'repo/.git'), 100 gitdir = os.path.join(repodir, 'repo/.git'),
@@ -335,9 +336,11 @@ class XmlManifest(object):
335 336
336 local = os.path.join(self.repodir, LOCAL_MANIFEST_NAME) 337 local = os.path.join(self.repodir, LOCAL_MANIFEST_NAME)
337 if os.path.exists(local): 338 if os.path.exists(local):
338 print('warning: %s is deprecated; put local manifests in `%s` instead' 339 if not self.localManifestWarning:
339 % (LOCAL_MANIFEST_NAME, os.path.join(self.repodir, LOCAL_MANIFESTS_DIR_NAME)), 340 self.localManifestWarning = True
340 file=sys.stderr) 341 print('warning: %s is deprecated; put local manifests in `%s` instead'
342 % (LOCAL_MANIFEST_NAME, os.path.join(self.repodir, LOCAL_MANIFESTS_DIR_NAME)),
343 file=sys.stderr)
341 nodes.append(self._ParseManifestXml(local, self.repodir)) 344 nodes.append(self._ParseManifestXml(local, self.repodir))
342 345
343 local_dir = os.path.abspath(os.path.join(self.repodir, LOCAL_MANIFESTS_DIR_NAME)) 346 local_dir = os.path.abspath(os.path.join(self.repodir, LOCAL_MANIFESTS_DIR_NAME))