Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Jul 30, 2022
2 parents f15f941 + ccb46cf commit 2e0f919
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: taskcluster extra workers
on: [push]
jobs:
osx:
runs-on: macos-10.15
runs-on: macos-11
env:
secret: ${{ secrets.SECRET }}
TC_WORKER_TYPE: osx
Expand Down
14 changes: 8 additions & 6 deletions CI/osx.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ def prepare_params(self, params):
command.extend(params['command'])
params['command'] = bash_command(*command)
env = params.setdefault('env', {})
dev = env.setdefault('DEVELOPER_DIR',
'/Applications/Xcode_11.7.app/Contents/Developer')
dev = env.setdefault(
'DEVELOPER_DIR',
'/Applications/Xcode_13.2.1.app/Contents/Developer')
env.setdefault(
'SDKROOT',
'{}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk'
'{}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk'
.format(dev))
return params

Expand All @@ -50,10 +51,11 @@ class OsxArm64(OsxCommon, metaclass=TaskEnvironment):

def prepare_params(self, params):
env = params.setdefault('env', {})
dev = env.setdefault('DEVELOPER_DIR',
'/Applications/Xcode_12.2.app/Contents/Developer')
dev = env.setdefault(
'DEVELOPER_DIR',
'/Applications/Xcode_13.2.1.app/Contents/Developer')
env.setdefault(
'SDKROOT',
'{}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk'
'{}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk'
.format(dev))
return super(OsxArm64, self).prepare_params(params)
20 changes: 10 additions & 10 deletions CI/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ hg.pure.hg:
$(HG) clone -U $(REPO) $@

hg.old.git:
$(GIT) -c fetch.prune=true clone -n hg::$(REPO) $@
$(GIT) -c fetch.prune=true clone --progress -n hg::$(REPO) $@

ifdef UPGRADE_FROM
check: check-upgrade-error
Expand Down Expand Up @@ -102,7 +102,7 @@ hg.empty.hg:
$(call HG_INIT, $@)

hg.empty.git: hg.empty.hg
$(GIT) -c fetch.prune=true clone -n hg::$(PATH_URL)/$< $@
$(GIT) -c fetch.prune=true clone --progress -n hg::$(PATH_URL)/$< $@

hg.empty.push.hg: hg.empty.git
$(call HG_INIT, $@)
Expand All @@ -114,7 +114,7 @@ hg.bundle: hg.git
hg.git hg.git.nobundle2: hg.git%: hg.hg% hg.upgraded.git
hg.unbundle.git: hg.bundle hg.git
hg.unbundle.git hg.git hg.git.nobundle2:
$(GIT) -c fetch.prune=true clone -n hg::$(CURDIR)/$< $@
$(GIT) -c fetch.prune=true clone --progress -n hg::$(CURDIR)/$< $@
$(call COMPARE_REFS, $(word 2,$^), $@)
$(GIT) -C $@ cinnabar fsck
$(GIT) -C $@ cinnabar fsck --full
Expand All @@ -126,7 +126,7 @@ hg.incr.hg hg.incr.hg.nobundle2: hg.incr.hg%: hg.hg%

hg.incr.git hg.incr.git.nobundle2: hg.incr.git%: hg.incr.hg% hg.hg% hg.git%
$(HG) clone -U $< $@.hg
$(GIT) -c fetch.prune=true clone -n hg::$(PATH_URL)/$@.hg $@
$(GIT) -c fetch.prune=true clone --progress -n hg::$(PATH_URL)/$@.hg $@
$(HG) -R $@.hg pull $(CURDIR)/$(word 2,$^)
$(GIT) -C $@ remote update
$(call COMPARE_REFS, $(word 3,$^), $@)
Expand Down Expand Up @@ -167,13 +167,13 @@ 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 -n hg://localhost:80$(NUM).http/ $@
$(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/ $@
$(call COMPARE_REFS, $(word 2,$^), $@)

hg.pure.git: hg.git
# || exit 1 forces mingw32-make to wrap the command through a shell, which works
# around https://github.com/Alexpux/MSYS2-packages/issues/829.
$(GIT) clone -n $< $@ || exit 1
$(GIT) clone --progress -n $< $@ || exit 1

hg.push.hg hg.push.hg.nobundle2: GIT_CINNABAR_EXPERIMENTS:=$(GIT_CINNABAR_EXPERIMENTS:%=%,)merge
hg.push.hg hg.push.hg.nobundle2: hg.pure.git
Expand All @@ -193,7 +193,7 @@ hg.http.hg hg.http.hg.nobundle2: %: %.gitcredentials hg.git

hg.incr.base.git: hg.incr.hg
$(HG) clone -U $< $@.hg
$(GIT) -c fetch.prune=true clone -n hg::$(PATH_URL)/$@.hg $@
$(GIT) -c fetch.prune=true clone --progress -n hg::$(PATH_URL)/$@.hg $@

hg.incr.bundle.git: hg.incr.base.git
hg.bundle.git: hg.git
Expand Down Expand Up @@ -223,7 +223,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
($(if $(GIT_CINNABAR_OLD),,echo http://localhost:8888/$(word 2,$^) foo=1 ; )echo http://localhost:88$(NUM)/$(word 2,$^)) | tee $@.hg/.hg/cinnabar.manifest
$(if $(GIT_CINNABAR_OLD),env GIT_CINNABAR_EXPERIMENTS=$(GIT_CINNABAR_EXPERIMENTS:%=%,)git-clone) $(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 hg://localhost:80$(NUM).http/ $@
$(if $(GIT_CINNABAR_OLD),env GIT_CINNABAR_EXPERIMENTS=$(GIT_CINNABAR_EXPERIMENTS:%=%,)git-clone) $(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/ $@
$(call COMPARE_REFS, $(or $(word 3,$^),$(word 2,$^)), $@)
$(GIT) -C $@ cinnabar fsck
$(GIT) -C $@ cinnabar fsck --full
Expand All @@ -234,7 +234,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,$^)$(if $(GIT_CINNABAR_OLD),,; 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
$(if $(GIT_CINNABAR_OLD),env GIT_CINNABAR_EXPERIMENTS=$(GIT_CINNABAR_EXPERIMENTS:%=%,)git-clone) $(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 hg://localhost:80$(NUM).http/ refs/heads/*:refs/remotes/origin/*
$(if $(GIT_CINNABAR_OLD),env GIT_CINNABAR_EXPERIMENTS=$(GIT_CINNABAR_EXPERIMENTS:%=%,)git-clone) $(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/*
$(call COMPARE_REFS, $(or $(word 3,$^),$(word 2,$^)), $@)
$(GIT) -C $@ cinnabar fsck
$(GIT) -C $@ cinnabar fsck --full
Expand Down Expand Up @@ -290,5 +290,5 @@ hg.graft.new.bundle: hg.graft2.git
$(GIT) -C $@.git checkout refs/remotes/new/HEAD
GIT_AUTHOR_DATE="1970-01-01T00:00:00 +0000" GIT_COMMITTER_DATE="1970-01-01T00:00:00 +0000" $(GIT) -C $@.git -c user.email=git@cinnabar -c user.name=cinnabar commit --allow-empty -m 'New commit'
$(GIT) -C $@.git -c cinnabar.graft=true cinnabar bundle $(CURDIR)/$@ HEAD^!
$(GIT) -C $@.git -c cinnabar.graft=true fetch hg::$(PATH_URL)/$@
$(GIT) -C $@.git -c cinnabar.graft=true fetch --progress hg::$(PATH_URL)/$@
test "$$($(GIT) -C $@.git cinnabar data -c $$($(GIT) -C $@.git cinnabar git2hg FETCH_HEAD) | tail -c 1)" = t
2 changes: 1 addition & 1 deletion cinnabar/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '0.5.9'
VERSION = '0.5.10'
3 changes: 3 additions & 0 deletions cinnabar/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,13 @@ def config(self, name, remote=None, values={}, multiple=False):
else:
self._config[k] = v
if self._config.pop(b'cinnabar.fsck', None):
# Git.run('config') will reset self._config ; avoid that.
config = self._config
# We used to set cinnabar.fsck globally, then locally.
# Remove both.
Git.run('config', '--global', '--unset', 'cinnabar.fsck')
Git.run('config', '--local', '--unset', 'cinnabar.fsck')
self._config = config

var = name.encode('ascii')
value = None
Expand Down
2 changes: 1 addition & 1 deletion cinnabar/hg/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def prepare_chunk(store, chunk, previous, chunk_type):
key=len)
if len(deltas):
return deltas[0]
return chunk.to_chunk(chunk_type)
return chunk.to_chunk(chunk_type, previous)
else:
assert False

Expand Down
8 changes: 4 additions & 4 deletions cinnabar/remote_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,13 @@ def push(self, *refspecs):
if self._store._broken or not self._repo.capable(b'unbundle'):
for source, dest, force in pushes:
if self._store._broken:
self._helper.write(
b'error %s Remote does not support the "unbundle" '
b'capability\n' % dest)
else:
self._helper.write(
b'error %s Cannot push with broken metadata. '
b'Please fix your clone first.\n' % dest)
else:
self._helper.write(
b'error %s Remote does not support the "unbundle" '
b'capability\n' % dest)
self._helper.write(b'\n')
self._helper.flush()
else:
Expand Down
12 changes: 7 additions & 5 deletions cinnabar/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,16 +932,18 @@ class VersionCheck(Thread):
def __init__(self):
super(VersionCheck, self).__init__()
self.message = None
self.parent_dir = os.path.dirname(os.path.dirname(__file__))
self.skip_check = (
not os.path.exists(os.path.join(self.parent_dir, '.git')) or
check_enabled('no-version-check') or
not interval_expired('version-check', 86400, globl=True))
self.start()

def run(self):
from cinnabar import VERSION
from cinnabar.git import Git, GitProcess
from distutils.version import StrictVersion
parent_dir = os.path.dirname(os.path.dirname(__file__))
if not os.path.exists(os.path.join(parent_dir, '.git')) or \
check_enabled('no-version-check') or \
not interval_expired('version-check', 86400, globl=True):
if self.skip_check:
return
REPO = 'https://github.com/glandium/git-cinnabar'
devnull = open(os.devnull, 'wb')
Expand All @@ -953,7 +955,7 @@ def run(self):
if fsdecode(head) != ref:
continue
proc = GitProcess(
'-C', parent_dir, 'merge-base', '--is-ancestor', sha1,
'-C', self.parent_dir, 'merge-base', '--is-ancestor', sha1,
'HEAD', stdout=devnull, stderr=devnull)
if proc.wait() != 0:
self.message = (
Expand Down
14 changes: 12 additions & 2 deletions helper/cinnabar-fast-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,18 @@ static void old_store_manifest(struct rev_chunk *chunk)
if (!last_manifest) {
last_manifest = new_branch("refs/cinnabar/manifests");
}
if (!is_null_hg_oid(chunk->delta_node) &&
!hg_oideq(chunk->delta_node, &last_manifest_oid)) {
if (is_null_hg_oid(chunk->delta_node)) {
if (last_manifest->branch_tree.tree) {
release_tree_content_recursive(
last_manifest->branch_tree.tree);
last_manifest->branch_tree.tree = NULL;
}
oidclr(&last_manifest->branch_tree.versions[0].oid);
oidclr(&last_manifest->branch_tree.versions[1].oid);
hg_oidclr(&last_manifest_oid);
oidclr(&last_manifest->oid);
strbuf_reset(&last_manifest_content);
} else if (!hg_oideq(chunk->delta_node, &last_manifest_oid)) {
const struct object_id *note;
ensure_notes(&hg2git);
note = get_note_hg(&hg2git, chunk->delta_node);
Expand Down

0 comments on commit 2e0f919

Please sign in to comment.