# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1510431853 -19800 # Node ID 175b524b9a2bbea58bc94279ea4953a0e3f8fd57 # Parent 9fe2b3fd7fc772d9138c25fbdda5d739f0590e07 touch: add support for storing a note in obsmarker diff -r 9fe2b3fd7fc7 -r 175b524b9a2b hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Sun Nov 12 01:35:51 2017 +0530 +++ b/hgext3rd/evolve/cmdrewrite.py Sun Nov 12 01:54:13 2017 +0530 @@ -1004,6 +1004,7 @@ @eh.command( '^touch', [('r', 'rev', [], 'revision to update'), + ('n', 'note', '', _('store a note on touch')), ('D', 'duplicate', False, 'do not mark the new revision as successor of the old one'), ('A', 'allowdivergence', False, @@ -1017,6 +1018,7 @@ This is used to "resurrect" changesets """ + _checknotesize(opts) duplicate = opts['duplicate'] allowdivergence = opts['allowdivergence'] revs = list(revs) @@ -1080,7 +1082,11 @@ newmapping[ctx.node()] = new if not duplicate: - obsolete.createmarkers(repo, [(ctx, (repo[new],))]) + metadata = {} + if opts.get('note'): + metadata['note'] = opts['note'] + obsolete.createmarkers(repo, [(ctx, (repo[new],))], + metadata=metadata) phases.retractboundary(repo, tr, ctx.phase(), [new]) if ctx in repo[None].parents(): with repo.dirstate.parentchange(): diff -r 9fe2b3fd7fc7 -r 175b524b9a2b tests/test-touch.t --- a/tests/test-touch.t Sun Nov 12 01:35:51 2017 +0530 +++ b/tests/test-touch.t Sun Nov 12 01:54:13 2017 +0530 @@ -151,5 +151,11 @@ $ hg prune 13 1 changesets pruned - $ hg touch 13 --hidden + $ hg touch 13 --hidden --note "testing with no successor" 1 new orphan changesets + $ hg obslog -r 13 --hidden + x [0-9a-f]{12} (.*) move (re) + pruned by test (Thu Jan 01 00:00:00 1970 +0000) + rewritten(.*) as [0-9a-f]{12} by test (.*) (re) + note: 'testing with no successor' +