[PATCH 1 of 3] rebase: add a 'revtodo' constant to

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Dec 4 09:15:18 CST 2014



On 12/02/2014 05:02 PM, Mads Kiilerich wrote:
> On 12/02/2014 09:32 PM, Pierre-Yves David wrote:
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david at fb.com>
>> # Date 1417542380 28800
>> #      Tue Dec 02 09:46:20 2014 -0800
>> # Node ID 0e50f872225ac6082796871f236c05c2e51a4d25
>> # Parent  6b2953028561f9b49fb79e975d68e85e8666f13a
>> rebase: add a 'revtodo' constant to
>
> to what?
>
>> The state mapping is using '-1' to mark revision that have not been
>> rebased yet.
>> We introduce and use a constant for that purpose. This will help
>> emphasising the
>> fact the value mean something else than nullrev.
>>
>> diff --git a/hgext/rebase.py b/hgext/rebase.py
>> --- a/hgext/rebase.py
>> +++ b/hgext/rebase.py
>
>
>> @@ -808,11 +809,11 @@ def inrebase(repo, originalwd, state):
>>       return False
>>   def abort(repo, originalwd, target, state):
>>       'Restore the repository to its original state'
>> -    dstates = [s for s in state.values() if s > nullrev]
>> +    dstates = [s for s in state.values() if s > revtodo]
>
> I am not sure revtodo is more correct here than nullrev. If you don't
> want to rely on nullrev=0-1 then I think it would be more correct to use
>  >= 0 to filter out all normal revision numbers. That is also what is
> used in clearrebased.

Good point, fixed it in a V2.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list