##// END OF EJS Templates
histedit: pass state to action functions
David Soria Parra -
r22982:52f10a4d default
parent child Browse files
Show More
@@ -326,7 +326,8 b' def collapse(repo, first, last, commitop'
326 326 editor=editor)
327 327 return repo.commitctx(new)
328 328
329 def pick(ui, repo, ctx, ha, opts):
329 def pick(ui, state, ha, opts):
330 repo, ctx = state.repo, state.parentctx
330 331 oldctx = repo[ha]
331 332 if oldctx.parents()[0] == ctx:
332 333 ui.debug('node %s unchanged\n' % ha)
@@ -348,7 +349,8 b' def pick(ui, repo, ctx, ha, opts):'
348 349 return new, [(oldctx.node(), (n,))]
349 350
350 351
351 def edit(ui, repo, ctx, ha, opts):
352 def edit(ui, state, ha, opts):
353 repo, ctx = state.repo, state.parentctx
352 354 oldctx = repo[ha]
353 355 hg.update(repo, ctx.node())
354 356 applychanges(ui, repo, oldctx, opts)
@@ -356,12 +358,14 b' def edit(ui, repo, ctx, ha, opts):'
356 358 _('Make changes as needed, you may commit or record as needed now.\n'
357 359 'When you are finished, run hg histedit --continue to resume.'))
358 360
359 def rollup(ui, repo, ctx, ha, opts):
361 def rollup(ui, state, ha, opts):
362 ctx = state.parentctx
360 363 rollupopts = opts.copy()
361 364 rollupopts['rollup'] = True
362 return fold(ui, repo, ctx, ha, rollupopts)
365 return fold(ui, state, ha, rollupopts)
363 366
364 def fold(ui, repo, ctx, ha, opts):
367 def fold(ui, state, ha, opts):
368 repo, ctx = state.repo, state.parentctx
365 369 oldctx = repo[ha]
366 370 hg.update(repo, ctx.node())
367 371 stats = applychanges(ui, repo, oldctx, opts)
@@ -417,11 +421,13 b' def finishfold(ui, repo, ctx, oldctx, ne'
417 421 replacements.append((ich, (n,)))
418 422 return repo[n], replacements
419 423
420 def drop(ui, repo, ctx, ha, opts):
424 def drop(ui, state, ha, opts):
425 repo, ctx = state.repo, state.parentctx
421 426 return ctx, [(repo[ha].node(), ())]
422 427
423 428
424 def message(ui, repo, ctx, ha, opts):
429 def message(ui, state, ha, opts):
430 repo, ctx = state.repo, state.parentctx
425 431 oldctx = repo[ha]
426 432 hg.update(repo, ctx.node())
427 433 stats = applychanges(ui, repo, oldctx, opts)
@@ -642,8 +648,7 b' def _histedit(ui, repo, *freeargs, **opt'
642 648 action, ha = state.rules.pop(0)
643 649 ui.debug('histedit: processing %s %s\n' % (action, ha))
644 650 actfunc = actiontable[action]
645 state.parentctx, replacement_ = actfunc(ui, repo, state.parentctx,
646 ha, opts)
651 state.parentctx, replacement_ = actfunc(ui, state, ha, opts)
647 652 state.replacements.extend(replacement_)
648 653
649 654 hg.update(repo, state.parentctx.node())
General Comments 0
You need to be logged in to leave comments. Login now