[PATCH STABLE] rebase: fix rebase with no common ancestors (issue4446)

Durham Goode durham at fb.com
Mon Nov 10 13:22:12 CST 2014


On 11/10/14 11:11 AM, Jordi Gutiérrez Hermoso wrote:
> On Mon, 2014-11-10 at 10:46 -0800, Durham Goode wrote:
>> # HG changeset patch
>> # User Durham Goode <durham at fb.com>
>> # Date 1415645082 28800
>> #      Mon Nov 10 10:44:42 2014 -0800
>> # Node ID 15e6fe3cd01beba4232780cdef715d47cc0b0df5
>> # Parent  2d54aa5397cdb1c697673ba10b7618d5ac25c69e
>> rebase: fix rebase with no common ancestors (issue4446)
> I was working on this, and your fix lgtm. Below I get more picky about
Sorry, I didn't check the irc to see if anyone was working on it.
> the test you added, but I guess it's ok as it is, if you don't think
> it needs anything more.
>
>> --- a/tests/test-rebase-parameters.t
>> +++ b/tests/test-rebase-parameters.t
>> @@ -468,3 +468,17 @@ Test --tool parameter:
>>     [255]
>>   
>>     $ cd ..
>> +
>> +No common ancestor
>> +
>> +  $ hg init separaterepo
>> +  $ cd separaterepo
>> +  $ touch a
>> +  $ hg commit -Aqm a
>> +  $ hg up -q null
>> +  $ touch b
>> +  $ hg commit -Aqm b
>> +  $ hg rebase -d 0
>> +  nothing to rebase from d7486e00c6f1 to 3903775176ed
>> +  [1]
>> +  $ cd ..
> Should we also test `hg rebase -b` for completeness? Or test anything
> that requires more than two commits?
The code path is covered by this case, so I don't think any other tests 
are necessary unless you can think of similar scenario that could cause 
problems.


More information about the Mercurial-devel mailing list