Mercurial > hg
changeset 15742:65df60a3f96b
phases: prevent rebase to rebase immutable changeset.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Tue, 27 Dec 2011 00:11:22 +0100 |
parents | 60344b83e442 |
children | e251250ac20b |
files | hgext/rebase.py mercurial/store.py tests/test-largefiles.t tests/test-rebase-abort.t tests/test-rebase-bookmarks.t tests/test-rebase-cache.t tests/test-rebase-check-restore.t tests/test-rebase-collapse.t tests/test-rebase-conflicts.t tests/test-rebase-detach.t tests/test-rebase-interruptions.t tests/test-rebase-issue-noparam-single-rev.t tests/test-rebase-mq-skip.t tests/test-rebase-named-branches.t tests/test-rebase-parameters.t tests/test-rebase-scenario-global.t |
diffstat | 16 files changed, 62 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/rebase.py Mon Dec 26 13:48:31 2011 +0100 +++ b/hgext/rebase.py Tue Dec 27 00:11:22 2011 +0100 @@ -193,6 +193,11 @@ rebaseset = repo.revs('(children(ancestor(%r, %d)) & ::%r)::', base, dest, base) + if rebaseset: + root = min(rebaseset) + else: + root = None + if not rebaseset: repo.ui.debug('base is ancestor of destination') result = None @@ -202,6 +207,10 @@ _("can't remove original changesets with" " unrebased descendants"), hint=_('use --keep to keep original changesets')) + elif not keepf and not repo[root].mutable(): + raise util.Abort(_("Can't rebase immutable changeset %s") + % repo[root], + hint=_('see hg help phases for details')) else: result = buildstate(repo, dest, rebaseset, detachf)
--- a/mercurial/store.py Mon Dec 26 13:48:31 2011 +0100 +++ b/mercurial/store.py Tue Dec 27 00:11:22 2011 +0100 @@ -409,8 +409,8 @@ self.fncache.rewrite(existing) def copylist(self): - d = ('data dh fncache' - ' 00manifest.d 00manifest.i 00changelog.d 00changelog.i phaseroots') + d = ('data dh fncache phaseroots' + ' 00manifest.d 00manifest.i 00changelog.d 00changelog.i') return (['requires', '00changelog.i'] + ['store/' + f for f in d.split()])
--- a/tests/test-largefiles.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-largefiles.t Tue Dec 27 00:11:22 2011 +0100 @@ -6,6 +6,8 @@ > purge= > rebase= > transplant= + > [phases] + > publish=False > [largefiles] > minsize=2 > patterns=glob:**.dat
--- a/tests/test-rebase-abort.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-abort.t Tue Dec 27 00:11:22 2011 +0100 @@ -3,6 +3,9 @@ > graphlog= > rebase= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' {branches}\n" > EOF
--- a/tests/test-rebase-bookmarks.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-bookmarks.t Tue Dec 27 00:11:22 2011 +0100 @@ -3,6 +3,9 @@ > graphlog= > rebase= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' bookmarks: {bookmarks}\n" > EOF
--- a/tests/test-rebase-cache.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-cache.t Tue Dec 27 00:11:22 2011 +0100 @@ -3,6 +3,9 @@ > graphlog= > rebase= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' {branches}\n" > theads = heads --template "{rev}: '{desc}' {branches}\n"
--- a/tests/test-rebase-check-restore.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-check-restore.t Tue Dec 27 00:11:22 2011 +0100 @@ -3,6 +3,9 @@ > graphlog= > rebase= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' {branches}\n" > EOF
--- a/tests/test-rebase-collapse.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-collapse.t Tue Dec 27 00:11:22 2011 +0100 @@ -3,6 +3,9 @@ > graphlog= > rebase= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' {branches}\n" > EOF
--- a/tests/test-rebase-conflicts.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-conflicts.t Tue Dec 27 00:11:22 2011 +0100 @@ -3,6 +3,9 @@ > graphlog= > rebase= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' {branches}\n" > EOF
--- a/tests/test-rebase-detach.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-detach.t Tue Dec 27 00:11:22 2011 +0100 @@ -3,6 +3,9 @@ > graphlog= > rebase= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' {branches}\n" > EOF
--- a/tests/test-rebase-interruptions.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-interruptions.t Tue Dec 27 00:11:22 2011 +0100 @@ -3,6 +3,9 @@ > graphlog= > rebase= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' {branches}\n" > EOF
--- a/tests/test-rebase-issue-noparam-single-rev.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-issue-noparam-single-rev.t Tue Dec 27 00:11:22 2011 +0100 @@ -3,6 +3,9 @@ > graphlog= > rebase= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' {branches}\n" > EOF
--- a/tests/test-rebase-mq-skip.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-mq-skip.t Tue Dec 27 00:11:22 2011 +0100 @@ -7,6 +7,9 @@ > rebase= > mq= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' tags: {tags}\n" > EOF
--- a/tests/test-rebase-named-branches.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-named-branches.t Tue Dec 27 00:11:22 2011 +0100 @@ -3,6 +3,9 @@ > graphlog= > rebase= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' {branches}\n" > EOF
--- a/tests/test-rebase-parameters.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-parameters.t Tue Dec 27 00:11:22 2011 +0100 @@ -3,6 +3,9 @@ > graphlog= > rebase= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' {branches}\n" > EOF
--- a/tests/test-rebase-scenario-global.t Mon Dec 26 13:48:31 2011 +0100 +++ b/tests/test-rebase-scenario-global.t Tue Dec 27 00:11:22 2011 +0100 @@ -3,6 +3,9 @@ > graphlog= > rebase= > + > [phases] + > publish=False + > > [alias] > tglog = log -G --template "{rev}: '{desc}' {branches}\n" > EOF @@ -269,6 +272,16 @@ |/ o 0: 'A' + +Check rebasing public changeset + + $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6 + $ hg rebase -d 5 -b 6 + abort: Can't rebase immutable changeset e1c4361dd923 + (see hg help phases for details) + [255] + + $ hg rebase -d 5 -b 6 --keep $ cd .. Test for revset