[PATCH 02 of 10] rebase: improve error message for empty --rev set

Mads Kiilerich mads at kiilerich.com
Wed Apr 23 08:46:47 CDT 2014


On 04/23/2014 03:17 PM, Julien Cristau wrote:
> On Sun, Jan 12, 2014 at 17:08:00 +0100, Mads Kiilerich wrote:
>
>> # HG changeset patch
>> # User Mads Kiilerich <madski at unity3d.com>
>> # Date 1384634789 18000
>> #      Sat Nov 16 15:46:29 2013 -0500
>> # Node ID d4c3a8ae89b0e2bf1e8a0bebb3fd6ba49ad1ac62
>> # Parent  e3be09b53038b39614eff4e57b47896cca103a31
>> rebase: improve error message for empty --rev set
>>
>> Before it just said 'nothing to rebase', now it also hints to the reason:
>> 'rev revset is empty'.

(A link or hash to the actual final revision would be helpful, 
especially when the patch is trimmed. 
http://selenic.com/hg/rev/a259f7b488ab )

> Hi,
>
> this changeset breaks my expectation (and the documentation) that hg
> rebase exits 1 if it has nothing to do.  I don't really understand why
> empty --rev set is any more of a hard error than other cases where
> there's nothing to rebase.

I would say that there is a difference between explicitly telling rebase 
what to rebase and letting it figure it out by itself. Explicitly giving 
rebase an empty set is more of a user error. 1 is for the case where the 
changesets we are considering already has been rebased. If the set is 
empty, we cannot really say that it already has been rebased.

> E.g. the code at
> http://hg.logilab.org/master/cubes/vcreview/file/6540bef1775a/test/unittest_rebase.py#l206
> relies on the previous behaviour, and explodes on 2.9.
>
> Any chance I can sell you on the patch below?

I think an abort is more correct and helpful and fixes an "issue". But 
it is thus also in a way a change of (undefined / incorrect) behaviour. 
Besides that, the patch and returning 1 is fine with me.

/Mads


More information about the Mercurial-devel mailing list