mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-10-27 06:36:12 +01:00
Merge commit '60a1d7ae7a60988f122d8d9ba9ad3c693c5141ae' into felipec
These changes can be merged with limited conflict resolution.
This commit is contained in:
19
.github/workflows/main.yml
vendored
19
.github/workflows/main.yml
vendored
@@ -7,18 +7,17 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
hg: [ '5.5', '5.6', '5.7', '5.8', '5.9', '6.0', '6.1', '6.2', '6.3' ]
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.10'
|
||||||
check-latest: true
|
- uses: actions/cache@v3
|
||||||
- name: Cache check-versions script
|
id: cache-pip
|
||||||
id: cache-check-versions
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/git-remote-hg
|
path: ~/.cache/pip
|
||||||
key: check-versions
|
key: pip
|
||||||
- run: ./tools/check-versions $HG_VERSION
|
- name: Install hg
|
||||||
|
run:
|
||||||
|
pip install mercurial==${{ matrix.hg }}
|
||||||
|
- run: make test
|
||||||
|
|||||||
@@ -411,16 +411,13 @@ class Parser:
|
|||||||
return (user, int(date), hgtz(tz))
|
return (user, int(date), hgtz(tz))
|
||||||
|
|
||||||
def fix_file_path(path):
|
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)
|
path = os.path.normpath(path)
|
||||||
if not os.path.isabs(path):
|
if os.path.isabs(path):
|
||||||
return posix_path(path)
|
path = os.path.relpath(path, b'/')
|
||||||
return posix_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):
|
def export_files(files):
|
||||||
final = []
|
final = []
|
||||||
@@ -1757,8 +1754,7 @@ def fix_path(alias, repo, orig_url):
|
|||||||
url = compat.urlparse(orig_url, b'file')
|
url = compat.urlparse(orig_url, b'file')
|
||||||
if url.scheme != b'file' or os.path.isabs(os.path.expanduser(url.path)):
|
if url.scheme != b'file' or os.path.isabs(os.path.expanduser(url.path)):
|
||||||
return
|
return
|
||||||
abs_url = compat.urljoin(b"%s/" % compat.getcwd(), orig_url)
|
cmd = ['git', 'config', b'remote.%s.url' % alias, b"hg::%s" % os.path.abspath(orig_url)]
|
||||||
cmd = ['git', 'config', b'remote.%s.url' % alias, b"hg::%s" % abs_url]
|
|
||||||
subprocess.call(cmd)
|
subprocess.call(cmd)
|
||||||
|
|
||||||
def select_private_refs(alias):
|
def select_private_refs(alias):
|
||||||
|
|||||||
Reference in New Issue
Block a user