hgext/keyword.py
changeset 27817 476e402e57c3
parent 27816 98391f38ceb8
child 27818 484895cc0f60
equal deleted inserted replaced
27816:98391f38ceb8 27817:476e402e57c3
   651         kwt.match = util.never
   651         kwt.match = util.never
   652         return orig(web, req, tmpl)
   652         return orig(web, req, tmpl)
   653 
   653 
   654     def kw_amend(orig, ui, repo, commitfunc, old, extra, pats, opts):
   654     def kw_amend(orig, ui, repo, commitfunc, old, extra, pats, opts):
   655         '''Wraps cmdutil.amend expanding keywords after amend.'''
   655         '''Wraps cmdutil.amend expanding keywords after amend.'''
   656         wlock = repo.wlock()
   656         with repo.wlock():
   657         try:
       
   658             kwt.postcommit = True
   657             kwt.postcommit = True
   659             newid = orig(ui, repo, commitfunc, old, extra, pats, opts)
   658             newid = orig(ui, repo, commitfunc, old, extra, pats, opts)
   660             if newid != old.node():
   659             if newid != old.node():
   661                 ctx = repo[newid]
   660                 ctx = repo[newid]
   662                 kwt.restrict = True
   661                 kwt.restrict = True
   663                 kwt.overwrite(ctx, ctx.files(), False, True)
   662                 kwt.overwrite(ctx, ctx.files(), False, True)
   664                 kwt.restrict = False
   663                 kwt.restrict = False
   665             return newid
   664             return newid
   666         finally:
       
   667             wlock.release()
       
   668 
   665 
   669     def kw_copy(orig, ui, repo, pats, opts, rename=False):
   666     def kw_copy(orig, ui, repo, pats, opts, rename=False):
   670         '''Wraps cmdutil.copy so that copy/rename destinations do not
   667         '''Wraps cmdutil.copy so that copy/rename destinations do not
   671         contain expanded keywords.
   668         contain expanded keywords.
   672         Note that the source of a regular file destination may also be a
   669         Note that the source of a regular file destination may also be a