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 |