Skip to content

Commit

Permalink
Merge commit '3bafc9e08' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Dec 24, 2023
2 parents 3b763ba + 3bafc9e commit 830a1f2
Show file tree
Hide file tree
Showing 14 changed files with 254 additions and 57 deletions.
1 change: 0 additions & 1 deletion .github/workflows/taskcluster.yml
Expand Up @@ -9,7 +9,6 @@ jobs:
PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin
steps:
- uses: actions/checkout@v3
- run: sudo -H python2.7 -m pip install pip==20.3.4 wheel==0.37.0 --upgrade
- uses: actions/setup-python@v4
with:
python-version: '3.9.14'
Expand Down
33 changes: 33 additions & 0 deletions CI/decision.py
Expand Up @@ -116,9 +116,13 @@ def __init__(self, **kwargs):
if env.os == 'macos':
output_sync = ''
kwargs['command'] = command + [
'hg init repo/hg.pure.hg',
'hg -R repo/hg.pure.hg unbundle bundle.hg',
'make -C repo -f CI/tests.mk -j$({}){}'
.format(nproc(env), output_sync),
]
kwargs.setdefault('mounts', []).append(
{'file:bundle.hg': HgClone.by_name(MERCURIAL_VERSION)})

if variant == 'coverage':
kwargs['command'].extend([
Expand Down Expand Up @@ -199,6 +203,35 @@ def __init__(self, version):
)


class HgClone(Task, metaclass=Tool):
PREFIX = "hgclone"

def __init__(self, version):
if REPO == DEFAULT_REPO:
index = 'hgclone.{}'.format(version)
else:
index = 'hgclone.{}.{}'.format(
hashlib.sha1(REPO).hexdigest(), version)
hg_task = Hg.by_name(f'linux.{version}')
Task.__init__(
self,
task_env=TaskEnvironment.by_name('linux.test'),
description=f'hg clone w/ {version}',
index=index,
expireIn='26 weeks',
command=hg_task.install() + [
'hg clone -U --stream $REPO repo',
'hg -R repo bundle -t none-v1 -a $ARTIFACTS/bundle.hg',
],
mounts=[hg_task.mount()],
artifact='bundle.hg',
env={
'REPO': REPO,
},
priority='high',
)


@action('decision')
def decision():
for env in ('linux', 'mingw64', 'osx'):
Expand Down
5 changes: 2 additions & 3 deletions CI/msys.py
Expand Up @@ -107,11 +107,12 @@ def __init__(self, name):
create_commands = [
'pacman-key --init',
'pacman-key --populate msys2',
'pacman-key --refresh',
'pacman --noconfirm -Sy procps tar {}'.format(
' '.join(self.packages(name))),
'pkill gpg-agent',
'pkill dirmngr',
'rm -rf /var/cache/pacman/pkg',
'python2.7 -m pip install pip==20.3.4 wheel==0.37.1 --upgrade',
'python3 -m pip install pip==22.2.2 wheel==0.37.1 --upgrade',
'mv {}/{}/bin/{{mingw32-,}}make.exe'.format(msys(cpu), mingw(cpu)),
'tar -c --hard-dereference {} | zstd -c > msys2.tar.zst'.format(
Expand Down Expand Up @@ -144,8 +145,6 @@ def mingw_packages(pkgs):
packages = mingw_packages([
'curl',
'make',
'python2',
'python2-pip',
'python3',
'python3-pip',
])
Expand Down
2 changes: 1 addition & 1 deletion CI/start-worker.sh
Expand Up @@ -40,7 +40,7 @@ EOF

env

curl -OL https://github.com/taskcluster/taskcluster/releases/download/v54.1.2/generic-worker-simple-darwin-amd64
curl -OL https://github.com/taskcluster/taskcluster/releases/download/v54.4.0/generic-worker-simple-darwin-amd64
chmod +x generic-worker-simple-darwin-amd64
mkdir tasks
./generic-worker-simple-darwin-amd64 new-ed25519-keypair --file worker.key
Expand Down
11 changes: 6 additions & 5 deletions CI/tests.mk
Expand Up @@ -157,7 +157,7 @@ hg.clonebundles-full.git: hg.clonebundles-full.hg hg.git
hg.clonebundles-bz2.git: hg.clonebundles-bz2.hg hg.git
hg.clonebundles-full-bz2.git: hg.clonebundles-full-bz2.hg hg.git
hg.clonebundles.git hg.clonebundles-full.git hg.clonebundles-bz2.git hg.clonebundles-full-bz2.git:
$(HG) -R $< --config serve.other=http --config serve.otherport=88$(NUM) --config web.port=80$(NUM) --config extensions.clonebundles= --config extensions.x=$(TOPDIR)/CI/hg-serve-exec.py serve-and-exec -- $(GIT) clone --progress -n hg://localhost:80$(NUM).http/ $@
$(HG) -R $< --config serve.other=http --config serve.otherport=88$(NUM) --config web.port=80$(NUM) --config experimental.httppostargs=true --config extensions.clonebundles= --config extensions.x=$(TOPDIR)/CI/hg-serve-exec.py serve-and-exec -- $(GIT) clone --progress -n hg://localhost:80$(NUM).http/ $@
$(call COMPARE_REFS, $(word 2,$^), $@)

hg.pure.git: hg.git
Expand All @@ -179,7 +179,7 @@ hg.http.hg.gitcredentials hg.http.hg.nobundle2.gitcredentials:

hg.http.hg hg.http.hg.nobundle2: %: %.gitcredentials hg.git
$(call HG_INIT, $@)
$(HG) -R $@ --config extensions.x=$(TOPDIR)/CI/hg-serve-exec.py --config web.port=80$(NUM) serve-and-exec -- $(GIT) -c credential.helper='store --file=$(CURDIR)/$@.gitcredentials' -c cinnabar.data=never -C $(word 2,$^) push hg://localhost:80$(NUM).http/ refs/remotes/origin/*:refs/heads/*
$(HG) -R $@ --config experimental.httppostargs=true --config extensions.x=$(TOPDIR)/CI/hg-serve-exec.py --config web.port=80$(NUM) serve-and-exec -- $(GIT) -c credential.helper='store --file=$(CURDIR)/$@.gitcredentials' -c cinnabar.data=never -C $(word 2,$^) push hg://localhost:80$(NUM).http/ refs/remotes/origin/*:refs/heads/*

hg.incr.base.git: hg.incr.hg
$(HG) clone -U $< $@.hg
Expand Down Expand Up @@ -213,7 +213,7 @@ hg.cinnabarclone-bundle.git hg.cinnabarclone-bundle-full.git hg.cinnabarclone-gr
hg.cinnabarclone.git hg.cinnabarclone-full.git hg.cinnabarclone-bundle.git hg.cinnabarclone-bundle-full.git hg.cinnabarclone-graft.git hg.cinnabarclone-graft-replace.git: hg.pure.hg
$(HG) clone -U $< $@.hg
echo http://localhost:88$(NUM)/$(word 2,$^) | tee $@.hg/.hg/cinnabar.manifest
$(HG) -R $@.hg --config web.port=80$(NUM) --config serve.other=$(OTHER_SERVER) --config serve.otherport=88$(NUM) --config extensions.x=$(TOPDIR)/CI/hg-serve-exec.py --config extensions.cinnabarclone=$(HG_CINNABARCLONE_EXT) serve-and-exec -- $(GIT) clone --progress hg://localhost:80$(NUM).http/ $@
$(HG) -R $@.hg --config web.port=80$(NUM) --config serve.other=$(OTHER_SERVER) --config serve.otherport=88$(NUM) --config experimental.httppostargs=true --config extensions.x=$(TOPDIR)/CI/hg-serve-exec.py --config extensions.cinnabarclone=$(HG_CINNABARCLONE_EXT) serve-and-exec -- $(GIT) clone --progress hg://localhost:80$(NUM).http/ $@
$(call COMPARE_REFS, $(or $(word 3,$^),$(word 2,$^)), $@)
$(GIT) -C $@ cinnabar fsck
$(GIT) -C $@ cinnabar fsck --full
Expand All @@ -224,7 +224,7 @@ hg.cinnabarclone-graft-bundle.git: hg.pure.hg
$(GIT) -C $@ cinnabar rollback 0000000000000000000000000000000000000000
$(GIT) -C $@ remote rename origin grafted
(echo http://localhost:88$(NUM)/$(word 2,$^); echo http://localhost:88$(NUM)/$(word 4,$^) graft=$$($(GIT) ls-remote $(CURDIR)/$(word 4,$^) refs/cinnabar/replace/* | awk -F/ '{print $$NF}')) | tee $@.hg/.hg/cinnabar.manifest
$(HG) -R $@.hg --config serve.other=http --config serve.otherport=88$(NUM) --config web.port=80$(NUM) --config extensions.x=$(TOPDIR)/CI/hg-serve-exec.py --config extensions.cinnabarclone=$(HG_CINNABARCLONE_EXT) serve-and-exec -- $(GIT) -c cinnabar.graft=true -C $@ fetch --progress hg://localhost:80$(NUM).http/ refs/heads/*:refs/remotes/origin/*
$(HG) -R $@.hg --config serve.other=http --config serve.otherport=88$(NUM) --config web.port=80$(NUM) --config experimental.httppostargs=true --config extensions.x=$(TOPDIR)/CI/hg-serve-exec.py --config extensions.cinnabarclone=$(HG_CINNABARCLONE_EXT) serve-and-exec -- $(GIT) -c cinnabar.graft=true -C $@ fetch --progress hg://localhost:80$(NUM).http/ refs/heads/*:refs/remotes/origin/*
$(call COMPARE_REFS, $(or $(word 3,$^),$(word 2,$^)), $@)
$(GIT) -C $@ cinnabar fsck
$(GIT) -C $@ cinnabar fsck --full
Expand Down Expand Up @@ -262,8 +262,9 @@ hg.graft.replace.git: hg.graft.base.git hg.upgraded.git
$(call COMPARE_COMMANDS,$(call GET_ROOTS,$(word 2,$^),--remotes),$(call GET_ROOTS,$@,--glob=refs/cinnabar/replace))
$(GIT) -C $@ cinnabar fsck --full

hg.graft.cinnabar.git: hg.upgraded.git
hg.graft.cinnabar.git: hg.upgraded.git hg.pure.hg
cp -r $< $@
$(GIT) -C $@ remote set-url origin hg::$(PATH_URL)/$(word 2,$^)
$(GIT) -C $@ -c cinnabar.graft=true cinnabar reclone
$(call COMPARE_REFS, $<, $@, XARGS_GIT2HG)
test $$($(GIT) -C $@ for-each-ref refs/cinnabar/replace | wc -l) -eq 0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -4,7 +4,7 @@

[package]
name = "git-cinnabar"
version = "0.6.2"
version = "0.6.3"
description = "git remote helper to interact with mercurial repositories"
authors = ["Mike Hommey <mh@glandium.org>"]
edition = "2021"
Expand Down
4 changes: 4 additions & 0 deletions download.py
Expand Up @@ -366,10 +366,14 @@ def main(args):
help='only print the download url')
pgroup = parser.add_mutually_exclusive_group()
pgroup.add_argument('--branch', metavar='BRANCH',
default=os.environ.get("GIT_CINNABAR_DOWNLOAD_BRANCH"),
help='download a build for the given branch')
pgroup.add_argument('--exact', metavar='EXACT',
default=os.environ.get("GIT_CINNABAR_DOWNLOAD_EXACT"),
help='download a build for the given commit')
parser.add_argument('--variant', metavar='VARIANT',
default=os.environ.get(
"GIT_CINNABAR_DOWNLOAD_VARIANT"),
help='download the given variant')
parser.add_argument('--system', default=platform.system(),
help=argparse.SUPPRESS)
Expand Down
2 changes: 1 addition & 1 deletion src/cinnabar-fast-import.c
Expand Up @@ -1014,7 +1014,7 @@ const struct object_id *ensure_empty_tree(void) {
if (!oe) {
struct object_id hash;
struct strbuf buf = STRBUF_INIT;
store_object(OBJ_BLOB, &buf, NULL, &hash, 0);
store_object(OBJ_TREE, &buf, NULL, &hash, 0);
assert(oidcmp(&hash, &empty_tree) == 0);
}
return &empty_tree;
Expand Down

0 comments on commit 830a1f2

Please sign in to comment.