mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-10-26 06:06:06 +01:00
Merge commit '474cacd81d0f34717aebc6df473406285d5868ad' into felipec
These changes can be merged with limited conflict resolution.
This commit is contained in:
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@@ -23,21 +23,3 @@ jobs:
|
||||
run:
|
||||
pip install mercurial==${{ matrix.hg }}
|
||||
- run: make test
|
||||
test-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- uses: actions/cache@v3
|
||||
id: cache-pip
|
||||
with:
|
||||
path: ~/appdata/local/pip/cache
|
||||
key: pip-windows
|
||||
- name: Install hg
|
||||
run:
|
||||
pip install mercurial
|
||||
- name: Run all tests
|
||||
run: |
|
||||
make SHELL='C:/Program Files/Git/usr/bin/bash' -C test
|
||||
|
||||
@@ -147,10 +147,10 @@ else:
|
||||
# Commits are modified to preserve hg information and allow bidirectionality.
|
||||
#
|
||||
|
||||
NAME_RE = re.compile(b'^([^<>]+)')
|
||||
AUTHOR_RE = re.compile(b'^([^<>]+?)? ?[<>]([^<>]*)(?:$|>)')
|
||||
NAME_RE = re.compile(br'^([^<>]+)')
|
||||
AUTHOR_RE = re.compile(br'^([^<>]+?)? ?[<>]([^<>]*)(?:$|>)')
|
||||
EMAIL_RE = re.compile(br'([^ \t<>]+@[^ \t<>]+)')
|
||||
AUTHOR_HG_RE = re.compile(b'^(.*?) ?<(.*?)(?:>(.*))?$')
|
||||
AUTHOR_HG_RE = re.compile(br'^(.*?) ?<(.*?)(?:>(.*))?$')
|
||||
RAW_AUTHOR_RE = re.compile(br'^(\w+) (?:(.+)? )?<(.*)> (\d+) ([+-]\d+)')
|
||||
|
||||
VERSION = 2
|
||||
@@ -466,7 +466,7 @@ def fixup_user_git(user):
|
||||
def fixup_user_hg(user):
|
||||
def sanitize(name):
|
||||
# stole this from hg-git
|
||||
return re.sub(b'[<>\n]', b'?', name.lstrip(b'< ').rstrip(b'> '))
|
||||
return re.sub(br'[<>\n]', b'?', name.lstrip(b'< ').rstrip(b'> '))
|
||||
|
||||
m = AUTHOR_HG_RE.match(user)
|
||||
if m:
|
||||
@@ -1319,7 +1319,10 @@ def checkheads(repo, remote, p_revs, force):
|
||||
def push_unsafe(repo, remote, p_revs, force):
|
||||
|
||||
fci = discovery.findcommonincoming
|
||||
commoninc = fci(repo, remote, force=force)
|
||||
if check_version(4, 5):
|
||||
commoninc = fci(repo, remote, force=force, ancestorsof=list(p_revs))
|
||||
else:
|
||||
commoninc = fci(repo, remote, force=force)
|
||||
common, _, remoteheads = commoninc
|
||||
fco = discovery.findcommonoutgoing
|
||||
outgoing = fco(repo, remote, onlyheads=list(p_revs), commoninc=commoninc, force=force)
|
||||
@@ -1350,12 +1353,6 @@ def push_unsafe(repo, remote, p_revs, force):
|
||||
else:
|
||||
ret = remote.addchangegroup(cg, b'push', repo.url())
|
||||
|
||||
phases = remote.listkeys(b'phases')
|
||||
if phases:
|
||||
for head in p_revs:
|
||||
# update to public
|
||||
remote.pushkey(b'phases', hghex(head), b'1', b'0')
|
||||
|
||||
return ret
|
||||
|
||||
def push(repo, remote, p_revs, force):
|
||||
|
||||
@@ -107,7 +107,7 @@ def setup
|
||||
FileUtils.mkdir_p(dirs.map { |e| "#{$builddir}/#{e}" })
|
||||
FileUtils.mkdir_p($workdir)
|
||||
|
||||
return if File.exists?($hg.dir)
|
||||
return if File.exist?($hg.dir)
|
||||
|
||||
if $verbosity < HIGH
|
||||
puts "Cloning hg"
|
||||
|
||||
Reference in New Issue
Block a user