612 yield chunk |
612 yield chunk |
613 finally: |
613 finally: |
614 if kwt: |
614 if kwt: |
615 kwt.match = origmatch |
615 kwt.match = origmatch |
616 |
616 |
617 def kw_amend(orig, ui, repo, commitfunc, old, extra, pats, opts): |
617 def kw_amend(orig, ui, repo, old, extra, pats, opts): |
618 '''Wraps cmdutil.amend expanding keywords after amend.''' |
618 '''Wraps cmdutil.amend expanding keywords after amend.''' |
619 kwt = getattr(repo, '_keywordkwt', None) |
619 kwt = getattr(repo, '_keywordkwt', None) |
620 if kwt is None: |
620 if kwt is None: |
621 return orig(ui, repo, commitfunc, old, extra, pats, opts) |
621 return orig(ui, repo, old, extra, pats, opts) |
622 with repo.wlock(): |
622 with repo.wlock(): |
623 kwt.postcommit = True |
623 kwt.postcommit = True |
624 newid = orig(ui, repo, commitfunc, old, extra, pats, opts) |
624 newid = orig(ui, repo, old, extra, pats, opts) |
625 if newid != old.node(): |
625 if newid != old.node(): |
626 ctx = repo[newid] |
626 ctx = repo[newid] |
627 kwt.restrict = True |
627 kwt.restrict = True |
628 kwt.overwrite(ctx, ctx.files(), False, True) |
628 kwt.overwrite(ctx, ctx.files(), False, True) |
629 kwt.restrict = False |
629 kwt.restrict = False |