Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 34979:b64ea7fb9599 stable
share: handle --relative shares to a different drive letter gracefully
This had the same problem as f445b10dc7fb. Banning os.path.relpath() is
tempting, but the hint it provides is useful here.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 02 Nov 2017 23:55:09 -0400 |
parents | 7d51a7792f52 |
children | 773a9a06047c |
comparison
equal
deleted
inserted
replaced
34965:f445b10dc7fb | 34979:b64ea7fb9599 |
---|---|
241 | 241 |
242 if relative: | 242 if relative: |
243 try: | 243 try: |
244 sharedpath = os.path.relpath(sharedpath, destvfs.base) | 244 sharedpath = os.path.relpath(sharedpath, destvfs.base) |
245 requirements += 'relshared\n' | 245 requirements += 'relshared\n' |
246 except IOError as e: | 246 except (IOError, ValueError) as e: |
247 # ValueError is raised on Windows if the drive letters differ on | |
248 # each path | |
247 raise error.Abort(_('cannot calculate relative path'), | 249 raise error.Abort(_('cannot calculate relative path'), |
248 hint=str(e)) | 250 hint=str(e)) |
249 else: | 251 else: |
250 requirements += 'shared\n' | 252 requirements += 'shared\n' |
251 | 253 |