##// END OF EJS Templates
phases: prevent rebase to rebase immutable changeset.
Pierre-Yves David -
r15742:65df60a3 default
parent child Browse files
Show More
@@ -193,6 +193,11 b' def rebase(ui, repo, **opts):'
193 193 rebaseset = repo.revs('(children(ancestor(%r, %d)) & ::%r)::',
194 194 base, dest, base)
195 195
196 if rebaseset:
197 root = min(rebaseset)
198 else:
199 root = None
200
196 201 if not rebaseset:
197 202 repo.ui.debug('base is ancestor of destination')
198 203 result = None
@@ -202,6 +207,10 b' def rebase(ui, repo, **opts):'
202 207 _("can't remove original changesets with"
203 208 " unrebased descendants"),
204 209 hint=_('use --keep to keep original changesets'))
210 elif not keepf and not repo[root].mutable():
211 raise util.Abort(_("Can't rebase immutable changeset %s")
212 % repo[root],
213 hint=_('see hg help phases for details'))
205 214 else:
206 215 result = buildstate(repo, dest, rebaseset, detachf)
207 216
@@ -409,8 +409,8 b' class fncachestore(basicstore):'
409 409 self.fncache.rewrite(existing)
410 410
411 411 def copylist(self):
412 d = ('data dh fncache'
413 ' 00manifest.d 00manifest.i 00changelog.d 00changelog.i phaseroots')
412 d = ('data dh fncache phaseroots'
413 ' 00manifest.d 00manifest.i 00changelog.d 00changelog.i')
414 414 return (['requires', '00changelog.i'] +
415 415 ['store/' + f for f in d.split()])
416 416
@@ -6,6 +6,8 b''
6 6 > purge=
7 7 > rebase=
8 8 > transplant=
9 > [phases]
10 > publish=False
9 11 > [largefiles]
10 12 > minsize=2
11 13 > patterns=glob:**.dat
@@ -3,6 +3,9 b''
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 > [phases]
7 > publish=False
8 >
6 9 > [alias]
7 10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 11 > EOF
@@ -3,6 +3,9 b''
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 > [phases]
7 > publish=False
8 >
6 9 > [alias]
7 10 > tglog = log -G --template "{rev}: '{desc}' bookmarks: {bookmarks}\n"
8 11 > EOF
@@ -3,6 +3,9 b''
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 > [phases]
7 > publish=False
8 >
6 9 > [alias]
7 10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 11 > theads = heads --template "{rev}: '{desc}' {branches}\n"
@@ -3,6 +3,9 b''
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 > [phases]
7 > publish=False
8 >
6 9 > [alias]
7 10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 11 > EOF
@@ -3,6 +3,9 b''
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 > [phases]
7 > publish=False
8 >
6 9 > [alias]
7 10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 11 > EOF
@@ -3,6 +3,9 b''
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 > [phases]
7 > publish=False
8 >
6 9 > [alias]
7 10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 11 > EOF
@@ -3,6 +3,9 b''
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 > [phases]
7 > publish=False
8 >
6 9 > [alias]
7 10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 11 > EOF
@@ -3,6 +3,9 b''
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 > [phases]
7 > publish=False
8 >
6 9 > [alias]
7 10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 11 > EOF
@@ -3,6 +3,9 b''
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 > [phases]
7 > publish=False
8 >
6 9 > [alias]
7 10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 11 > EOF
@@ -7,6 +7,9 b' already has one local mq patch'
7 7 > rebase=
8 8 > mq=
9 9 >
10 > [phases]
11 > publish=False
12 >
10 13 > [alias]
11 14 > tglog = log -G --template "{rev}: '{desc}' tags: {tags}\n"
12 15 > EOF
@@ -3,6 +3,9 b''
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 > [phases]
7 > publish=False
8 >
6 9 > [alias]
7 10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 11 > EOF
@@ -3,6 +3,9 b''
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 > [phases]
7 > publish=False
8 >
6 9 > [alias]
7 10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 11 > EOF
@@ -3,6 +3,9 b''
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 > [phases]
7 > publish=False
8 >
6 9 > [alias]
7 10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 11 > EOF
@@ -269,6 +272,16 b' C onto A - rebase onto an ancestor:'
269 272 |/
270 273 o 0: 'A'
271 274
275
276 Check rebasing public changeset
277
278 $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6
279 $ hg rebase -d 5 -b 6
280 abort: Can't rebase immutable changeset e1c4361dd923
281 (see hg help phases for details)
282 [255]
283
284 $ hg rebase -d 5 -b 6 --keep
272 285 $ cd ..
273 286
274 287 Test for revset
General Comments 0
You need to be logged in to leave comments. Login now