[PATCH 1 of 3] ci: update the path to the upsteam Mercurial repo

10 views
Skip to first unread message

Matt Harbison

unread,
Jul 8, 2024, 11:13:45 PMJul 8
to thg...@googlegroups.com
# HG changeset patch
# User Matt Harbison <matt_h...@yahoo.com>
# Date 1720453270 14400
# Mon Jul 08 11:41:10 2024 -0400
# Branch stable
# Node ID 182597dc2735b7eee38f4fb41bdbcdd3b9540d0a
# Parent 333fa9d5b778e32aa9290453daa0f52820bb6a48
# EXP-Topic ci-fix
ci: update the path to the upsteam Mercurial repo

This CI image seems to have "https://mirror.octobus.net/hg/" baked into the
existing repo. We should update the image to fix that, use a modern python,
etc, but I don't want to deal with that right now.

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,7 +6,7 @@
- apt-get update
- apt-get -y install python3-pyqt5 python3-pyqt5.qsci xvfb
- pip3 install --user nose
- - hg -R /ci/repos/mercurial pull
+ - hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg
- hg -R /ci/repos/mercurial update 'tag("re:\A5\.9")'
- hg -R /ci/repos/mercurial summary
- make -C /ci/repos/mercurial local PYTHON=python3
@@ -20,7 +20,7 @@
- apt-get update
- apt-get -y install python3-pyqt5 python3-pyqt5.qsci xvfb
- pip3 install --user nose
- - hg -R /ci/repos/mercurial pull
+ - hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg
- hg -R /ci/repos/mercurial update 'tag("re:\A6\.0")'
- hg -R /ci/repos/mercurial summary
- make -C /ci/repos/mercurial local PYTHON=python3
@@ -34,7 +34,7 @@
- apt-get update
- apt-get -y install python3-pyqt5 python3-pyqt5.qsci xvfb
- pip3 install --user nose
- - hg -R /ci/repos/mercurial pull
+ - hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg
- hg -R /ci/repos/mercurial update 'tag("re:\A6\.1")'
- hg -R /ci/repos/mercurial summary
- make -C /ci/repos/mercurial local PYTHON=python3
@@ -48,7 +48,7 @@
- apt-get update
- apt-get -y install python3-pyqt5 python3-pyqt5.qsci xvfb
- pip3 install --user nose
- - hg -R /ci/repos/mercurial pull
+ - hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg
- hg -R /ci/repos/mercurial update 'tag("re:\A6\.2")'
- hg -R /ci/repos/mercurial summary
- make -C /ci/repos/mercurial local PYTHON=python3
@@ -62,7 +62,7 @@
- apt-get update
- apt-get -y install python3-pyqt5 python3-pyqt5.qsci xvfb
- pip3 install --user nose
- - hg -R /ci/repos/mercurial pull
+ - hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg
- hg -R /ci/repos/mercurial update 'tag("re:\A6\.3")'
- hg -R /ci/repos/mercurial summary
- make -C /ci/repos/mercurial local PYTHON=python3
@@ -76,7 +76,7 @@
- apt-get update
- apt-get -y install python3-pyqt5 python3-pyqt5.qsci xvfb
- pip3 install --user nose
- - hg -R /ci/repos/mercurial pull
+ - hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg
- hg -R /ci/repos/mercurial update 'tag("re:\A6\.4")'
- hg -R /ci/repos/mercurial summary
- make -C /ci/repos/mercurial local PYTHON=python3
@@ -90,7 +90,7 @@
- apt-get update
- apt-get -y install python3-pyqt5 python3-pyqt5.qsci xvfb
- pip3 install --user nose
- - hg -R /ci/repos/mercurial pull
+ - hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg
- hg -R /ci/repos/mercurial update 'tag("re:\A6\.5")'
- hg -R /ci/repos/mercurial summary
- make -C /ci/repos/mercurial local PYTHON=python3
@@ -104,7 +104,7 @@
- apt-get update
- apt-get -y install python3-pyqt5 python3-pyqt5.qsci xvfb
- pip3 install --user nose
- - hg -R /ci/repos/mercurial pull
+ - hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg
- hg -R /ci/repos/mercurial update 'tag("re:\A6\.6")'
- hg -R /ci/repos/mercurial summary
- make -C /ci/repos/mercurial local PYTHON=python3
@@ -118,7 +118,7 @@
- apt-get update
- apt-get -y install python3-pyqt5 python3-pyqt5.qsci xvfb
- pip3 install --user nose
- - hg -R /ci/repos/mercurial pull
+ - hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg
- hg -R /ci/repos/mercurial update stable
- hg -R /ci/repos/mercurial summary
- make -C /ci/repos/mercurial local PYTHON=python3
@@ -132,7 +132,7 @@
- apt-get update
- apt-get -y install python3-pyqt5 python3-pyqt5.qsci xvfb
- pip3 install --user nose
- - hg -R /ci/repos/mercurial pull
+ - hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg
- hg -R /ci/repos/mercurial update default
- hg -R /ci/repos/mercurial summary
- make -C /ci/repos/mercurial local PYTHON=python3
@@ -146,7 +146,7 @@
- apt-get update
- apt-get -y install python3-pyqt5 python3-pyqt5.qsci
- pip3 install --user --upgrade libcst==0.3.20 pytype==2022.03.29
- - hg -R /ci/repos/mercurial pull
+ - hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg
- hg -R /ci/repos/mercurial update stable
- hg -R /ci/repos/mercurial summary
- make local PYTHON=python3 HGPATH=/ci/repos/mercurial
@@ -159,7 +159,7 @@
- apt-get update
- apt-get -y install python3-pyqt5 python3-pyqt5.qsci
- pip3 install --user --upgrade libcst==0.3.20 pytype==2022.03.29
- - hg -R /ci/repos/mercurial pull
+ - hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg
- hg -R /ci/repos/mercurial update default
- hg -R /ci/repos/mercurial summary
- make local PYTHON=python3 HGPATH=/ci/repos/mercurial
diff --git a/contrib/generate_gitlab_ci_yml.py b/contrib/generate_gitlab_ci_yml.py
--- a/contrib/generate_gitlab_ci_yml.py
+++ b/contrib/generate_gitlab_ci_yml.py
@@ -39,7 +39,7 @@
else:
update_to = rf"""'tag("re:\A{re.escape(hgver)}")'"""
return [
- 'hg -R /ci/repos/mercurial pull',
+ 'hg -R /ci/repos/mercurial pull https://repo.mercurial-scm.org/hg',
f'hg -R /ci/repos/mercurial update {update_to}',
'hg -R /ci/repos/mercurial summary',
]

Matt Harbison

unread,
Jul 8, 2024, 11:13:47 PMJul 8
to thg...@googlegroups.com
# HG changeset patch
# User Matt Harbison <matt_h...@yahoo.com>
# Date 1720457848 14400
# Mon Jul 08 12:57:28 2024 -0400
# Branch stable
# Node ID 58abc5c5d07e53fbd9efc03f6011c97a4dfa00c8
# Parent 182597dc2735b7eee38f4fb41bdbcdd3b9540d0a
# EXP-Topic ci-fix
status: add some typehints

These were needed to figure out why auto-exclude isn't working. More would be
nice, but it's a complex module.

diff --git a/tortoisehg/hgqt/status.py b/tortoisehg/hgqt/status.py
--- a/tortoisehg/hgqt/status.py
+++ b/tortoisehg/hgqt/status.py
@@ -55,6 +55,7 @@
context,
error,
hg,
+ mergestate as mergestatemod,
pycompat,
scmutil,
util,
@@ -70,6 +71,10 @@
qtlib,
)

+from typing import (
+ Dict,
+)
+
# This widget can be used as the basis of the commit tool or any other
# working copy browser.

@@ -460,7 +465,13 @@
def canExit(self):
return not self.isRefreshingWctx()

- def updateModel(self, wctx, wstatus, patchecked, amending):
+ def updateModel(
+ self,
+ wctx,
+ wstatus: scmutil.status,
+ patchecked: Dict[bytes, bool],
+ amending,
+ ) -> None:
self.tv.setSortingEnabled(False)
oldtm = self.tv.model()
if oldtm:
@@ -695,13 +706,13 @@
self.opts = opts
self.wctx = None
self.wstatus = None
- self.patchecked = {}
+ self.patchecked: Dict[bytes, bool] = {}
self.amending = set()

def run(self):
extract = lambda x, y: dict(zip(x, pycompat.maplist(y.get, x)))
stopts = extract(('unknown', 'ignored', 'clean'), self.opts)
- patchecked = {}
+ patchecked: Dict[bytes, bool] = {}
try:
if self.pats:
if self.opts.get('checkall'):
@@ -779,23 +790,32 @@
checkCountChanged = pyqtSignal()
checkToggled = pyqtSignal(str, bool)

- def __init__(self, repoagent, wctx, wstatus, ms, pctx, savechecks, opts,
- checked, parent, checkable=True, defcheck='MAR!S',
- amending=None):
+ def __init__(self, repoagent, wctx,
+ wstatus: scmutil.status,
+ ms: mergestatemod.mergestate,
+ pctx,
+ savechecks: bool,
+ opts,
+ checked: Dict[bytes, bool],
+ parent,
+ checkable: bool=True,
+ defcheck: str='MAR!S',
+ amending=None,
+ ) -> None:
QAbstractTableModel.__init__(self, parent)
self._repoagent = repoagent
self._pctx = pctx
self.partials = parent.partials
self.checkCount = 0
rows = []
- nchecked = {}
+ nchecked: Dict[bytes, bool] = {}
excludestr = opts.get('ciexclude', '')
assert isinstance(excludestr, str)
excludes = [f.strip() for f in excludestr.split(',')]
if amending is None:
amending = set()

- def mkrow(fname, st):
+ def mkrow(fname: bytes, st: str):
ext, sizek = '', ''
try:
mst = fname in ms and pycompat.sysstr(ms[fname].upper()) or ""
@@ -806,7 +826,7 @@
pass
return [fname, st, mst, hglib.tounicode(fname), ext[1:], sizek]
if not savechecks:
- checked = {}
+ checked: Dict[bytes, bool] = {}
if pctx:
# Currently, having a patch context means it's a qrefresh, so only
# auto-check files in pctx.files()
@@ -1107,11 +1127,11 @@
self.layoutChanged.emit()
self.endResetModel()

- def getChecked(self):
+ def getChecked(self) -> Dict[bytes, bool]:
assert len(self.checked) == len(self.unfiltered)
return self.checked.copy()

-def statusMessage(status, mst, upath):
+def statusMessage(status: str, mst: str, upath: str):
tip = ''
if status in statusTypes:
upath = "<span style='font-family:Courier'>%s </span>" % upath
@@ -1124,7 +1144,9 @@

class StatusType(object):
preferredOrder = 'MAR!?ICS'
- def __init__(self, name, icon, desc, uilabel, trname):
+ def __init__(
+ self, name: str, icon: str, desc: str, uilabel: str, trname: str
+ ) -> None:
self.name = name
self.icon = icon
self.desc = desc

Matt Harbison

unread,
Jul 8, 2024, 11:13:48 PMJul 8
to thg...@googlegroups.com
# HG changeset patch
# User Matt Harbison <matt_h...@yahoo.com>
# Date 1720458793 14400
# Mon Jul 08 13:13:13 2024 -0400
# Branch stable
# Node ID bd2acf2df96bba9afb55b9c7934580bbca66026e
# Parent 58abc5c5d07e53fbd9efc03f6011c97a4dfa00c8
# EXP-Topic ci-fix
status: fix the auto-exclude list processing (fixes #5985)

All other paths here are bytes here.

diff --git a/tortoisehg/hgqt/status.py b/tortoisehg/hgqt/status.py
--- a/tortoisehg/hgqt/status.py
+++ b/tortoisehg/hgqt/status.py
@@ -811,7 +811,7 @@
nchecked: Dict[bytes, bool] = {}
excludestr = opts.get('ciexclude', '')
assert isinstance(excludestr, str)
- excludes = [f.strip() for f in excludestr.split(',')]
+ excludes = [f.strip() for f in hglib.fromunicode(excludestr).split(b',')]

Yuya Nishihara

unread,
Jul 9, 2024, 6:45:06 AMJul 9
to Matt Harbison, thg...@googlegroups.com
On Mon, 08 Jul 2024 23:13:40 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_h...@yahoo.com>
> # Date 1720453270 14400
> # Mon Jul 08 11:41:10 2024 -0400
> # Branch stable
> # Node ID 182597dc2735b7eee38f4fb41bdbcdd3b9540d0a
> # Parent 333fa9d5b778e32aa9290453daa0f52820bb6a48
> # EXP-Topic ci-fix
> ci: update the path to the upsteam Mercurial repo

Queued for stable, thanks.
Reply all
Reply to author
Forward
0 new messages