# HG changeset patch # User Pierre-Yves David # Date 1602783998 -7200 # Node ID d77d61c9e5e94ccc8851c2e06541a385d549c0cf # Parent ba8bc1b0acd2c85cff7d75f021d95c701621d2f9# Parent d1f6cf85bfec8da28bc5af7269958101072ff274 branching: merge with stable diff -r ba8bc1b0acd2 -r d77d61c9e5e9 CHANGELOG --- a/CHANGELOG Sun Oct 11 20:50:02 2020 +0800 +++ b/CHANGELOG Thu Oct 15 19:46:38 2020 +0200 @@ -21,6 +21,7 @@ -------------------- * evolve: specific the source of config override for `server.bundle1=no` + * metaedit: update bookmark location when applicable 10.0.2 -- 2020-09-08 -------------------- diff -r ba8bc1b0acd2 -r d77d61c9e5e9 README.rst --- a/README.rst Sun Oct 11 20:50:02 2020 +0800 +++ b/README.rst Thu Oct 15 19:46:38 2020 +0200 @@ -180,8 +180,8 @@ Format-source config ==================== -Format source helps smooth out the pain of merging after auto-formatting. -Follow the instructions for install here: +Format-source helps smooth out the pain of merging after auto-formatting. +Follow the installation instructions at the `format-source`_ repo. .. _`format-source`: https://foss.heptapod.net/mercurial/format-source diff -r ba8bc1b0acd2 -r d77d61c9e5e9 hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Sun Oct 11 20:50:02 2020 +0800 +++ b/hgext3rd/evolve/cmdrewrite.py Thu Oct 15 19:46:38 2020 +0200 @@ -169,9 +169,9 @@ metadata = {} if opts.get('note'): metadata[b'note'] = opts['note'] - replacements = {old.node(): [newnode]} - scmutil.cleanupnodes(repo, replacements, operation=b'amend', - metadata=metadata) + replacements = {(old.node(),): [newnode]} + compat.cleanupnodes(repo, replacements, operation=b'amend', + metadata=metadata) phases.retractboundary(repo, tr, old.phase(), [newnode]) compat.clean_update(repo[newnode]) @@ -508,9 +508,9 @@ if opts.get('note'): metadata[b'note'] = opts['note'] - replacements = {old.node(): [newid]} - scmutil.cleanupnodes(repo, replacements, operation=b"uncommit", - metadata=metadata) + replacements = {(old.node(),): [newid]} + compat.cleanupnodes(repo, replacements, operation=b"uncommit", + metadata=metadata) phases.retractboundary(repo, tr, oldphase, [newid]) if opts.get('revert'): compat.clean_update(repo[newid]) @@ -745,17 +745,9 @@ p2.node()], commitopts=commitopts) phases.retractboundary(repo, tr, targetphase, [newid]) - # Use this condition as a proxy since the commit we care about - # (b99903534e06) didn't change any signatures. - if util.safehasattr(scmutil, 'nullrev'): - replacements = {tuple(ctx.node() for ctx in allctx): [newid]} - scmutil.cleanupnodes(repo, replacements, operation=b"fold", - metadata=metadata) - else: - # hg <= 4.7 (b99903534e06) - replacements = {ctx.node(): [newid] for ctx in allctx} - scmutil.cleanupnodes(repo, replacements, operation=b"fold", - metadata=metadata) + replacements = {tuple(ctx.node() for ctx in allctx): [newid]} + compat.cleanupnodes(repo, replacements, operation=b"fold", + metadata=metadata) tr.close() finally: tr.release() @@ -1031,9 +1023,9 @@ msg = b"please add --fold if you want to do a fold" raise error.Abort(msg) elif biject: - replacements = {p.node(): [s.node()] for p, s in zip(precs, sucs)} + replacements = {(p.node(),): [s.node()] for p, s in zip(precs, sucs)} else: - replacements = {p.node(): [s.node() for s in sucs] for p in precs} + replacements = {(p.node(),): [s.node() for s in sucs] for p in precs} wdp = repo[b'.'] @@ -1113,16 +1105,13 @@ # but then revset took a lazy arrow in the knee and became much # slower. The new forms makes as much sense and a much faster. for dest in ctx.ancestors(): - if not dest.obsolete() and dest.node() not in replacements: + if not dest.obsolete() and (dest.node(),) not in replacements: moves[ctx.node()] = dest.node() break if len(sucs) == 1 and len(precs) > 1 and fold: - # hg <= 4.7 (b99903534e06) - # Using a proxy condition to let people wrap cleanupnodes() - if util.safehasattr(scmutil, 'nullrev'): - replacements = {tuple(p.node() for p in precs): [s.node() for s in sucs]} - scmutil.cleanupnodes(repo, replacements, operation=b"prune", moves=moves, - metadata=metadata) + replacements = {tuple(p.node() for p in precs): [s.node() for s in sucs]} + compat.cleanupnodes(repo, replacements, operation=b"prune", moves=moves, + metadata=metadata) # informs that changeset have been pruned ui.status(_(b'%i changesets pruned\n') % len(precs)) @@ -1476,11 +1465,11 @@ if pickstate: pickstate.delete() if newnode is None: - replacements = {origctx.node(): []} + replacements = {(origctx.node(),): []} else: newctx = repo[newnode] - replacements = {origctx.node(): [newctx.node()]} - scmutil.cleanupnodes(repo, replacements, operation=b"pick") + replacements = {(origctx.node(),): [newctx.node()]} + compat.cleanupnodes(repo, replacements, operation=b"pick") if newnode is None: ui.warn(_(b"note: picking %d:%s created no changes to commit\n") % diff -r ba8bc1b0acd2 -r d77d61c9e5e9 hgext3rd/evolve/compat.py --- a/hgext3rd/evolve/compat.py Sun Oct 11 20:50:02 2020 +0800 +++ b/hgext3rd/evolve/compat.py Thu Oct 15 19:46:38 2020 +0200 @@ -411,3 +411,18 @@ def clean_update(ctx): hg.updaterepo(ctx.repo(), ctx.node(), overwrite=True) + +def cleanupnodes(repo, replacements, operation, moves=None, metadata=None): + # Use this condition as a proxy since the commit we care about + # (b99903534e06) didn't change any signatures. + if util.safehasattr(scmutil, 'nullrev'): + fixedreplacements = replacements + else: + # hg <= 4.7 (b99903534e06) + fixedreplacements = {} + for oldnodes, newnodes in replacements.items(): + for oldnode in oldnodes: + fixedreplacements[oldnode] = newnodes + + scmutil.cleanupnodes(repo, replacements=fixedreplacements, operation=operation, + moves=moves, metadata=metadata) diff -r ba8bc1b0acd2 -r d77d61c9e5e9 tests/test-evolve-progress.t --- a/tests/test-evolve-progress.t Sun Oct 11 20:50:02 2020 +0800 +++ b/tests/test-evolve-progress.t Thu Oct 15 19:46:38 2020 +0200 @@ -123,6 +123,7 @@ branchmerge: True, force: True, partial: False ancestor: 152c368c622b, local: f8d7d38c0a88+, remote: df5d742141b0 preserving a for resolve of a + starting 4 threads for background file closing (?) a: versions differ -> m (premerge) updating: a 1/1 files (100.00%) picked tool ':merge' for a (binary False symlink False changedelete False)