changeset 7378:8dde275680d8

keyword: move common code out of commit condition
author Christian Ebert <blacktrash@gmx.net>
date Fri, 14 Nov 2008 22:29:03 +0100
parents 374a6b3ac623
children ef22cb8896d6
files hgext/keyword.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Fri Nov 14 14:12:43 2008 -0600
+++ b/hgext/keyword.py	Fri Nov 14 22:29:03 2008 +0100
@@ -165,14 +165,12 @@
 
     def overwrite(self, node, expand, files):
         '''Overwrites selected files expanding/shrinking keywords.'''
+        ctx = self.repo[node]
+        mf = ctx.manifest()
         if node is not None:     # commit
-            ctx = self.repo[node]
-            mf = ctx.manifest()
             files = [f for f in ctx.files() if f in mf]
             notify = self.ui.debug
         else:                    # kwexpand/kwshrink
-            ctx = self.repo[None]
-            mf = ctx.manifest()
             notify = self.ui.note
         candidates = [f for f in files if self.iskwfile(f, ctx.flags)]
         if candidates: