hgkw/keyword.py
branchstable
changeset 1121 f4dcce73f362
parent 1114 22b300b7a7c1
child 1141 4e2090ed2e72
equal deleted inserted replaced
1119:5f7f30917a18 1121:f4dcce73f362
     5 # This software may be used and distributed according to the terms of the
     5 # This software may be used and distributed according to the terms of the
     6 # GNU General Public License version 2 or any later version.
     6 # GNU General Public License version 2 or any later version.
     7 #
     7 #
     8 # $Id$
     8 # $Id$
     9 #
     9 #
    10 # Keyword expansion hack against the grain of a DSCM
    10 # Keyword expansion hack against the grain of a Distributed SCM
    11 #
    11 #
    12 # There are many good reasons why this is not needed in a distributed
    12 # There are many good reasons why this is not needed in a distributed
    13 # SCM, still it may be useful in very small projects based on single
    13 # SCM, still it may be useful in very small projects based on single
    14 # files (like LaTeX packages), that are mostly addressed to an
    14 # files (like LaTeX packages), that are mostly addressed to an
    15 # audience not running a version control system.
    15 # audience not running a version control system.
   166     '''Helper for keyword expansion removal in text.
   166     '''Helper for keyword expansion removal in text.
   167     Depending on subfunc also returns number of substitutions.'''
   167     Depending on subfunc also returns number of substitutions.'''
   168     return subfunc(r'$\1$', text)
   168     return subfunc(r'$\1$', text)
   169 
   169 
   170 def _preselect(wstatus, changed):
   170 def _preselect(wstatus, changed):
   171     '''Retrieves modfied and added files from a working directory state
   171     '''Retrieves modified and added files from a working directory state
   172     and returns the subset of each contained in given changed files
   172     and returns the subset of each contained in given changed files
   173     retrieved from a change context.'''
   173     retrieved from a change context.'''
   174     modified, added = wstatus[:2]
   174     modified, added = wstatus[:2]
   175     modified = [f for f in modified if f in changed]
   175     modified = [f for f in modified if f in changed]
   176     added = [f for f in added if f in changed]
   176     added = [f for f in added if f in changed]