head 1.2; access; symbols pkgsrc-2020Q2:1.1.0.2 pkgsrc-2020Q2-base:1.1; locks; strict; comment @# @; 1.2 date 2020.08.03.21.34.20; author joerg; state dead; branches; next 1.1; commitid sxu8bfQvMlnKeFiC; 1.1 date 2020.05.24.01.16.26; author joerg; state Exp; branches; next ; commitid eP9odNz0Z2qLMq9C; desc @@ 1.2 log @Update Mercurial to 5.5: == New Features == * clonebundles can be annotated with the expected memory requirements using the `REQUIREDRAM` option. This allows clients to skip bundles created with large zstd windows and fallback to larger, but less demanding bundles. * The `phabricator` extension now provides more functionality of the arcanist CLI like changing the status of a differential. * Phases processing is much faster, especially for repositories with old non-public changesets. == New Experimental Features == * The core of some hg operations have been (and are being) implemented in rust, for speed. `hg status` on a repository with 300k tracked files goes from 1.8s to 0.6s for instance. This has currently been tested only on linux, and does not build on windows. See rust/README.rst in the mercurial repository for instructions to opt into this. * An experimental config `rewrite.empty-successor` was introduced to control what happens when rewrite operations result in empty changesets. == Bug Fixes == * For the case when connected to a TTY, stdout was fixed to be line-buffered on Python 3 (where it was block-buffered before, causing the process to seem hanging) and Windows on Python 2 (where it was unbuffered before). * Subversion sources of the convert extension were fixed to work on Python 3. * Subversion sources of the convert extension now interpret the encoding of URLs like Subversion. Previously, there were situations where the convert extension recognized a repository as present but Subversion did not, and vice versa. * The empty changeset check of in-memory rebases was fixed to match that of normal rebases (and that of the commit command). * The push command now checks the correct set of outgoing changesets for obsolete and unstable changesets. Previously, it could happen that the check prevented pushing changesets which were already on the server. == Backwards Compatibility Changes == * Mercurial now requires at least Python 2.7.9 or a Python version that backported modern SSL/TLS features (as defined in PEP 466), and that Python was compiled against a OpenSSL version supporting TLS 1.1 or TLS 1.2 (likely this requires the OpenSSL version to be at least 1.0.1). * The `hg perfwrite` command from contrib/perf.py was made more flexible and changed its default behavior. To get the previous behavior, run `hg perfwrite --nlines=100000 --nitems=1 --item='Testing write performance' --batch-line`. * The absorb extension now preserves changesets with no file changes that can be created by the commit command (those which change the branch name compared to the parent and those closing a branch head). @ text @$NetBSD: patch-D8575,v 1.1 2020/05/24 01:16:26 joerg Exp $ # HG changeset patch # User Joerg Sonnenberger # Date 1590077930 -7200 # Thu May 21 18:18:50 2020 +0200 # Branch stable # Node ID c6bc304695881f82d7f0803d136678d7d29b193b # Parent 423cb450e7220473e144dc6fb089bec01c8d9d44 hooklib: fix detection of successors for changeset_obsoleted Provide a hook for obsutil.getobsolete to be used with either a transaction or the changes item of the transaction, since hooks only have access to the latter. Use that to find the correct list of revisions with obsmarkers, even new ones, and then filter out revisions with known successors. Move the processing from pretxnclose to txnclose as the transaction access itself is no longer necessary. This is more in line with notify and ensures that sanity checks can abort the transaction first. Differential Revision: https://phab.mercurial-scm.org/D8575 diff -r 423cb450e722 -r c6bc30469588 hgext/hooklib/changeset_obsoleted.py --- hgext/hooklib/changeset_obsoleted.py Tue May 19 01:57:12 2020 +0200 +++ hgext/hooklib/changeset_obsoleted.py Thu May 21 18:18:50 2020 +0200 @@@@ -122,10 +122,18 @@@@ ) +def has_successor(repo, rev): + return any( + r for r in obsutil.allsuccessors(repo.obsstore, [rev]) if r != rev + ) + + def hook(ui, repo, hooktype, node=None, **kwargs): - if hooktype != b"pretxnclose": + if hooktype != b"txnclose": raise error.Abort( _(b'Unsupported hook type %r') % pycompat.bytestr(hooktype) ) - for rev in obsutil.getobsoleted(repo, repo.currenttransaction()): - _report_commit(ui, repo, repo.unfiltered()[rev]) + for rev in obsutil.getobsoleted(repo, changes=kwargs['changes']): + ctx = repo.unfiltered()[rev] + if not has_successor(repo, ctx.node()): + _report_commit(ui, repo, ctx) diff -r 423cb450e722 -r c6bc30469588 mercurial/obsutil.py --- mercurial/obsutil.py Tue May 19 01:57:12 2020 +0200 +++ mercurial/obsutil.py Thu May 21 18:18:50 2020 +0200 @@@@ -481,14 +481,21 @@@@ return effects -def getobsoleted(repo, tr): - """return the set of pre-existing revisions obsoleted by a transaction""" +def getobsoleted(repo, tr=None, changes=None): + """return the set of pre-existing revisions obsoleted by a transaction + + Either the transaction or changes item of the transaction (for hooks) + must be provided, but not both. + """ + assert (tr is None) != (changes is None) torev = repo.unfiltered().changelog.index.get_rev phase = repo._phasecache.phase succsmarkers = repo.obsstore.successors.get public = phases.public - addedmarkers = tr.changes[b'obsmarkers'] - origrepolen = tr.changes[b'origrepolen'] + if changes is None: + changes = tr.changes + addedmarkers = changes[b'obsmarkers'] + origrepolen = changes[b'origrepolen'] seenrevs = set() obsoleted = set() for mark in addedmarkers: diff -r 423cb450e722 -r c6bc30469588 tests/test-hooklib-changeset_obsoleted.t --- tests/test-hooklib-changeset_obsoleted.t Tue May 19 01:57:12 2020 +0200 +++ tests/test-hooklib-changeset_obsoleted.t Thu May 21 18:18:50 2020 +0200 @@@@ -24,7 +24,7 @@@@ $ cat <> b/.hg/hgrc > [hooks] > incoming.notify = python:hgext.notify.hook - > pretxnclose.changeset_obsoleted = python:hgext.hooklib.changeset_obsoleted.hook + > txnclose.changeset_obsoleted = python:hgext.hooklib.changeset_obsoleted.hook > EOF $ hg --cwd b pull ../a | "$PYTHON" $TESTDIR/unwrap-message-id.py pulling from ../a @@@@ -72,6 +72,8 @@@@ pushing to ../b searching for changes no changes found + 1 new obsolescence markers + obsoleted 1 changesets Subject: changeset abandoned In-reply-to: Message-Id: @@@@ -80,5 +82,33 @@@@ To: baz@@example.com This changeset has been abandoned. + +Check that known changesets with known successors do not result in a mail. + + $ hg init c + $ hg init d + $ cat <> d/.hg/hgrc + > [hooks] + > incoming.notify = python:hgext.notify.hook + > txnclose.changeset_obsoleted = python:hgext.hooklib.changeset_obsoleted.hook + > EOF + $ hg --cwd c debugbuilddag '.:parent.*parent' + $ hg --cwd c push ../d -r 1 + pushing to ../d + searching for changes + adding changesets + adding manifests + adding file changes + added 2 changesets with 0 changes to 0 files + $ hg --cwd c debugobsolete $(hg --cwd c log -T '{node}' -r 1) $(hg --cwd c log -T '{node}' -r 2) 1 new obsolescence markers obsoleted 1 changesets + $ hg --cwd c push ../d | "$PYTHON" $TESTDIR/unwrap-message-id.py + pushing to ../d + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 0 changes to 0 files (+1 heads) + 1 new obsolescence markers + obsoleted 1 changesets @ 1.1 log @Merge a number of patches already committed or under review for issues found in the NetBSD deployment. Bump revision. @ text @d1 1 a1 1 $NetBSD$ @