Set boolean mandatory arguments directly and comment them
authorChristian Ebert <blacktrash@gmx.net>
Tue, 18 Sep 2007 00:08:23 +0100
changeset 243 bbd5af3ec247
parent 242 71056c5042de
child 244 e449107a0501
Set boolean mandatory arguments directly and comment them
hgkw/keyword.py
--- a/hgkw/keyword.py	Tue Sep 18 00:03:17 2007 +0100
+++ b/hgkw/keyword.py	Tue Sep 18 00:08:23 2007 +0100
@@ -341,9 +341,9 @@
         if not files:
             ui.warn(_('files not configured for expansion or untracked\n'))
             return
-        commit = False
         kwt = kwtemplater(ui, repo, expand, node=ctx.node())
-        kwt.overwrite(files, man, commit)
+        # 3rd argument sets commit to False
+        kwt.overwrite(files, man, False)
     finally:
         del wlock, lock
 
@@ -354,16 +354,16 @@
     run before changing/disabling active keywords
     or if you experience problems with "hg import" or "hg merge"
     '''
-    expand = False
-    _overwrite(ui, repo, args, expand)
+    # 4th argument sets expansion to False
+    _overwrite(ui, repo, args, False)
 
 def expand(ui, repo, *args):
     '''expand keywords in working directory
 
     run after (re)enabling keyword expansion
     '''
-    expand = True
-    _overwrite(ui, repo, args, expand)
+    # 4th argument sets expansion to True
+    _overwrite(ui, repo, args, True)
 
 def demo(ui, repo, *args, **opts):
     '''print [keywordmaps] configuration and an expansion example
@@ -509,9 +509,10 @@
                     mn = self.manifest.read(cl[0])
                     candidates = _weedcandidates(mn, kwfmatcher, cl[3])
                     if candidates:
-                        expand = commit = True
-                        kwt = kwtemplater(ui, self, expand, node=node)
-                        kwt.overwrite(candidates, mn, commit)
+                        # 3rd argument sets expansion to True
+                        kwt = kwtemplater(ui, self, True, node=node)
+                        # 3rd argument sets commit to True
+                        kwt.overwrite(candidates, mn, True)
                 return node
             finally:
                 del _wlock, _lock