Switch kwtemplater.record in kw_dorecord()
authorChristian Ebert <blacktrash@gmx.net>
Sat, 09 Oct 2010 11:35:31 +0100
changeset 819 8f2c2cc51789
parent 818 b742a071ad9c
child 820 67c17a447d99
child 825 908e4fe6c177
Switch kwtemplater.record in kw_dorecord() Obsoletes the need for a global recordcommands variable.
hgkw/keyword.py
--- a/hgkw/keyword.py	Sat Oct 09 11:35:24 2010 +0100
+++ b/hgkw/keyword.py	Sat Oct 09 11:35:31 2010 +0100
@@ -98,8 +98,6 @@
 # not when reading filelog, and unexpand when reading from working dir
 restricted = 'merge kwexpand kwshrink record qrecord resolve transplant'
 
-# commands using dorecord
-recordcommands = 'record qrecord'
 # names of extensions using dorecord
 recordextensions = 'record'
 
@@ -155,7 +153,7 @@
         self.repo = repo
         self.match = match.match(repo.root, '', [], inc, exc)
         self.restrict = kwtools['hgcmd'] in restricted.split()
-        self.record = kwtools['hgcmd'] in recordcommands.split()
+        self.record = False
 
         kwmaps = self.ui.configitems('keywordmaps')
         if kwmaps: # override default templates
@@ -570,6 +568,7 @@
         try:
             # record returns 0 even when nothing has changed
             # therefore compare nodes before and after
+            kwt.record = True
             ctx = repo['.']
             modified, added = repo[None].status()[:2]
             ret = orig(ui, repo, commitfunc, *pats, **opts)