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

Dirkjan Ochtman dirkjan at ochtman.nl
Thu Feb 11 04:41:57 CST 2010


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.

Cheers,

Dirkjan


More information about the Mercurial-devel mailing list