Abstract (was Re: [Google SOC] Rebase command)

Patrick Mézard pmezard at gmail.com
Wed Mar 26 16:22:04 CDT 2008


Stefano a écrit :
> Mercurial: Implementation of a rebasing feature – Tortarolo Stefano
>  
> Abstract
> I'm going to introduce a feature that allows to move sequence of revisions from
> one parent revision to another, a so called 'rebasing feature'. 
>  
> Rebasing can be useful in various situations: for instance, a user, who is 
> developing on a local branch, would like to keep his patches up-to-date with
> mainline stream. In this case it would be useful if he could be able to move
> his commits on top of the mainline stream's one.

A special case being working with foreign VCS like Subversion. The push part will rely on this ability to rebase user changes against the upstream repository before committing them. So once the basic rebase command works correctly, we make it available programmatically.
  
> The implementation will have to take in consideration several aspects, some of
> them Mercurial related, other regarding Rebasing in general. 
>  
> Mercurial, that is based on the idea of immutable history, doesn't allow
> revisions to be moved easily, so the simplest rebasing process could be
> somewhere tricky. It could require to have transient/inconsistent states that
> will be removed at the end of the process.

Right about transient, but you will never set the repository in an inconsistent state.

> More in general, a rebasing process could face some issues due to user
> interruption and/or file conflicts. In the latter case the process will stop
> and wait for user intervention, so it will be necessary to provide a way to
> resume an interrupted process; in event of interruption/abortion the repository
> must be left in a consistent state.
> Moreover, a rebasing process should check if there are redundant commits (read
> as 'already applied patches').

I am not sure what you mean in the last sentence. I don't really expect rebase to detect commits are "redundant". But you are right the repository state may change between interruption and rebase must ensure it can still keep going properly.

--
Patrick Mézard



More information about the Mercurial-devel mailing list