debugdata: disallow trailing option with -c/-m
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 24 Jun 2016 11:25:55 -0700
changeset 29426 26ac04a39e11
parent 29425 4f5531f8ac38
child 29427 33a6b750b5b9
debugdata: disallow trailing option with -c/-m Before this change, "hg debugdata -c 0 foo" was allowed.
mercurial/commands.py
--- a/mercurial/commands.py	Sun Jun 26 17:16:57 2016 +0900
+++ b/mercurial/commands.py	Fri Jun 24 11:25:55 2016 -0700
@@ -2300,6 +2300,8 @@
 def debugdata(ui, repo, file_, rev=None, **opts):
     """dump the contents of a data file revision"""
     if opts.get('changelog') or opts.get('manifest'):
+        if rev is not None:
+            raise error.CommandError('debugdata', _('invalid arguments'))
         file_, rev = None, file_
     elif rev is None:
         raise error.CommandError('debugdata', _('invalid arguments'))