Mercurial > hg > mutable-history
changeset 445:52b5e14c63d5
obsolete: enforce pdiff and pstatus alias in the extension
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Tue, 07 Aug 2012 18:46:38 +0200 |
parents | aedb6b8ace86 |
children | 9d47474d2582 |
files | enable.sh hgext/obsolete.py tests/test-amend.t tests/test-evolve.t |
diffstat | 4 files changed, 23 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/enable.sh +++ b/enable.sh @@ -35,12 +35,6 @@ ### useful alias to check future amend result # equivalent to the qdiff command for mq -# diff -pdiff=diff --rev .^ - -# status -pstatus=status --rev .^ - # diff with the previous amend odiff=diff --rev 'limit(precursors(.),1)' --rev . EOF
--- a/hgext/obsolete.py +++ b/hgext/obsolete.py @@ -460,9 +460,16 @@ ##################################################################### -### Additional Utilities functions ### +### Additional Utilities ### ##################################################################### +@eh.uisetup +def _installalias(ui): + if ui.config('alias', 'pstatus', None) is None: + ui.setconfig('alias', 'pstatus', 'status --rev .^') + if ui.config('alias', 'pdiff', None) is None: + ui.setconfig('alias', 'pdiff', 'diff --rev .^') + def _precursors(repo, s): """Precursor of a changeset""" cs = set()
--- a/tests/test-amend.t +++ b/tests/test-amend.t @@ -58,6 +58,17 @@ $ echo a >> a $ hg ci -m changea $ echo a > a + $ hg status + M a + $ hg pstatus + $ hg diff + diff -r 2f97fe38810f a + --- a/a Thu Jan 01 00:00:00 1970 +0000 + +++ b/a * +0000 (glob) + @@ -1,2 +1,1 @@ + a + -a + $ hg pdiff $ hg ci -m reseta $ hg amend --change 2 abort: no updates found