diff options
Diffstat (limited to 'command.py')
-rw-r--r-- | command.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -74,7 +74,7 @@ class Command(object): | |||
74 | project = all.get(arg) | 74 | project = all.get(arg) |
75 | 75 | ||
76 | if not project: | 76 | if not project: |
77 | path = os.path.abspath(arg) | 77 | path = os.path.abspath(arg).replace('\\', '/') |
78 | 78 | ||
79 | if not by_path: | 79 | if not by_path: |
80 | by_path = dict() | 80 | by_path = dict() |
@@ -82,13 +82,15 @@ class Command(object): | |||
82 | by_path[p.worktree] = p | 82 | by_path[p.worktree] = p |
83 | 83 | ||
84 | if os.path.exists(path): | 84 | if os.path.exists(path): |
85 | oldpath = None | ||
85 | while path \ | 86 | while path \ |
86 | and path != '/' \ | 87 | and path != oldpath \ |
87 | and path != self.manifest.topdir: | 88 | and path != self.manifest.topdir: |
88 | try: | 89 | try: |
89 | project = by_path[path] | 90 | project = by_path[path] |
90 | break | 91 | break |
91 | except KeyError: | 92 | except KeyError: |
93 | oldpath = path | ||
92 | path = os.path.dirname(path) | 94 | path = os.path.dirname(path) |
93 | else: | 95 | else: |
94 | try: | 96 | try: |