hgkw/keyword.py
branchself_initializing_hook
changeset 82 9bf0f7db5928
parent 81 fd5d3a974ea7
child 83 05e50378c6e8
equal deleted inserted replaced
81:fd5d3a974ea7 82:9bf0f7db5928
     1 # keyword.py - keyword expansion for mercurial
     1 # keyword.py - keyword expansion for mercurial
       
     2 # $Id$
     2 
     3 
     3 '''keyword expansion hack against the grain of a DSCM
     4 '''keyword expansion hack against the grain of a DSCM
     4 
     5 
     5 This extension lets you expand RCS/CVS-like keywords in a Mercurial
     6 This extension lets you expand RCS/CVS-like keywords in a Mercurial
     6 repository.
     7 repository.
   136 
   137 
   137 def pretxnkw(ui, repo, hooktype, **args):
   138 def pretxnkw(ui, repo, hooktype, **args):
   138     '''pretxncommit hook that collects candidates for keyword expansion
   139     '''pretxncommit hook that collects candidates for keyword expansion
   139     on commit and expands keywords in working dir.'''
   140     on commit and expands keywords in working dir.'''
   140     from mercurial.i18n import gettext as _
   141     from mercurial.i18n import gettext as _
       
   142     # above line for backwards compatibility; can be changed to
       
   143     #   from mercurial.i18n import _
       
   144     # some day
   141     from mercurial import cmdutil, commands
   145     from mercurial import cmdutil, commands
   142     import sys
   146     import sys
   143 
   147 
   144     if hooktype != 'pretxncommit':
   148     if hooktype != 'pretxncommit':
   145         return True
   149         return True