summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--command.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/command.py b/command.py
index 9e970e80..6e4e2c57 100644
--- a/command.py
+++ b/command.py
@@ -71,6 +71,12 @@ class Command(object):
71 """A list of projects that match the arguments. 71 """A list of projects that match the arguments.
72 """ 72 """
73 all = self.manifest.projects 73 all = self.manifest.projects
74
75 mp = self.manifest.manifestProject
76 if mp.relpath == '.':
77 all = dict(all)
78 all[mp.name] = mp
79
74 result = [] 80 result = []
75 81
76 if not args: 82 if not args:
@@ -91,7 +97,9 @@ class Command(object):
91 for p in all.values(): 97 for p in all.values():
92 by_path[p.worktree] = p 98 by_path[p.worktree] = p
93 99
94 if os.path.exists(path): 100 try:
101 project = by_path[path]
102 except KeyError:
95 while path \ 103 while path \
96 and path != '/' \ 104 and path != '/' \
97 and path != self.manifest.topdir: 105 and path != self.manifest.topdir:
@@ -100,11 +108,6 @@ class Command(object):
100 break 108 break
101 except KeyError: 109 except KeyError:
102 path = os.path.dirname(path) 110 path = os.path.dirname(path)
103 else:
104 try:
105 project = by_path[path]
106 except KeyError:
107 pass
108 111
109 if not project: 112 if not project:
110 raise NoSuchProjectError(arg) 113 raise NoSuchProjectError(arg)