Skip to content
Snippets Groups Projects
Commit b63351f6a246 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

rebase: backed out changeset 2519994d25ca

In the process of fixing issue5610 in 4.2.2, we are trying to backout
cf8ad0e6c0e4. This changeset is making changes that depend on cf8ad0e6c0e4,
so we need to back it out first.

Since issue5610 is pretty serious regression and the next stable release is a
couple of days away, we are taking the backout route until we can figure out
something better to do.
parent 231690dba9b4
No related branches found
No related tags found
No related merge requests found
...@@ -475,24 +475,12 @@ ...@@ -475,24 +475,12 @@
editopt = True editopt = True
editor = cmdutil.getcommiteditor(edit=editopt, editform=editform) editor = cmdutil.getcommiteditor(edit=editopt, editform=editform)
revtoreuse = max(self.state) revtoreuse = max(self.state)
dsguard = dirstateguard.dirstateguard(repo, 'rebase') newnode = concludenode(repo, revtoreuse, p1, self.external,
try: commitmsg=commitmsg,
newnode = concludenode(repo, revtoreuse, p1, self.external, extrafn=_makeextrafn(self.extrafns),
commitmsg=commitmsg, editor=editor,
extrafn=_makeextrafn(self.extrafns), keepbranches=self.keepbranchesf,
editor=editor, date=self.date)
keepbranches=self.keepbranchesf,
date=self.date)
dsguard.close()
release(dsguard)
except error.InterventionRequired:
dsguard.close()
release(dsguard)
raise
except Exception:
release(dsguard)
raise
if newnode is None: if newnode is None:
newrev = self.target newrev = self.target
else: else:
...@@ -734,6 +722,5 @@ ...@@ -734,6 +722,5 @@
return retcode return retcode
with repo.transaction('rebase') as tr: with repo.transaction('rebase') as tr:
dsguard = dirstateguard.dirstateguard(repo, 'rebase')
try: try:
rbsrt._performrebase(tr) rbsrt._performrebase(tr)
...@@ -738,5 +725,3 @@ ...@@ -738,5 +725,3 @@
try: try:
rbsrt._performrebase(tr) rbsrt._performrebase(tr)
dsguard.close()
release(dsguard)
except error.InterventionRequired: except error.InterventionRequired:
...@@ -742,5 +727,3 @@ ...@@ -742,5 +727,3 @@
except error.InterventionRequired: except error.InterventionRequired:
dsguard.close()
release(dsguard)
tr.close() tr.close()
raise raise
...@@ -745,8 +728,5 @@ ...@@ -745,8 +728,5 @@
tr.close() tr.close()
raise raise
except Exception:
release(dsguard)
raise
rbsrt._finishrebase() rbsrt._finishrebase()
finally: finally:
release(lock, wlock) release(lock, wlock)
...@@ -874,12 +854,14 @@ ...@@ -874,12 +854,14 @@
'''Commit the wd changes with parents p1 and p2. Reuse commit info from rev '''Commit the wd changes with parents p1 and p2. Reuse commit info from rev
but also store useful information in extra. but also store useful information in extra.
Return node of committed revision.''' Return node of committed revision.'''
repo.setparents(repo[p1].node(), repo[p2].node()) dsguard = dirstateguard.dirstateguard(repo, 'rebase')
ctx = repo[rev] try:
if commitmsg is None: repo.setparents(repo[p1].node(), repo[p2].node())
commitmsg = ctx.description() ctx = repo[rev]
keepbranch = keepbranches and repo[p1].branch() != ctx.branch() if commitmsg is None:
extra = {'rebase_source': ctx.hex()} commitmsg = ctx.description()
if extrafn: keepbranch = keepbranches and repo[p1].branch() != ctx.branch()
extrafn(ctx, extra) extra = {'rebase_source': ctx.hex()}
if extrafn:
extrafn(ctx, extra)
...@@ -885,12 +867,12 @@ ...@@ -885,12 +867,12 @@
targetphase = max(ctx.phase(), phases.draft) targetphase = max(ctx.phase(), phases.draft)
overrides = {('phases', 'new-commit'): targetphase} overrides = {('phases', 'new-commit'): targetphase}
with repo.ui.configoverride(overrides, 'rebase'): with repo.ui.configoverride(overrides, 'rebase'):
if keepbranch: if keepbranch:
repo.ui.setconfig('ui', 'allowemptycommit', True) repo.ui.setconfig('ui', 'allowemptycommit', True)
# Commit might fail if unresolved files exist # Commit might fail if unresolved files exist
if date is None: if date is None:
date = ctx.date() date = ctx.date()
newnode = repo.commit(text=commitmsg, user=ctx.user(), newnode = repo.commit(text=commitmsg, user=ctx.user(),
date=date, extra=extra, editor=editor) date=date, extra=extra, editor=editor)
...@@ -896,6 +878,9 @@ ...@@ -896,6 +878,9 @@
repo.dirstate.setbranch(repo[newnode].branch()) repo.dirstate.setbranch(repo[newnode].branch())
return newnode dsguard.close()
return newnode
finally:
release(dsguard)
def rebasenode(repo, rev, p1, base, state, collapse, target): def rebasenode(repo, rev, p1, base, state, collapse, target):
'Rebase a single revision rev on top of p1 using base as merge ancestor' 'Rebase a single revision rev on top of p1 using base as merge ancestor'
......
...@@ -572,8 +572,6 @@ ...@@ -572,8 +572,6 @@
o 0: 'A' o 0: 'A'
$ hg rebase --keepbranches --collapse -s 1 -d 3 $ hg rebase --keepbranches --collapse -s 1 -d 3
transaction abort!
rollback completed
abort: cannot collapse multiple named branches abort: cannot collapse multiple named branches
[255] [255]
......
...@@ -270,8 +270,6 @@ ...@@ -270,8 +270,6 @@
$ hg rebase -s 6 -d 1 $ hg rebase -s 6 -d 1
rebasing 6:eea13746799a "G" rebasing 6:eea13746799a "G"
transaction abort!
rollback completed
abort: cannot use revision 6 as base, result would have 3 parents abort: cannot use revision 6 as base, result would have 3 parents
[255] [255]
$ hg rebase --abort $ hg rebase --abort
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment