--- a/hgkw/keyword.py Thu Jul 26 18:24:35 2007 +0200
+++ b/hgkw/keyword.py Fri Jul 27 10:34:48 2007 +0200
@@ -186,9 +186,7 @@
expand = self.t is not None
action = ('shrinking', 'expanding')[expand]
notify = (self.ui.note, self.ui.debug)[commit]
- # backwards compatibility: older versions have dirstate.update
- nodirstateupdate = not hasattr(self.repo.dirstate, 'update')
- files = []
+ overwritten = []
for f in candidates:
fp = self.repo.file(f, kwexp=expand, kwcnt=True)
data, kwfound = fp.read(man[f])
@@ -199,12 +197,14 @@
except AttributeError:
# older versions want file descriptor as 3. optional arg
self.repo.wwrite(f, data)
- if nodirstateupdate:
+ overwritten.append(f)
+ if overwritten:
+ try:
+ for f in overwritten:
self.repo.dirstate.normal(f)
- else:
- files.append(f)
- if files:
- self.repo.dirstate.update(files, 'n')
+ except AttributeError:
+ # older versions don't know about dirstate.normal
+ self.repo.dirstate.update(overwritten, 'n')
class kwfilelog(filelog.filelog):
'''