[PATCH] rebase: invalidate caches before stripping (issue1951)

Stefano Tortarolo stefano.tortarolo at gmail.com
Thu Feb 11 04:51:45 CST 2010


2010/2/11 Dirkjan Ochtman <dirkjan at ochtman.nl>

> On Thu, Feb 11, 2010 at 11:35, Stefano Tortarolo
> <stefano.tortarolo at gmail.com> wrote:
> > # HG changeset patch
> > # User Stefano Tortarolo <stefano.tortarolo at gmail.com>
> > # Date 1265884017 -3600
> > # Node ID ce7e84d20a5430e316544e70fd504d6945ce99cb
> > # Parent  1a8df80dfddefe8b45f61529bbe2f2615786a77b
> > rebase: invalidate caches before stripping (issue1951)
> >
> > In issue1951 rebase tries to strip the old revisions using an outdated
> > branchcache. This patch simply invalidates the repo's caches before
> > invoking strip.
> >
> > diff --git a/hgext/rebase.py b/hgext/rebase.py
> > --- a/hgext/rebase.py
> > +++ b/hgext/rebase.py
> > @@ -172,6 +172,8 @@
> >                     ui.warn(_("warning: new changesets detected on source
> branch, "
> >                                                             "not
> stripping\n"))
> >                 else:
> > +                    # Invalidate repo's caches before stripping
> > +                    repo.invalidate()
> >                     repair.strip(ui, repo, repo[min(rebased)].node(),
> "strip")
> >
> >         clearstatus(repo)
>
> Do you really need to do this before the strip? It'd seem more
> sensible just after.
>

Well, the problem is that strip uses an old branchcache and fails in finding
the node.
Hence, strip fails -> rebase fails.
That's exactly what happens in issue1951.

Cheers,
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100211/1acab462/attachment.htm>


More information about the Mercurial-devel mailing list