diff mercurial/dispatch.py @ 35223:4edd2202f7d7

dispatch: alias --repo to --repository while parsing early options This prepares for replacing old _early*opt() functions. My initial attempt was to extend options table to support 'repository|repo' syntax. It worked, but seemed too invasive. So I decided to add an optional argument to fancyopts() instead. This also changes the nevernegate dict to be keyed by a canonical_name, not by an option-name for clarity.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 25 Nov 2017 17:03:52 +0900
parents aef2b98d9352
children 6e6d0a5b88e6
line wrap: on
line diff
--- a/mercurial/dispatch.py	Mon Dec 04 19:08:41 2017 +0800
+++ b/mercurial/dispatch.py	Sat Nov 25 17:03:52 2017 +0900
@@ -649,7 +649,8 @@
 def _earlyparseopts(args):
     options = {}
     fancyopts.fancyopts(args, commands.globalopts, options,
-                        gnu=False, early=True)
+                        gnu=False, early=True,
+                        optaliases={'repository': ['repo']})
     return options
 
 def _earlygetopt(aliases, args, strip=True):