hgkw/keyword.py
branchkwmap-templates
changeset 161 aac10ec0a8cd
parent 160 e45d804d28dd
child 162 017dbf710056
equal deleted inserted replaced
160:e45d804d28dd 161:aac10ec0a8cd
   219     files configured at all for keyword substitution.'''
   219     files configured at all for keyword substitution.'''
   220 
   220 
   221     if not repo.local():
   221     if not repo.local():
   222         return
   222         return
   223 
   223 
   224     archivemode = (getcmd(repo.ui) == 'archive')
       
   225 
       
   226     inc, exc, archive, noarchive = [], ['.hg*'], [], ['.hg*']
   224     inc, exc, archive, noarchive = [], ['.hg*'], [], ['.hg*']
   227     for pat, opt in repo.ui.configitems('keyword'):
   225     for pat, opt in repo.ui.configitems('keyword'):
   228         if opt == 'archive':
   226         if opt == 'archive':
   229             archive.append(pat)
   227             archive.append(pat)
   230         elif opt == 'noarchive':
   228         elif opt == 'noarchive':
   231             noarchive.append(pat)
   229             noarchive.append(pat)
   232         elif opt == 'ignore':
   230         elif opt == 'ignore':
   233             exc.append(pat)
   231             exc.append(pat)
   234         else:
   232         else:
   235             inc.append(pat)
   233             inc.append(pat)
   236     if archivemode:
   234     if getcmd(repo.ui) == 'archive':
   237         inc, exc = archive, noarchive
   235         inc, exc = archive, noarchive
   238     if not inc:
   236     if not inc:
   239         return
   237         return
   240 
   238 
   241     repo.kwfmatcher = util.matcher(repo.root, inc=inc, exc=exc)[1]
   239     repo.kwfmatcher = util.matcher(repo.root, inc=inc, exc=exc)[1]