hgkw/keyword.py
changeset 221 2990d6aa10ff
parent 217 e55e3f6c6608
child 222 f956a8301c25
equal deleted inserted replaced
220:943e1e1ea042 221:2990d6aa10ff
   329     fn = 'demo.txt'
   329     fn = 'demo.txt'
   330     branchname = 'demobranch'
   330     branchname = 'demobranch'
   331     tmpdir = tempfile.mkdtemp('', 'kwdemo.')
   331     tmpdir = tempfile.mkdtemp('', 'kwdemo.')
   332     ui.note(_('creating temporary repo at %s\n') % tmpdir)
   332     ui.note(_('creating temporary repo at %s\n') % tmpdir)
   333     repo = localrepo.localrepository(ui, path=tmpdir, create=True)
   333     repo = localrepo.localrepository(ui, path=tmpdir, create=True)
   334     repo.ui = ui # backwards compatibility
       
   335     ui.setconfig('keyword', fn, '')
   334     ui.setconfig('keyword', fn, '')
   336     if args or opts['rcfile']:
   335     if args or opts['rcfile']:
   337         kwstatus = 'custom'
   336         kwstatus = 'custom'
   338     if opts['rcfile']:
   337     if opts['rcfile']:
   339         ui.readconfig(opts['rcfile'])
   338         ui.readconfig(opts['rcfile'])
   396 
   395 
   397     nokwcommands = ['add', 'addremove', 'bundle', 'clone', 'copy', 'export',
   396     nokwcommands = ['add', 'addremove', 'bundle', 'clone', 'copy', 'export',
   398                     'grep', 'identify', 'incoming', 'init', 'outgoing', 'push',
   397                     'grep', 'identify', 'incoming', 'init', 'outgoing', 'push',
   399                     'remove', 'rename', 'rollback']
   398                     'remove', 'rename', 'rollback']
   400 
   399 
   401     # for backwards compatibility
       
   402     ui = repo.ui
       
   403 
       
   404     def _getcmd():
   400     def _getcmd():
   405         # cmdutil.parse(ui, sys.argv[1:])[0] doesn't work for "hg diff -r"
   401         # cmdutil.parse(ui, sys.argv[1:])[0] doesn't work for "hg diff -r"
   406         args = fancyopts.fancyopts(sys.argv[1:], commands.globalopts, {})
   402         args = fancyopts.fancyopts(sys.argv[1:], commands.globalopts, {})
   407         if args:
   403         if args:
   408             cmd = args[0]
   404             cmd = args[0]