Details
Details
- Reviewers
durin42 yuja - Group Reviewers
hg-reviewers - Commits
- rHGc4b769bc86da: py3: handle keyword arguments in hgext/histedit.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
durin42 | |
yuja |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
exchange, | exchange, | ||||
extensions, | extensions, | ||||
hg, | hg, | ||||
lock, | lock, | ||||
merge as mergemod, | merge as mergemod, | ||||
mergeutil, | mergeutil, | ||||
node, | node, | ||||
obsolete, | obsolete, | ||||
pycompat, | |||||
registrar, | registrar, | ||||
repair, | repair, | ||||
scmutil, | scmutil, | ||||
util, | util, | ||||
) | ) | ||||
pickle = util.pickle | pickle = util.pickle | ||||
release = lock.release | release = lock.release | ||||
Note that fold has its own separated logic because its handling is a bit | Note that fold has its own separated logic because its handling is a bit | ||||
different and not easily factored out of the fold method. | different and not easily factored out of the fold method. | ||||
""" | """ | ||||
phasemin = src.phase() | phasemin = src.phase() | ||||
def commitfunc(**kwargs): | def commitfunc(**kwargs): | ||||
overrides = {('phases', 'new-commit'): phasemin} | overrides = {('phases', 'new-commit'): phasemin} | ||||
with repo.ui.configoverride(overrides, 'histedit'): | with repo.ui.configoverride(overrides, 'histedit'): | ||||
extra = kwargs.get('extra', {}).copy() | extra = kwargs.get(r'extra', {}).copy() | ||||
extra['histedit_source'] = src.hex() | extra['histedit_source'] = src.hex() | ||||
kwargs['extra'] = extra | kwargs[r'extra'] = extra | ||||
return repo.commit(**kwargs) | return repo.commit(**kwargs) | ||||
return commitfunc | return commitfunc | ||||
def applychanges(ui, repo, ctx, opts): | def applychanges(ui, repo, ctx, opts): | ||||
"""Merge changeset from ctx (only) in the current working directory""" | """Merge changeset from ctx (only) in the current working directory""" | ||||
wcpar = repo.dirstate.parents()[0] | wcpar = repo.dirstate.parents()[0] | ||||
if ctx.p1().node() == wcpar: | if ctx.p1().node() == wcpar: | ||||
# edits are "in place" we do not need to make any merge, | # edits are "in place" we do not need to make any merge, | ||||
if defaultrev is not None: | if defaultrev is not None: | ||||
revs.append(defaultrev) | revs.append(defaultrev) | ||||
if len(revs) != 1: | if len(revs) != 1: | ||||
raise error.Abort( | raise error.Abort( | ||||
_('histedit requires exactly one ancestor revision')) | _('histedit requires exactly one ancestor revision')) | ||||
def _histedit(ui, repo, state, *freeargs, **opts): | def _histedit(ui, repo, state, *freeargs, **opts): | ||||
opts = pycompat.byteskwargs(opts) | |||||
goal = _getgoal(opts) | goal = _getgoal(opts) | ||||
revs = opts.get('rev', []) | revs = opts.get('rev', []) | ||||
rules = opts.get('commands', '') | rules = opts.get('commands', '') | ||||
state.keep = opts.get('keep', False) | state.keep = opts.get('keep', False) | ||||
_validateargs(ui, repo, state, freeargs, opts, goal, rules, revs) | _validateargs(ui, repo, state, freeargs, opts, goal, rules, revs) | ||||
# rebuild state | # rebuild state |