# HG changeset patch # User Matt Harbison # Date 1694533549 14400 # Node ID 50f55918b417f25088a535cc057f78c2d9e430b6 # Parent 81e89d943a4ef991b46a8d5098959b4eaabd08d1 pick: update commit message hashes like other rewrite commands Maybe it would be better to use `evolvecmd._relocate()`, which does this already, but I don't know what subtle behavior changes that would trigger. Also, there are other commands (like `metaedit`) that use `rewriteutil.rewrite` instead, and so don't refresh their hashes either. We probably need a better way to track all of this, but I'm not sure how. diff -r 81e89d943a4e -r 50f55918b417 hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Tue Jun 20 12:30:24 2023 -0300 +++ b/hgext3rd/evolve/cmdrewrite.py Tue Sep 12 11:45:49 2023 -0400 @@ -1417,9 +1417,10 @@ def _dopick(ui, repo, pickstate, origctx): """shared logic for performing or continuing a pick""" overrides = {(b'phases', b'new-commit'): origctx.phase()} + new_desc = evolvecmd._rewrite_commit_message_hashes(repo, + origctx.description()) with repo.ui.configoverride(overrides, b'pick'): - newnode = repo.commit(text=origctx.description(), - user=origctx.user(), + newnode = repo.commit(text=new_desc, user=origctx.user(), date=origctx.date(), extra=origctx.extra()) compat.setbranch(repo, origctx.branch()) diff -r 81e89d943a4e -r 50f55918b417 tests/test-pick.t --- a/tests/test-pick.t Tue Jun 20 12:30:24 2023 -0300 +++ b/tests/test-pick.t Tue Sep 12 11:45:49 2023 -0400 @@ -380,6 +380,41 @@ $ hg phase -r . 13: secret + +Pick rewrites node hashes in commit description + + $ echo 'hg pick rewrites hashes 1' > l + $ hg ci -m '1705aa17bfed is my parent' + $ echo 'hg pick rewrites hashes 2' > l + $ hg ci -m 'f9ed1703aa00 is my parent' + + $ hg glog -r .^^:: + @ 15:e3cb66090723 f9ed1703aa00 is my parent + | + o 14:f9ed1703aa00 1705aa17bfed is my parent + | + o 13:1705aa17bfed added l + | + ~ + + $ hg up -q c437988de89f + $ hg pick 13 + picking 13:1705aa17bfed "added l" + 2 new orphan changesets + $ hg pick 14 + picking 14:f9ed1703aa00 "1705aa17bfed is my parent" + $ hg pick 15 + picking 15:e3cb66090723 "f9ed1703aa00 is my parent" + + $ hg glog -r .^^:: + @ 18:5825531d1322 7a6997f82fbe is my parent + | + o 17:7a6997f82fbe fb6281ea03e8 is my parent + | + o 16:fb6281ea03e8 added l + | + ~ + $ cd .. Check pick behavior regarding working copy branch (issue6089)