Skip to content

Commit

Permalink
Always normalize paths
Browse files Browse the repository at this point in the history
Apparently Mercurial can have paths such as 'foo//bar', so normalize all
paths.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
  • Loading branch information
felipec committed May 9, 2014
1 parent 51eabd4 commit 978314a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions git-remote-hg
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ class Parser:
return (user, int(date), -tz)

def fix_file_path(path):
path = os.path.normpath(path)

This comment has been minimized.

Copy link
@mindw

mindw Aug 1, 2014

This line breaks git-remote-hg with msysgit 1.9.4.

git clone hg::https://bitbucket.org/logilab/pylint plt_3 
error: unable to create file bin\epylint (No such file or directory)
error: unable to create file bin\epylint.bat (No such file or directory)
error: unable to create file bin\pylint (No such file or directory)
error: unable to create file bin\pylint-gui (No such file or directory)
...

This comment has been minimized.

Copy link
@CrossVR

CrossVR Jul 30, 2016

I can confirm that this change breaks git-remote-hg on windows. The reason for this is that os.path.normpath is defined to change the forward slashes to back slashes on Windows. And it also seems to add quotes around paths with spaces.

I submitted PR #60 with a suggested fix.

if not os.path.isabs(path):
return path
return os.path.relpath(path, '/')
Expand Down

0 comments on commit 978314a

Please sign in to comment.