# HG changeset patch # User Denis Laxalde # Date 1360361566 0 # Node ID f752089479ce4bf0882831e43dc38bb0139ef8db # Parent ebcfd72e7609232b78b3b79399f21ac38af0011d add a duplicate option in touch diff -r ebcfd72e7609 -r f752089479ce README --- a/README Fri Feb 08 22:09:42 2013 +0000 +++ b/README Fri Feb 08 22:12:46 2013 +0000 @@ -49,6 +49,7 @@ - prune: various minor improvements - amend: drop deprecated --change option for amend - alias: add a grab aliast to be used instead of graft -O +- touch: add a --duplicate option to *not* obsolete the old version 3.0.0 -- 2013-02-02 diff -r ebcfd72e7609 -r f752089479ce hgext/evolve.py --- a/hgext/evolve.py Fri Feb 08 22:09:42 2013 +0000 +++ b/hgext/evolve.py Fri Feb 08 22:12:46 2013 +0000 @@ -1568,7 +1568,9 @@ lock.release() @command('^touch', - [('r', 'rev', [], 'revision to update'),], + [('r', 'rev', [], 'revision to update'), + ('D', 'duplicate', False, + 'do not mark the new revision as successor of the old one')], # allow to choose the seed ? _('[-r] revs')) def touch(ui, repo, *revs, **opts): @@ -1576,6 +1578,7 @@ This is used to "resurrect" changesets """ + duplicate = opts['duplicate'] revs = list(revs) revs.extend(opts['rev']) if not revs: @@ -1584,7 +1587,7 @@ if not revs: ui.write_err('no revision to touch\n') return 1 - if repo.revs('public() and %ld', revs): + if not duplicate and repo.revs('public() and %ld', revs): raise util.Abort("can't touch public revision") wlock = lock = None try: @@ -1599,7 +1602,8 @@ new, _ = rewrite(repo, ctx, [], ctx, [ctx.p1().node(), ctx.p2().node()], commitopts={'extra': extra}) - createmarkers(repo, [(ctx, (repo[new],))]) + if not duplicate: + createmarkers(repo, [(ctx, (repo[new],))]) phases.retractboundary(repo, ctx.phase(), [new]) if ctx in repo[None].parents(): repo.dirstate.setparents(new, node.nullid) diff -r ebcfd72e7609 -r f752089479ce tests/test-touch.t --- a/tests/test-touch.t Fri Feb 08 22:09:42 2013 +0000 +++ b/tests/test-touch.t Fri Feb 08 22:12:46 2013 +0000 @@ -48,3 +48,12 @@ $ hg prune 3 1 changesets pruned + +Duplicate + + $ hg touch --duplicate . + $ hg log -G + @ 5:[0-9a-f]{12} a (re) + + o 4:[0-9a-f]{12} a (re) +