-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalize the path using replace(). #60
base: master
Are you sure you want to change the base?
Conversation
On Windows `os.path.normpath()` will add backslashes and quotes to the path which git can't handle.
Apparently Mercurial can have paths such as 'foo//bar', so normalize all paths. Signed-off-by: Felipe Contreras <[email protected]>
git-remote-hg
Outdated
@@ -265,7 +265,7 @@ class Parser: | |||
return (user, int(date), -tz) | |||
|
|||
def fix_file_path(path): | |||
path = os.path.normpath(path) | |||
path.replace('//', '/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to set path = path.replace('//', '/')
. Otherwise the replaced string isn't saved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's odd, because it worked for me. I'll correct it.
This solved the issue of paths being falsly detected as new for me. |
62ccc3c
to
6e13c1c
Compare
On Windows
os.path.normpath()
will add backslashes and quotes to the path which git can't handle.The original commit 978314a mentions that the intention for
os.path.normpath()
was to normalize paths with 'foo//bar'. Thus to make sure we don't get unintended consequences I suggest a manual replacement.