Patchwork [1,of,2] debugdata: disallow trailing option with -c/-m

login
register
mail settings
Submitter via Mercurial-devel
Date June 24, 2016, 6:28 p.m.
Message ID <ae3d1555d324cbc4f778.1466792904@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/15604/
State Accepted
Headers show

Comments

via Mercurial-devel - June 24, 2016, 6:28 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1466792755 25200
#      Fri Jun 24 11:25:55 2016 -0700
# Node ID ae3d1555d324cbc4f77818ca3c5fca9864619ec8
# Parent  9349b4073c11ca198685bf0978904d644c8b8d29
debugdata: disallow trailing option with -c/-m

Before this change, "hg debugdata -c 0 foo" was allowed.

Patch

diff -r 9349b4073c11 -r ae3d1555d324 mercurial/commands.py
--- a/mercurial/commands.py	Wed Jun 22 22:02:25 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'))