hgkw/keyword.py
changeset 244 e449107a0501
parent 243 bbd5af3ec247
child 245 b0316be232da
equal deleted inserted replaced
243:bbd5af3ec247 244:e449107a0501
    81 '''
    81 '''
    82 
    82 
    83 from mercurial import commands, cmdutil, context, fancyopts, filelog
    83 from mercurial import commands, cmdutil, context, fancyopts, filelog
    84 from mercurial import localrepo, templater, util, hg
    84 from mercurial import localrepo, templater, util, hg
    85 from mercurial.i18n import gettext as _
    85 from mercurial.i18n import gettext as _
    86 import getopt, os, re, shutil, sys, tempfile, time
    86 import getopt, re, shutil, sys, tempfile, time
    87 
    87 
    88 # backwards compatibility hacks
    88 # backwards compatibility hacks
    89 
    89 
    90 try:
    90 try:
    91     # cmdutil.parse moves to dispatch._parse in 18a9fbb5cd78
    91     # cmdutil.parse moves to dispatch._parse in 18a9fbb5cd78
   333         if kwfmatcher is None:
   333         if kwfmatcher is None:
   334             ui.warn(_('no files configured for keyword expansion\n'))
   334             ui.warn(_('no files configured for keyword expansion\n'))
   335             return
   335             return
   336         man = ctx.manifest()
   336         man = ctx.manifest()
   337         if files:
   337         if files:
   338             cwd = os.getcwd()
   338             cwd = repo.getcwd()
   339             files = [util.canonpath(repo.root, cwd, f) for f in files]
   339             files = [util.canonpath(repo.root, cwd, f) for f in files]
   340         files = _weedcandidates(man, kwfmatcher, files)
   340         files = _weedcandidates(man, kwfmatcher, files)
   341         if not files:
   341         if not files:
   342             ui.warn(_('files not configured for expansion or untracked\n'))
   342             ui.warn(_('files not configured for expansion or untracked\n'))
   343             return
   343             return