hgkw/keyword.py
changeset 769 3bf3212b13bc
parent 767 0492a5acf652
child 771 09e39675a702
equal deleted inserted replaced
768:36f51ccd65d3 769:3bf3212b13bc
   189         Caveat: localrepository._link fails on Windows.'''
   189         Caveat: localrepository._link fails on Windows.'''
   190         return self.match(path) and not 'l' in flagfunc(path)
   190         return self.match(path) and not 'l' in flagfunc(path)
   191 
   191 
   192     def overwrite(self, ctx, candidates, iswctx, expand):
   192     def overwrite(self, ctx, candidates, iswctx, expand):
   193         '''Overwrites selected files expanding/shrinking keywords.'''
   193         '''Overwrites selected files expanding/shrinking keywords.'''
   194         mf = ctx.manifest()
       
   195         if self.record:
   194         if self.record:
   196             candidates = [f for f in ctx.files() if f in mf]
   195             candidates = [f for f in ctx.files() if f in ctx]
   197         candidates = [f for f in candidates if self.iskwfile(f, ctx.flags)]
   196         candidates = [f for f in candidates if self.iskwfile(f, ctx.flags)]
   198         if candidates:
   197         if candidates:
   199             self.restrict = True        # do not expand when reading
   198             self.restrict = True        # do not expand when reading
       
   199             mf = ctx.manifest()
   200             msg = (expand and _('overwriting %s expanding keywords\n')
   200             msg = (expand and _('overwriting %s expanding keywords\n')
   201                    or _('overwriting %s shrinking keywords\n'))
   201                    or _('overwriting %s shrinking keywords\n'))
   202             for f in candidates:
   202             for f in candidates:
   203                 if not self.record:
   203                 if not self.record:
   204                     data = self.repo.file(f).read(mf[f])
   204                     data = self.repo.file(f).read(mf[f])