Mercurial > hg > mercurial-source
diff mercurial/hg.py @ 35762: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 |
line wrap: on
line diff
--- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -243,7 +243,9 @@ try: sharedpath = os.path.relpath(sharedpath, destvfs.base) requirements += 'relshared\n' - except IOError as e: + except (IOError, ValueError) as e: + # ValueError is raised on Windows if the drive letters differ on + # each path raise error.Abort(_('cannot calculate relative path'), hint=str(e)) else: