Read about our upcoming Code of Conduct on this issue

Commit 3a2383c5 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

commands: upgrade pdiff and pstatus to full commands

Doing so make them appears in the documentation, improving their
discoverability.
parent f1bbc536602a
......@@ -127,6 +127,7 @@ Changelog
* compatibility with change in future 4.4 at this release date,
* obslog/log: improve verb used to describe and evolution,
* uncommit: add a --interractive option.
* pstatus/pdiff: update to full command. they now appears in the help.
* stack: improve display of interleaved topic
* stack: improve display of merge commit
......
......@@ -457,12 +457,41 @@ getrevs = obsolete.getrevs
### Useful alias
@eh.uisetup
def setupparentcommand(ui):
_alias, statuscmd = cmdutil.findcmd('status', commands.table)
pstatusopts = [o for o in statuscmd[1] if o[1] != 'rev']
@eh.command('pstatus', pstatusopts)
def pstatus(ui, repo, *args, **kwargs):
"""show status combining committed and uncommited changes
This show the combined status of the current working copy parent commit and
the uncommitted change in the working copy itself. The status displayed
match the content of the commit that a bare :hg:`amend` will creates.
See :hg:`help status` for details."""
kwargs['rev'] = ['.^']
return statuscmd[0](ui, repo, *args, **kwargs)
_alias, diffcmd = cmdutil.findcmd('diff', commands.table)
pdiffopts = [o for o in diffcmd[1] if o[1] != 'rev']
@eh.command('pdiff', pdiffopts)
def pdiff(ui, repo, *args, **kwargs):
"""show diff combining committed and uncommited changes
This show the combined diff of the current working copy parent commit and
the uncommitted change in the working copy itself. The diff displayed
match the content of the commit that a bare :hg:`amend` will creates.
See :hg:`help diff` for details."""
kwargs['rev'] = ['.^']
return diffcmd[0](ui, repo, *args, **kwargs)
@eh.uisetup
def _installalias(ui):
if ui.config('alias', 'pstatus', None) is None:
ui.setconfig('alias', 'pstatus', 'status --rev .^', 'evolve')
if ui.config('alias', 'pdiff', None) is None:
ui.setconfig('alias', 'pdiff', 'diff --rev .^', 'evolve')
if ui.config('alias', 'odiff', None) is None:
ui.setconfig('alias', 'odiff',
"diff --hidden --rev 'limit(precursors(.),1)' --rev .",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment