mercurial/commands.py
changeset 517 9b884be92af2
parent 516 873228c2f6cf
child 518 b0187336843c
equal deleted inserted replaced
516:873228c2f6cf 517:9b884be92af2
   812     options = {}
   812     options = {}
   813     opts = [('v', 'verbose', None, 'verbose'),
   813     opts = [('v', 'verbose', None, 'verbose'),
   814             ('d', 'debug', None, 'debug'),
   814             ('d', 'debug', None, 'debug'),
   815             ('q', 'quiet', None, 'quiet'),
   815             ('q', 'quiet', None, 'quiet'),
   816             ('p', 'profile', None, 'profile'),
   816             ('p', 'profile', None, 'profile'),
       
   817             ('R', 'repository', "", 'repository root directory'),
   817             ('y', 'noninteractive', None, 'run non-interactively'),
   818             ('y', 'noninteractive', None, 'run non-interactively'),
   818             ('', 'version', None, 'output version information and exit'),
   819             ('', 'version', None, 'output version information and exit'),
   819             ]
   820             ]
   820 
   821 
   821     args = fancyopts.fancyopts(args, opts, options,
   822     args = fancyopts.fancyopts(args, opts, options,
   850         help(u, cmd)
   851         help(u, cmd)
   851         sys.exit(-1)
   852         sys.exit(-1)
   852 
   853 
   853     try:
   854     try:
   854         if cmd not in norepo.split():
   855         if cmd not in norepo.split():
   855             repo = hg.repository(ui = u)
   856             path = options["repository"] or ""
       
   857             repo = hg.repository(ui=u, path=path)
   856             d = lambda: i[0](u, repo, *args, **cmdoptions)
   858             d = lambda: i[0](u, repo, *args, **cmdoptions)
   857         else:
   859         else:
   858             d = lambda: i[0](u, *args, **cmdoptions)
   860             d = lambda: i[0](u, *args, **cmdoptions)
   859 
   861 
   860         if options['profile']:
   862         if options['profile']: