Details
Details
- Reviewers
yuja - Group Reviewers
hg-reviewers - Commits
- rHG3ebae3ec4664: py3: handle keyword arguments in hgext/uncommit.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
yuja |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
from mercurial import ( | from mercurial import ( | ||||
cmdutil, | cmdutil, | ||||
commands, | commands, | ||||
context, | context, | ||||
copies, | copies, | ||||
error, | error, | ||||
node, | node, | ||||
obsolete, | obsolete, | ||||
pycompat, | |||||
registrar, | registrar, | ||||
scmutil, | scmutil, | ||||
) | ) | ||||
cmdtable = {} | cmdtable = {} | ||||
command = registrar.command(cmdtable) | command = registrar.command(cmdtable) | ||||
configtable = {} | configtable = {} | ||||
def uncommit(ui, repo, *pats, **opts): | def uncommit(ui, repo, *pats, **opts): | ||||
"""uncommit part or all of a local changeset | """uncommit part or all of a local changeset | ||||
This command undoes the effect of a local commit, returning the affected | This command undoes the effect of a local commit, returning the affected | ||||
files to their uncommitted state. This means that files modified or | files to their uncommitted state. This means that files modified or | ||||
deleted in the changeset will be left unchanged, and so will remain | deleted in the changeset will be left unchanged, and so will remain | ||||
modified in the working directory. | modified in the working directory. | ||||
""" | """ | ||||
opts = pycompat.byteskwargs(opts) | |||||
with repo.wlock(), repo.lock(): | with repo.wlock(), repo.lock(): | ||||
wctx = repo[None] | wctx = repo[None] | ||||
if not pats and not repo.ui.configbool('experimental', | if not pats and not repo.ui.configbool('experimental', | ||||
'uncommitondirtywdir'): | 'uncommitondirtywdir'): | ||||
cmdutil.bailifchanged(repo) | cmdutil.bailifchanged(repo) | ||||
if wctx.parents()[0].node() == node.nullid: | if wctx.parents()[0].node() == node.nullid: |