Make path references OS independent
Change-Id: I5573995adfd52fd54bddc62d1d1ea78fb1328130
(cherry picked from commit b0f9a02394
)
Conflicts:
command.py
This commit is contained in:
parent
f18cb76173
commit
df14a70c45
4 changed files with 12 additions and 6 deletions
|
@ -74,7 +74,7 @@ class Command(object):
|
|||
project = all.get(arg)
|
||||
|
||||
if not project:
|
||||
path = os.path.abspath(arg)
|
||||
path = os.path.abspath(arg).replace('\\', '/')
|
||||
|
||||
if not by_path:
|
||||
by_path = dict()
|
||||
|
@ -82,13 +82,15 @@ class Command(object):
|
|||
by_path[p.worktree] = p
|
||||
|
||||
if os.path.exists(path):
|
||||
oldpath = None
|
||||
while path \
|
||||
and path != '/' \
|
||||
and path != oldpath \
|
||||
and path != self.manifest.topdir:
|
||||
try:
|
||||
project = by_path[path]
|
||||
break
|
||||
except KeyError:
|
||||
oldpath = path
|
||||
path = os.path.dirname(path)
|
||||
else:
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue