touch: use precheck to validate revision
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 23 Jul 2017 21:21:16 +0200
changeset 2790 1b7b9acda2a9
parent 2789 06ee4ec88190
child 2791 cf09d608ff0c
touch: use precheck to validate revision This gives us standard check and standard error message.
hgext3rd/evolve/cmdrewrite.py
--- a/hgext3rd/evolve/cmdrewrite.py	Sun Jul 23 21:21:11 2017 +0200
+++ b/hgext3rd/evolve/cmdrewrite.py	Sun Jul 23 21:21:16 2017 +0200
@@ -856,8 +856,8 @@
     if not revs:
         ui.write_err('no revision to touch\n')
         return 1
-    if not duplicate and repo.revs('public() and %ld', revs):
-        raise error.Abort("can't touch public revision")
+    if not duplicate:
+        rewriteutil.precheck(repo, revs, touch)
     tmpl = utility.shorttemplate
     displayer = cmdutil.show_changeset(ui, repo, {'template': tmpl})
     wlock = lock = tr = None