From 451e31022a7039967e84e80c8dc66c84f07dd14b Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 5 May 2023 10:13:16 -0600 Subject: [PATCH 1/5] Restrict common discovery This was added in hg 4.5. Signed-off-by: Felipe Contreras --- git-remote-hg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/git-remote-hg b/git-remote-hg index 54a6949..ff00ec9 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -1027,7 +1027,10 @@ def push(repo, remote, parsed_refs, p_revs): force = force_push 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) From b274b8057e26da19e25c82d5fd93f49b35aaa6e3 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 5 May 2023 10:22:40 -0600 Subject: [PATCH 2/5] Don't force public pushes This is something that needs to explicitly happen. Signed-off-by: Felipe Contreras --- git-remote-hg | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/git-remote-hg b/git-remote-hg index ff00ec9..9262e91 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -1049,15 +1049,7 @@ def push(repo, remote, parsed_refs, p_revs): if force: remoteheads = [b'force'] - ret = remote.unbundle(cg, remoteheads, b'push') - - 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 + return remote.unbundle(cg, remoteheads, b'push') def check_tip(ref, kind, name, heads): try: From 79e75991ab3c7a757d4a77518643e81089e12682 Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Sat, 18 Nov 2023 00:49:16 -0600 Subject: [PATCH 3/5] Use raw strings for regexes Fixes #94. Signed-off-by: Felipe Contreras --- git-remote-hg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/git-remote-hg b/git-remote-hg index 9262e91..465f1af 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -72,11 +72,11 @@ else: # Commits are modified to preserve hg information and allow bidirectionality. # -NAME_RE = re.compile('^([^<>]+)') -AUTHOR_RE = re.compile('^([^<>]+?)? ?[<>]([^<>]*)(?:$|>)') +NAME_RE = re.compile(r'^([^<>]+)') +AUTHOR_RE = re.compile(r'^([^<>]+?)? ?[<>]([^<>]*)(?:$|>)') EMAIL_RE = re.compile(r'([^ \t<>]+@[^ \t<>]+)') -AUTHOR_HG_RE = re.compile('^(.*?) ?<(.*?)(?:>(.*))?$') -RAW_AUTHOR_RE = re.compile('^(\w+) (?:(.+)? )?<(.*)> (\d+) ([+-]\d+)') +AUTHOR_HG_RE = re.compile(r'^(.*?) ?<(.*?)(?:>(.*))?$') +RAW_AUTHOR_RE = re.compile(r'^(\w+) (?:(.+)? )?<(.*)> (\d+) ([+-]\d+)') VERSION = 2 @@ -258,7 +258,7 @@ class Parser: return None _, name, email, date, tz = m.groups() if name and 'ext:' in name: - m = re.match('^(.+?) ext:\((.+)\)$', name) + m = re.match(r'^(.+?) ext:\((.+)\)$', name) if m: name = m.group(1) ex = urlunquote(m.group(2)) @@ -328,7 +328,7 @@ def fixup_user_git(user): def fixup_user_hg(user): def sanitize(name): # stole this from hg-git - return re.sub('[<>\n]', '?', name.lstrip('< ').rstrip('> ')) + return re.sub(r'[<>\n]', '?', name.lstrip('< ').rstrip('> ')) m = AUTHOR_HG_RE.match(user) if m: From 615cc7fe045d0417ac97f7790ebe941b39652ad2 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Thu, 7 Mar 2024 01:07:07 -0600 Subject: [PATCH 4/5] github: disable windows tests It's not working. Probably related to actions/runner-images#7253. Signed-off-by: Felipe Contreras --- .github/workflows/ci.yml | 18 ------------------ 1 file changed, 18 deletions(-) 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 From 474cacd81d0f34717aebc6df473406285d5868ad Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 7 Mar 2025 23:53:09 -0600 Subject: [PATCH 5/5] check-versions: fix for newer ruby versions --- tools/check-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check-versions b/tools/check-versions index 3fcc9af..0cd7dd2 100755 --- a/tools/check-versions +++ b/tools/check-versions @@ -101,7 +101,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"