hgkw/kwexpander.py
branchupdatehook
changeset 25 aa3fbe81e9ad
parent 24 1083d250d1b2
child 29 bda83c13da42
--- a/hgkw/kwexpander.py	Sun Dec 17 10:52:47 2006 +0100
+++ b/hgkw/kwexpander.py	Sun Dec 17 10:57:55 2006 +0100
@@ -4,22 +4,23 @@
 from mercurial import util
 import re
 
-# name of keyword encode filter:
-kwencodefilter = 'hgkwencode'
-# look for <Dollar>Hg<Dollar>
-kwtrigger = '%sHg$' % '$'
-
-def wwritekw(ui, repo, f, text):
-    '''Writes text with kwupdates keywords to f in working directory.'''
-    ui.note(_('expanding keywords in %s\n' % f))
-#   # backup file (?)
-#   absfile = repo.wjoin(f)
-#   util.copyfile(absfile, absfile+'.kwbak')
-    repo.wfile(f, 'w').write(text)
-
 def expandkw(ui, repo, node, cid, candidates, update=False):
     '''Important: returns False on success, True on failure.'''
 
+    # name of keyword encode filter:
+    kwencodefilter = 'hgkwencode'
+
+    # look for <Dollar>Hg<Dollar>
+    kwtrigger = '%sHg$' % '$'
+
+    def wwritekw(ui, repo, f, text):
+        '''Writes text with kwupdates keywords to f in working directory.'''
+        ui.note(_('expanding keywords in %s\n' % f))
+    #   # backup file (?)
+    #   absfile = repo.wjoin(f)
+    #   util.copyfile(absfile, absfile+'.kwbak')
+        repo.wfile(f, 'w').write(text)
+
     # only check files that have hgkwencode assigned as encode filter
     files = []
     # python2.4: files = set()