[PATCH stable] qpush --move: move the right patch even with comment lines

Mads Kiilerich mads at kiilerich.com
Fri Jul 2 08:43:20 CDT 2010


On 07/02/2010 03:33 PM, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich<mads at kiilerich.com>
> # Date 1278077561 -7200
> # Branch stable
> # Node ID 84e9c15edee60cab95b3c635dd257d8b49226237
> # Parent  239f3210c970615dc1d5f861a92b61b4662a71a5
> qpush --move: move the right patch even with comment lines
>
> 88fc876a4833 caused that we find the index of the moving patch in self.series
> but look it up in self.full_series. The difference between these is that
> full_series also contains comment lines, and we thus moved the wrong patch.
>
> diff --git a/hgext/mq.py b/hgext/mq.py
> --- a/hgext/mq.py
> +++ b/hgext/mq.py
> @@ -1047,7 +1047,7 @@
>
>               if move:
>                   try:
> -                    index = self.series.index(patch, start)
> +                    index = self.full_series.index(patch, start)
>                       fullpatch = self.full_series[index]
>                       del self.full_series[index]
>                   except ValueError:

Gilles, I wonder if this reverses whatever 88fc876a4833 did?

Could you please contribute a test for 88fc876a4833 - and perhaps 
suggest a better fix that also passes the test in this patch?

/Mads


More information about the Mercurial-devel mailing list