Merge commit '60a1d7ae7a60988f122d8d9ba9ad3c693c5141ae' into felipec

These changes can be merged with limited conflict resolution.
This commit is contained in:
Mark Nauwelaerts
2025-04-30 19:16:33 +02:00
2 changed files with 16 additions and 21 deletions

View File

@@ -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/checkout@v3
- 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

View File

@@ -411,16 +411,13 @@ class Parser:
return (user, int(date), hgtz(tz))
def fix_file_path(path):
def posix_path(path):
if os.sep == '/':
return path
# even Git for Windows expects forward
return path.replace(compat.to_b(os.sep), b'/')
# also converts forward slash to backwards slash on Win
path = os.path.normpath(path)
if not os.path.isabs(path):
return posix_path(path)
return posix_path(os.path.relpath(path, b'/'))
if os.path.isabs(path):
path = os.path.relpath(path, b'/')
if os.sep == '/':
return path
# even Git for Windows expects forward
return path.replace(compat.to_b(os.sep), b'/')
def export_files(files):
final = []
@@ -1757,8 +1754,7 @@ def fix_path(alias, repo, orig_url):
url = compat.urlparse(orig_url, b'file')
if url.scheme != b'file' or os.path.isabs(os.path.expanduser(url.path)):
return
abs_url = compat.urljoin(b"%s/" % compat.getcwd(), orig_url)
cmd = ['git', 'config', b'remote.%s.url' % alias, b"hg::%s" % abs_url]
cmd = ['git', 'config', b'remote.%s.url' % alias, b"hg::%s" % os.path.abspath(orig_url)]
subprocess.call(cmd)
def select_private_refs(alias):