[PATCH STABLE V2] strip: fix revset usage (issue3604)

Benoit Boissinot bboissin at gmail.com
Fri Aug 31 16:44:13 CDT 2012


Pushed to crew-stable, thanks.

On Fri, Aug 31, 2012 at 11:32 PM, Pierre-Yves David <
pierre-yves.david at ens-lyon.org> wrote:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1346448446 -7200
> # Branch stable
> # Node ID e2eef0b38ae72daef8d5f092d01a01f9e7f23c55
> # Parent  b0aad9fb87f947e821f0381d461f1794e73833a7
> strip: fix revset usage (issue3604)
>
> The `repair` code builds a giant revset query instead of using the "%lr"
> idiom.
> It is inefficient and crash when the number of stripped changeset is too
> big.
>
> This changeset replaces the bad code by a better revset usage.
>
> diff --git a/mercurial/repair.py b/mercurial/repair.py
> --- a/mercurial/repair.py
> +++ b/mercurial/repair.py
> @@ -111,9 +111,8 @@
>          saverevs.difference_update(descendants)
>      savebases = [cl.node(r) for r in saverevs]
>      stripbases = [cl.node(r) for r in tostrip]
> -    rset = ' or '.join([str(r) for r in tostrip])
> -    newbmtarget = repo.revs('sort(heads(ancestors(%r) - (%r)), -rev)',
> -                            rset, rset)
> +    newbmtarget = repo.revs('sort(heads((::%ld) - (%ld)), -rev)',
> +                            tostrip, tostrip)
>      if newbmtarget:
>          newbmtarget = newbmtarget[0]
>      else:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120831/4e60d6c7/attachment.html>


More information about the Mercurial-devel mailing list