diff hgext/keyword.py @ 6739:c9fbd6ec3489

context: avoid using None for working parent
author Matt Mackall <mpm@selenic.com>
date Wed, 25 Jun 2008 17:35:20 -0500
parents 336fda65759a
children b148e9099133
line wrap: on
line diff
--- a/hgext/keyword.py	Wed Jun 25 17:34:28 2008 -0500
+++ b/hgext/keyword.py	Wed Jun 25 17:35:20 2008 -0500
@@ -171,12 +171,14 @@
 
     def overwrite(self, node, expand, files):
         '''Overwrites selected files expanding/shrinking keywords.'''
-        ctx = self.repo.changectx(node)
-        mf = ctx.manifest()
         if node is not None:     # commit
+            ctx = self.repo.changectx(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.changectx('.')
+            mf = ctx.manifest()
             notify = self.ui.note
         candidates = [f for f in files if self.iskwfile(f, mf.linkf)]
         if candidates:
@@ -511,7 +513,7 @@
         comparing against working dir.'''
         if node2 is not None:
             kwt.matcher = util.never
-        elif node1 is not None and node1 != repo.changectx().node():
+        elif node1 is not None and node1 != repo.changectx('.').node():
             kwt.restrict = True
         patch_diff(repo, node1, node2, match, fp, changes, opts)