diff options
author | Anthony Newnam <anthony.newnam@garmin.com> | 2011-01-09 17:31:57 -0800 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2011-01-09 17:39:19 -0800 |
commit | df14a70c4529821d7450303ec553a9f608af1656 (patch) | |
tree | 4631409d5610fb103912687dc4f8321d9b46f3a4 /command.py | |
parent | f18cb761731a791bf1b9ee8c6308bfce5c9d3e62 (diff) | |
download | git-repo-df14a70c4529821d7450303ec553a9f608af1656.tar.gz |
Make path references OS independent
Change-Id: I5573995adfd52fd54bddc62d1d1ea78fb1328130
(cherry picked from commit b0f9a02394779c1c9422a9649412c9ac5fb0f12f)
Conflicts:
command.py
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: |