hgext/keyword.py
changeset 50022 c166b212bdee
parent 49037 642e31cb55f0
child 50023 7a8bfc05b691
equal deleted inserted replaced
50021:376395868b7b 50022:c166b212bdee
   694 def kw_amend(orig, ui, repo, old, extra, pats, opts):
   694 def kw_amend(orig, ui, repo, old, extra, pats, opts):
   695     '''Wraps cmdutil.amend expanding keywords after amend.'''
   695     '''Wraps cmdutil.amend expanding keywords after amend.'''
   696     kwt = getattr(repo, '_keywordkwt', None)
   696     kwt = getattr(repo, '_keywordkwt', None)
   697     if kwt is None:
   697     if kwt is None:
   698         return orig(ui, repo, old, extra, pats, opts)
   698         return orig(ui, repo, old, extra, pats, opts)
   699     with repo.wlock(), repo.dirstate.parentchange():
   699     with repo.wlock(), repo.dirstate.parentchange(repo):
   700         kwt.postcommit = True
   700         kwt.postcommit = True
   701         newid = orig(ui, repo, old, extra, pats, opts)
   701         newid = orig(ui, repo, old, extra, pats, opts)
   702         if newid != old.node():
   702         if newid != old.node():
   703             ctx = repo[newid]
   703             ctx = repo[newid]
   704             kwt.restrict = True
   704             kwt.restrict = True
   760         ret = orig(ui, repo, commitfunc, *pats, **opts)
   760         ret = orig(ui, repo, commitfunc, *pats, **opts)
   761         recctx = repo[b'.']
   761         recctx = repo[b'.']
   762         if ctx != recctx:
   762         if ctx != recctx:
   763             modified, added = _preselect(wstatus, recctx.files())
   763             modified, added = _preselect(wstatus, recctx.files())
   764             kwt.restrict = False
   764             kwt.restrict = False
   765             with repo.dirstate.parentchange():
   765             with repo.dirstate.parentchange(repo):
   766                 kwt.overwrite(recctx, modified, False, True)
   766                 kwt.overwrite(recctx, modified, False, True)
   767                 kwt.overwrite(recctx, added, False, True, True)
   767                 kwt.overwrite(recctx, added, False, True, True)
   768             kwt.restrict = True
   768             kwt.restrict = True
   769         return ret
   769         return ret
   770 
   770