summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2012-11-15 17:33:11 -0800
committerConley Owens <cco3@android.com>2012-11-15 18:50:11 -0800
commit75ee0570da09abb1d2bbefe0d25f0560727e6b71 (patch)
treec62ab4990212282d9c18c694ec21830ad33481f2 /main.py
parent88b86728a4451b97a2c6dcae2feb98014c077793 (diff)
downloadgit-repo-75ee0570da09abb1d2bbefe0d25f0560727e6b71.tar.gz
Raise a NoManifestException when the manifest DNE
When a command (eg, `repo forall`) expects the manifest project to exist, but there is no manifest, an IOException gets raised. This change defines a new Exception type to be raised in these cases and raises it when project.py fails to read the manifest. Change-Id: Iac576c293a37f7d8f60cd4f6aa95b2c97f9e7957
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.py b/main.py
index 95944546..83967f77 100755
--- a/main.py
+++ b/main.py
@@ -42,6 +42,7 @@ from editor import Editor
42from error import DownloadError 42from error import DownloadError
43from error import ManifestInvalidRevisionError 43from error import ManifestInvalidRevisionError
44from error import ManifestParseError 44from error import ManifestParseError
45from error import NoManifestException
45from error import NoSuchProjectError 46from error import NoSuchProjectError
46from error import RepoChangedException 47from error import RepoChangedException
47from manifest_xml import XmlManifest 48from manifest_xml import XmlManifest
@@ -140,6 +141,10 @@ class _Repo(object):
140 except ManifestInvalidRevisionError as e: 141 except ManifestInvalidRevisionError as e:
141 print('error: %s' % str(e), file=sys.stderr) 142 print('error: %s' % str(e), file=sys.stderr)
142 result = 1 143 result = 1
144 except NoManifestException as e:
145 print('error: manifest required for this command -- please run init',
146 file=sys.stderr)
147 result = 1
143 except NoSuchProjectError as e: 148 except NoSuchProjectError as e:
144 if e.name: 149 if e.name:
145 print('error: project %s not found' % e.name, file=sys.stderr) 150 print('error: project %s not found' % e.name, file=sys.stderr)