Differences between revisions 1 and 46 (spanning 45 versions)
Revision 1 as of 2008-07-02 19:45:59
Size: 1957
Comment:
Revision 46 as of 2011-06-06 15:49:31
Size: 1349
Comment: was already included in RebaseExtension
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
When contributing to a project, sometimes there is the need to keep some
patches private, while keeping the whole repository up-to-date.
When contributing to a project, sometimes there is the need to keep some patches private, while keeping the whole repository up-to-date.
Line 6: Line 5:
In those cases it can be useful to "detach" the local changes, synchronize the
repository with the mainstream and then append the private changes on top of
the new remote changes. This operation is called ''rebase''.
In those cases it can be useful to "detach" the local changes, synchronize the repository with the mainstream and then append the private changes on top of the new remote changes. This operation is called ''rebase''.
Line 10: Line 7:
This feature is being implemented as part of SummerOfCode. In general, this extension allows to move revisions from a point to another, some common scenarios are shown in the section "Scenarios".

This feature has been implemented as part of [[SummerOfCode/2008]].
Line 13: Line 12:
The current code can be find [http://freehg.org/u/astratto/soc/ here] The current code can be found [[http://www.bitbucket.org/astratto/rebase-soc/|here]] and [[http://www.selenic.com/hg/index.cgi/file/73268e317ad3/hgext/rebase.py#l1|here]] ([[http://freehg.org/u/astratto/soc/|old repository]]). This project is distributed along with Mercurial release 1.1 as RebaseExtension.
Line 16: Line 15:
Line 19: Line 19:
 * mq patches handling
 * detect changes during interruptions
Line 20: Line 22:
== Usage examples ==
Let suppose we have the following repository

{{{#!dot
digraph {
  rankdir=LR
  node [shape=box]
  C1 -> C2 -> R1 -> R2
  C2 -> L1 -> L2
}
}}}

where C* are common revisions, R* changes in upstream and L* local changes.

== Simple case ==
We want to rebase L* on top of R2.

This can be achieved using:
{{{
   $ hg rebase L1 R2
}}}

Result:

{{{#!dot
digraph {
  rankdir=LR
  node [shape=box]
  C1 -> C2 -> R1 -> R2 -> l1 -> l2
}
}}}

== Dealing with conflicting merges ==
Sometimes could happen that some changes in L* conflicts with some changes in R*.
In these cases the extension will stop, store the current status and let user the ability to solve
the conflict on his own.

In event of interruption users have two choices:
 * abort
 * continue

=== Abort ===
An interrupted process can be aborted, thus restoring the repository to its original state, with:

{{{ hg rebase --abort }}}

=== Continue ===
The most common situation, however, is resuming an interrupted process and this can be done with:

{{{ hg rebase --continue }}}
Line 73: Line 25:
 * [http://code.google.com/soc/2008/hg/appinfo.html?csaid=EC7D811E53CA98EF GSoC's Abstract ]  * [[http://code.google.com/soc/2008/hg/appinfo.html?csaid=EC7D811E53CA98EF|GSoC's Abstract]]
* RebaseExtension

----
CategoryNewFeatures

Rebase Project

Introduction

When contributing to a project, sometimes there is the need to keep some patches private, while keeping the whole repository up-to-date.

In those cases it can be useful to "detach" the local changes, synchronize the repository with the mainstream and then append the private changes on top of the new remote changes. This operation is called rebase.

In general, this extension allows to move revisions from a point to another, some common scenarios are shown in the section "Scenarios".

This feature has been implemented as part of SummerOfCode/2008.

Current implementation

The current code can be found here and here (old repository). This project is distributed along with Mercurial release 1.1 as RebaseExtension.

Current version's features:

  • rebase both simple and complex cases
  • abort of an interrupted rebasing
  • resume of an interrupted rebasing
  • mq patches handling
  • detect changes during interruptions


CategoryNewFeatures

RebaseProject (last edited 2012-10-25 20:45:08 by mpm)