From 40c5c34e7ca8ce691eb43adacbd22aecbfa18e66 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 27 Sep 2010 17:41:29 +0200 Subject: [PATCH] git-remote-hg: improve sanitation of local repo urls Remove an optional "/.hg" suffix, as mercurial doesn't like to operate from the .hg directory, and make sure the path is absolute. --- git-remote-hg.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/git-remote-hg.py b/git-remote-hg.py index 7ad13c76ca..8cb1f3c104 100644 --- a/git-remote-hg.py +++ b/git-remote-hg.py @@ -220,6 +220,13 @@ def sanitize(value): if value.startswith('hg::'): value = value[4:] + # for local URLs (no protocol), remove a terminal + # /.hg and make sure the path is absolute + if value.find("://") == -1: + if value.endswith("/.hg"): + value = value[:-4] + value = os.path.abspath(value) + return value -- 2.32.0.93.g670b81a890