[PATCH RFC] histedit: add exec command (issue4036)
Idan Kamara
idankk86 at gmail.com
Thu Nov 14 07:18:12 CST 2013
On Tue, Nov 12, 2013 at 8:04 PM, Durham Goode <durham at fb.com> wrote:
> On 11/12/13 10:01 AM, "Durham Goode" <durham at fb.com> wrote:
>
> >
> >diff --git a/hgext/histedit.py b/hgext/histedit.py
> >--- a/hgext/histedit.py
> >+++ b/hgext/histedit.py
> >@@ -405,6 +402,26 @@
> > # We didn't make an edit, so just indicate no replaced nodes
> > return newctx, []
> >
> >+def execute(ui, repo, ctx, ha, opts):
> >+ hg.update(repo, ctx.node())
> >+ os.system(ha)
> >+
> >+ # reset caches
> >+ repo.changelog
> >+ del repo.changelog
> >+ repo.manifest
> >+ del repo.manifest
> >+ repo.dirstate
> >+ del repo.dirstate
> >+ repo._phasecache
> >+ del repo._phasecache
> >+
> >+ newctx = repo['.']
> >+ if not ctx.node() in repo:
> >+ return newctx, [(ctx.node(), (newctx.node(),))]
> >+
> >+ return newctx, []
> >+
>
> It's also worth calling out that I don't think our property caches
> (repo.changelog/manifest/dirstate/etc) are being invalidated correctly
> when the underlying file changes. I haven't had time to dig in, but
> manually invalidating the cache here was required in order for it to pick
> up new changes.
Try calling repo.invalidate() and repo.invalidatedirstate().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20131114/5c812de8/attachment.html>
More information about the Mercurial-devel
mailing list