Mercurial > hg
comparison hgext/rebase.py @ 28429:a47881680402
rebase: turn rebaseskipobsolete on by default
Consider the following use case. User has a set of commits he wants to rebase
onto some destination. Some of the commits in the set are already rebased
and their new versions are now among the ancestors of destination. Traditional
rebase behavior would make the rebase and effectively try to apply older
versions of these commits on top of newer versions, like this:
a` --> b --> a`
(where both 'a`' and 'a``' are rebased versions of 'a')
This is not desired since 'b' might have made changes to 'a`' which can now
result in merge conflicts. We can avoid these merge conflicts since we know
that 'a``' is an older version of 'a`', so we don't even need to put it on top
of 'b'. Rebaseskipobsolete allows us to do exactly that.
Another undesired effect of a pure rebase is that now 'a`' and 'a``' are both
successors to 'a' which is a divergence. We don't want that and not rebasing
'a' the second time allows to avoid it.
This was not enabled by default initially because we wanted to have some more
experience with it. After months of painless usages in multiple places, we are
confident enough to turn it on my default.
author | Kostia Balytskyi <ikostia@fb.com> |
---|---|
date | Wed, 09 Mar 2016 08:08:27 -0800 |
parents | dcb4209bd30d |
children | 6c4d23fe611c |
comparison
equal
deleted
inserted
replaced
28428:6a4a4ca21907 | 28429:a47881680402 |
---|---|
295 _("can't remove original changesets with" | 295 _("can't remove original changesets with" |
296 " unrebased descendants"), | 296 " unrebased descendants"), |
297 hint=_('use --keep to keep original changesets')) | 297 hint=_('use --keep to keep original changesets')) |
298 | 298 |
299 obsoletenotrebased = {} | 299 obsoletenotrebased = {} |
300 if ui.configbool('experimental', 'rebaseskipobsolete'): | 300 if ui.configbool('experimental', 'rebaseskipobsolete', |
301 default=True): | |
301 rebasesetrevs = set(rebaseset) | 302 rebasesetrevs = set(rebaseset) |
302 rebaseobsrevs = _filterobsoleterevs(repo, rebasesetrevs) | 303 rebaseobsrevs = _filterobsoleterevs(repo, rebasesetrevs) |
303 obsoletenotrebased = _computeobsoletenotrebased(repo, | 304 obsoletenotrebased = _computeobsoletenotrebased(repo, |
304 rebaseobsrevs, | 305 rebaseobsrevs, |
305 dest) | 306 dest) |