hgkw/keyword.py
branchkwmap-templates
changeset 108 25dac950a1f0
parent 107 fe4a0495eca8
child 109 b2cc6a8d4a18
equal deleted inserted replaced
107:fe4a0495eca8 108:25dac950a1f0
    14 For in-depth discussion refer to
    14 For in-depth discussion refer to
    15 <http://www.selenic.com/mercurial/wiki/index.cgi/KeywordPlan>.
    15 <http://www.selenic.com/mercurial/wiki/index.cgi/KeywordPlan>.
    16 
    16 
    17 You can either use the default cvs-like keywords or provide your
    17 You can either use the default cvs-like keywords or provide your
    18 own in hgrc.
    18 own in hgrc.
       
    19 
       
    20 It is recommended to enable this extension on a per-repo basis only.
       
    21 You can still configure keywordmaps globally.
    19 
    22 
    20 Expansions spanning more than one line are truncated to their first line.
    23 Expansions spanning more than one line are truncated to their first line.
    21 Incremental expansion (like CVS' $Log$) is not supported.
    24 Incremental expansion (like CVS' $Log$) is not supported.
    22 
    25 
    23 Default $keywords$ and their $keyword: substition $ are:
    26 Default $keywords$ and their $keyword: substition $ are:
   110         expansion = templater.firstline(self.ui.popbuffer())
   113         expansion = templater.firstline(self.ui.popbuffer())
   111         return '$%s: %s $' % (kw, expansion)
   114         return '$%s: %s $' % (kw, expansion)
   112 
   115 
   113 
   116 
   114 def reposetup(ui, repo):
   117 def reposetup(ui, repo):
       
   118     '''Sets up repo, and filelog especially, as kwrepo and kwfilelog
       
   119     for keyword substitution.  This is done for local repos only.'''
       
   120 
   115     from mercurial import context, filelog, revlog
   121     from mercurial import context, filelog, revlog
   116     if not repo.local():
   122     if not repo.local():
   117         return
   123         return
   118 
   124 
   119     class kwrepo(repo.__class__):
   125     class kwrepo(repo.__class__):