diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 027b999..6586f84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/git-remote-hg b/git-remote-hg index 6941dfd..b480fbf 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -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): diff --git a/tools/check-versions b/tools/check-versions index daaee3d..aadd626 100755 --- a/tools/check-versions +++ b/tools/check-versions @@ -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"