Skip to content
Snippets Groups Projects
Commit 6449813d3f9d authored by Georges Racinet's avatar Georges Racinet
Browse files

testhelpers: set_phase

It seems that the high level command in the `commands` module is
the one taking care of locks etc, so maybe it's better to go
through it.

We rewrap it in the way that's more usable than being forced
to provide a kwarg for each phase, hence the name `set_phase()`
parent d8b7d77b61d7
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@
commands,
hg,
node,
phases,
ui as uimod,
)
......@@ -119,3 +120,9 @@
def update(self, rev):
repo = self.repo
cmdutil.findcmd('update', commands.table)[1][0](repo.ui, repo, rev)
def set_phase(self, phase_name, revs, force=True):
repo = self.repo
opts = dict(force=force, rev=revs)
opts.update((phn, phn == phase_name) for phn in phases.cmdphasenames)
cmdutil.findcmd('phase', commands.table)[1][0](repo.ui, repo, **opts)
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