hgkw/keyword.py
changeset 298 c8afb99bb70f
parent 297 9e29992343a1
child 300 583efc0983f1
equal deleted inserted replaced
297:9e29992343a1 298:c8afb99bb70f
   366     files.sort()
   366     files.sort()
   367     kwfiles = [f for f in files if ui.kwfmatcher(f) and not repo._link(f)]
   367     kwfiles = [f for f in files if ui.kwfmatcher(f) and not repo._link(f)]
   368     cwd = pats and repo.getcwd() or ''
   368     cwd = pats and repo.getcwd() or ''
   369     allf = opts['all']
   369     allf = opts['all']
   370     ignore = opts['ignore']
   370     ignore = opts['ignore']
   371     flag = (allf or ui.verbose) and 1 or 0
   371     if ignore:
   372     if not ignore:
   372         kwfstats = ()
   373         format = ('%s\n', 'K %s\n')[flag]
   373     else:
   374         for k in kwfiles:
   374         kwfstats = (('K', kwfiles),)
   375             ui.write(format % repo.pathto(k, cwd))
       
   376     if allf or ignore:
   375     if allf or ignore:
   377         format = ('%s\n', 'I %s\n')[flag]
   376         kwfstats += (('I', [f for f in files if f not in kwfiles]),)
   378         for i in [f for f in files if f not in kwfiles]:
   377     for char, filenames in kwfstats:
   379             ui.write(format % repo.pathto(i, cwd))
   378         if allf or ui.verbose:
       
   379             format = '%s %%s\n' % char
       
   380         else:
       
   381             format = '%s\n'
       
   382         for f in filenames:
       
   383             ui.write(format % repo.pathto(f, cwd))
   380 
   384 
   381 def shrink(ui, repo, *pats, **opts):
   385 def shrink(ui, repo, *pats, **opts):
   382     '''revert expanded keywords in working directory
   386     '''revert expanded keywords in working directory
   383 
   387 
   384     Run before changing/disabling active keywords
   388     Run before changing/disabling active keywords