[PATCH STABLE] rebase: fix rebase aborts when tip^ is public (issue4082)

Martin Geisler martin at geisler.net
Wed Nov 6 01:52:39 CST 2013


Durham Goode <durham at fb.com> writes:

> On 11/4/13 10:40 PM, "Martin Geisler" <martin at geisler.net> wrote:
>
>>Durham Goode <durham at fb.com> writes:
>>
>>>--- a/mercurial/phases.py
>>> +++ b/mercurial/phases.py
>>> @@ -185,6 +185,8 @@
>>>          # be replaced without us being notified.
>>>          if rev == nullrev:
>>>              return public
>>> +        if rev < nullrev:
>>> +            raise error.RepoLookupError(_('cannot lookup negative
>>>revision'))
>>
>> Will some earlier part of the code turn -2 into a positive revision
>> number before we hit this? I would like 'hg phase -r -2' to keep
>> working.
>
>
> hg phase -r -2 will continue to work. The command line revset resolver
> turns that -2 into a positive rev before passing it to the actual
> command. This function in phases.py should never, ever get a negative
> number because it's indexing into an array that doesn't have the
> nullrev in it, so a negative number will always be off by one and
> return the wrong phase in this function.

Super, thanks for checking that for me!

-- 
Martin Geisler


More information about the Mercurial-devel mailing list