From bb663c032fc632008b7af9f99c1a48aaad196739 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 6 Mar 2023 14:08:41 -0600 Subject: [PATCH 1/4] github: use standard hg packages Signed-off-by: Felipe Contreras --- .github/workflows/main.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bd0040e..ac6496f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,18 +7,17 @@ jobs: strategy: matrix: hg: [ '5.5', '5.6', '5.7', '5.8', '5.9', '6.0', '6.1', '6.2', '6.3' ] - env: - HG_VERSION: ${{ matrix.hg }} steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v4 with: python-version: '3.10' - check-latest: true - - name: Cache check-versions script - id: cache-check-versions - uses: actions/cache@v3 + - uses: actions/cache@v3 + id: cache-pip with: - path: ~/.cache/git-remote-hg - key: check-versions - - run: ./tools/check-versions $HG_VERSION + path: ~/.cache/pip + key: pip + - name: Install hg + run: + pip install mercurial==${{ matrix.hg }} + - run: make test From 9916fead4657b165dff69222f576761388070934 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 6 Mar 2023 14:39:44 -0600 Subject: [PATCH 2/4] github: trivial update Signed-off-by: Felipe Contreras --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ac6496f..f8753db 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: matrix: hg: [ '5.5', '5.6', '5.7', '5.8', '5.9', '6.0', '6.1', '6.2', '6.3' ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: '3.10' From 10aec96d8817435acc22ef8a7f189868e701258e Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Tue, 7 Mar 2023 11:33:30 -0600 Subject: [PATCH 3/4] Simplify absolute path fix This actually works on Windows. Signed-off-by: Felipe Contreras --- git-remote-hg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git-remote-hg b/git-remote-hg index 0950298..f860d57 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -1284,8 +1284,7 @@ def fix_path(alias, repo, orig_url): url = urlparse(orig_url, 'file') if url.scheme != 'file' or os.path.isabs(os.path.expanduser(url.path)): return - abs_url = urljoin("%s/" % os.getcwd(), orig_url) - cmd = ['git', 'config', 'remote.%s.url' % alias, "hg::%s" % abs_url] + cmd = ['git', 'config', 'remote.%s.url' % alias, "hg::%s" % os.path.abspath(orig_url)] subprocess.call(cmd) def main(args): From 60a1d7ae7a60988f122d8d9ba9ad3c693c5141ae Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 7 Mar 2023 11:43:54 -0600 Subject: [PATCH 4/4] Fix for paths in Windows Rewritten-by: Felipe Contreras Signed-off-by: Felipe Contreras --- git-remote-hg | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/git-remote-hg b/git-remote-hg index f860d57..1778144 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -299,9 +299,12 @@ class Parser: def fix_file_path(path): path = os.path.normpath(path.decode()) - if not os.path.isabs(path): + if os.path.isabs(path): + path = os.path.relpath(path, '/') + if os.sep == '/': return path - return os.path.relpath(path, '/') + # Git for Windows expects forward + return path.replace(os.sep, '/') def export_files(files): final = []