Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHGaa660c1203a9: rebase: do not bail on uncomitted changes if rebasing in-memory
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
durin42 |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/rebase.py (10 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Abandoned | phillco |
ms = mergemod.mergestate.read(repo) | ms = mergemod.mergestate.read(repo) | ||||
mergeutil.checkunresolved(ms) | mergeutil.checkunresolved(ms) | ||||
retcode = rbsrt._prepareabortorcontinue(abortf) | retcode = rbsrt._prepareabortorcontinue(abortf) | ||||
if retcode is not None: | if retcode is not None: | ||||
return retcode | return retcode | ||||
else: | else: | ||||
destmap = _definedestmap(ui, repo, destf, srcf, basef, revf, | destmap = _definedestmap(ui, repo, destf, srcf, basef, revf, | ||||
destspace=destspace) | destspace=destspace, | ||||
inmemory=opts['inmemory']) | |||||
retcode = rbsrt._preparenewrebase(destmap) | retcode = rbsrt._preparenewrebase(destmap) | ||||
if retcode is not None: | if retcode is not None: | ||||
return retcode | return retcode | ||||
tr = None | tr = None | ||||
dsguard = None | dsguard = None | ||||
singletr = ui.configbool('rebase', 'singletransaction') | singletr = ui.configbool('rebase', 'singletransaction') | ||||
if singletr: | if singletr: | ||||
tr = repo.transaction('rebase') | tr = repo.transaction('rebase') | ||||
with util.acceptintervention(tr): | with util.acceptintervention(tr): | ||||
if singletr: | if singletr: | ||||
dsguard = dirstateguard.dirstateguard(repo, 'rebase') | dsguard = dirstateguard.dirstateguard(repo, 'rebase') | ||||
with util.acceptintervention(dsguard): | with util.acceptintervention(dsguard): | ||||
rbsrt._performrebase(tr) | rbsrt._performrebase(tr) | ||||
rbsrt._finishrebase() | rbsrt._finishrebase() | ||||
def _definedestmap(ui, repo, destf=None, srcf=None, basef=None, revf=None, | def _definedestmap(ui, repo, destf=None, srcf=None, basef=None, revf=None, | ||||
destspace=None): | destspace=None, inmemory=False): | ||||
"""use revisions argument to define destmap {srcrev: destrev}""" | """use revisions argument to define destmap {srcrev: destrev}""" | ||||
if revf is None: | if revf is None: | ||||
revf = [] | revf = [] | ||||
# destspace is here to work around issues with `hg pull --rebase` see | # destspace is here to work around issues with `hg pull --rebase` see | ||||
# issue5214 for details | # issue5214 for details | ||||
if srcf and basef: | if srcf and basef: | ||||
raise error.Abort(_('cannot specify both a source and a base')) | raise error.Abort(_('cannot specify both a source and a base')) | ||||
if revf and basef: | if revf and basef: | ||||
raise error.Abort(_('cannot specify both a revision and a base')) | raise error.Abort(_('cannot specify both a revision and a base')) | ||||
if revf and srcf: | if revf and srcf: | ||||
raise error.Abort(_('cannot specify both a revision and a source')) | raise error.Abort(_('cannot specify both a revision and a source')) | ||||
if not inmemory: | |||||
cmdutil.checkunfinished(repo) | cmdutil.checkunfinished(repo) | ||||
cmdutil.bailifchanged(repo) | cmdutil.bailifchanged(repo) | ||||
if ui.configbool('commands', 'rebase.requiredest') and not destf: | if ui.configbool('commands', 'rebase.requiredest') and not destf: | ||||
raise error.Abort(_('you must specify a destination'), | raise error.Abort(_('you must specify a destination'), | ||||
hint=_('use: hg rebase -d REV')) | hint=_('use: hg rebase -d REV')) | ||||
dest = None | dest = None | ||||
if revf: | if revf: |