Mercurial > hg
diff hgext/rebase.py @ 17615:9e2dc0d292cd
rebase: ensure rebase does not revive extinct revision
Here, we exclude hidden changesets from a rebase operation. If we
don't, a rewritten version of the hidden changesets will be created
by rebase. Those rewritten versions won't be hidden and will likely
conflict with other rewriting or revive pruned changeset. Moreover,
rewriting hidden revisions will surprise the user.
This change would not be necessary if changelog filtering were
already in core. But it's fairly cheap and helps to increase the
test-suite for such filtering.
Once changelog level filtering is added, hidden changes will be
automatically excluded or included according to the global --hidden
flags. Plain ignoring them is good enough for now.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Tue, 18 Sep 2012 23:32:42 +0200 |
parents | d417986e5e05 |
children | 7f5dab94e48c 848345a8d6ad |
line wrap: on
line diff
--- a/hgext/rebase.py Tue Sep 18 23:29:05 2012 +0200 +++ b/hgext/rebase.py Tue Sep 18 23:32:42 2012 +0200 @@ -184,7 +184,8 @@ rebaseset = repo.revs( '(children(ancestor(%ld, %d)) and ::(%ld))::', base, dest, base) - + # temporary top level filtering of extinct revisions + rebaseset = repo.revs('%ld - hidden()', rebaseset) if rebaseset: root = min(rebaseset) else: @@ -193,7 +194,7 @@ if not rebaseset: repo.ui.debug('base is ancestor of destination\n') result = None - elif not keepf and repo.revs('first(children(%ld) - %ld)', + elif not keepf and repo.revs('first(children(%ld) - %ld)-hidden()', rebaseset, rebaseset): raise util.Abort( _("can't remove original changesets with"