hgkw/keyword.py
changeset 235 baef9dcfb219
parent 234 6f1ed470541c
child 236 e52075167842
--- a/hgkw/keyword.py	Sun Sep 02 15:09:56 2007 +0200
+++ b/hgkw/keyword.py	Sun Sep 02 15:16:57 2007 +0200
@@ -197,6 +197,15 @@
             # older versions want file descriptor as 3. optional arg
             self.repo.wwrite(f, data)
 
+    def _normal(self, files):
+        '''Backwards compatible repo.dirstate.normal/update.'''
+        try:
+            for f in files:
+                self.repo.dirstate.normal(f)
+        except AttributeError:
+            # older versions don't know about dirstate.normal
+            self.repo.dirstate.update(files, 'n')
+
     def _ctxnode(self, node):
         '''Obtains missing node from file context.'''
         if not self.node:
@@ -251,13 +260,7 @@
                 notify(_('overwriting %s %s keywords\n') % (f, action))
                 self._wwrite(f, data, man)
                 overwritten.append(f)
-        if overwritten:
-            try:
-                for f in overwritten:
-                    self.repo.dirstate.normal(f)
-            except AttributeError:
-                # older versions don't know about dirstate.normal
-                self.repo.dirstate.update(overwritten, 'n')
+        self._normal(overwritten)
 
 class kwfilelog(filelog.filelog):
     '''