diff options
| author | Anthony Newnam <anthony.newnam@garmin.com> | 2010-11-29 13:15:24 -0600 |
|---|---|---|
| committer | Anthony Newnam <anthony.newnam@garmin.com> | 2010-11-29 13:17:53 -0600 |
| commit | b0f9a02394779c1c9422a9649412c9ac5fb0f12f (patch) | |
| tree | f7cb755beb0dd1a24406a714d9433ecebf6ed208 /command.py | |
| parent | 69b1e8aa65ab933fa919166d88aec90c86852beb (diff) | |
| download | git-repo-b0f9a02394779c1c9422a9649412c9ac5fb0f12f.tar.gz | |
Make path references OS independent
Change-Id: I5573995adfd52fd54bddc62d1d1ea78fb1328130
Diffstat (limited to 'command.py')
| -rw-r--r-- | command.py | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -90,7 +90,7 @@ class Command(object): | |||
| 90 | project = all.get(arg) | 90 | project = all.get(arg) |
| 91 | 91 | ||
| 92 | if not project: | 92 | if not project: |
| 93 | path = os.path.abspath(arg) | 93 | path = os.path.abspath(arg).replace('\\', '/') |
| 94 | 94 | ||
| 95 | if not by_path: | 95 | if not by_path: |
| 96 | by_path = dict() | 96 | by_path = dict() |
| @@ -100,13 +100,15 @@ class Command(object): | |||
| 100 | try: | 100 | try: |
| 101 | project = by_path[path] | 101 | project = by_path[path] |
| 102 | except KeyError: | 102 | except KeyError: |
| 103 | oldpath = None | ||
| 103 | while path \ | 104 | while path \ |
| 104 | and path != '/' \ | 105 | and path != oldpath \ |
| 105 | and path != self.manifest.topdir: | 106 | and path != self.manifest.topdir: |
| 106 | try: | 107 | try: |
| 107 | project = by_path[path] | 108 | project = by_path[path] |
| 108 | break | 109 | break |
| 109 | except KeyError: | 110 | except KeyError: |
| 111 | oldpath = path | ||
| 110 | path = os.path.dirname(path) | 112 | path = os.path.dirname(path) |
| 111 | 113 | ||
| 112 | if not project: | 114 | if not project: |
