##// END OF EJS Templates
keyword: rename kwt.record attribute to kwt.postcommit...
Christian Ebert -
r16809:6b704fa2 default
parent child Browse files
Show More
@@ -188,7 +188,7 b' class kwtemplater(object):'
188 self.repo = repo
188 self.repo = repo
189 self.match = match.match(repo.root, '', [], inc, exc)
189 self.match = match.match(repo.root, '', [], inc, exc)
190 self.restrict = kwtools['hgcmd'] in restricted.split()
190 self.restrict = kwtools['hgcmd'] in restricted.split()
191 self.record = False
191 self.postcommit = False
192
192
193 kwmaps = self.ui.configitems('keywordmaps')
193 kwmaps = self.ui.configitems('keywordmaps')
194 if kwmaps: # override default templates
194 if kwmaps: # override default templates
@@ -243,7 +243,7 b' class kwtemplater(object):'
243
243
244 def overwrite(self, ctx, candidates, lookup, expand, rekw=False):
244 def overwrite(self, ctx, candidates, lookup, expand, rekw=False):
245 '''Overwrites selected files expanding/shrinking keywords.'''
245 '''Overwrites selected files expanding/shrinking keywords.'''
246 if self.restrict or lookup or self.record: # exclude kw_copy
246 if self.restrict or lookup or self.postcommit: # exclude kw_copy
247 candidates = self.iskwfile(candidates, ctx)
247 candidates = self.iskwfile(candidates, ctx)
248 if not candidates:
248 if not candidates:
249 return
249 return
@@ -280,7 +280,7 b' class kwtemplater(object):'
280 fp.close()
280 fp.close()
281 if kwcmd:
281 if kwcmd:
282 self.repo.dirstate.normal(f)
282 self.repo.dirstate.normal(f)
283 elif self.record:
283 elif self.postcommit:
284 self.repo.dirstate.normallookup(f)
284 self.repo.dirstate.normallookup(f)
285
285
286 def shrink(self, fname, text):
286 def shrink(self, fname, text):
@@ -583,7 +583,7 b' def reposetup(ui, repo):'
583 def kwcommitctx(self, ctx, error=False):
583 def kwcommitctx(self, ctx, error=False):
584 n = super(kwrepo, self).commitctx(ctx, error)
584 n = super(kwrepo, self).commitctx(ctx, error)
585 # no lock needed, only called from repo.commit() which already locks
585 # no lock needed, only called from repo.commit() which already locks
586 if not kwt.record:
586 if not kwt.postcommit:
587 restrict = kwt.restrict
587 restrict = kwt.restrict
588 kwt.restrict = True
588 kwt.restrict = True
589 kwt.overwrite(self[n], sorted(ctx.added() + ctx.modified()),
589 kwt.overwrite(self[n], sorted(ctx.added() + ctx.modified()),
@@ -661,7 +661,7 b' def reposetup(ui, repo):'
661 try:
661 try:
662 # record returns 0 even when nothing has changed
662 # record returns 0 even when nothing has changed
663 # therefore compare nodes before and after
663 # therefore compare nodes before and after
664 kwt.record = True
664 kwt.postcommit = True
665 ctx = repo['.']
665 ctx = repo['.']
666 wstatus = repo[None].status()
666 wstatus = repo[None].status()
667 ret = orig(ui, repo, commitfunc, *pats, **opts)
667 ret = orig(ui, repo, commitfunc, *pats, **opts)
General Comments 0
You need to be logged in to leave comments. Login now