hgext3rd/evolve/__init__.py
changeset 2953 b9aea9e48203
parent 2952 f1bbc536602a
child 3068 8adf34767c29
equal deleted inserted replaced
2952:f1bbc536602a 2953:b9aea9e48203
   456 
   456 
   457 
   457 
   458 ### Useful alias
   458 ### Useful alias
   459 
   459 
   460 @eh.uisetup
   460 @eh.uisetup
       
   461 def setupparentcommand(ui):
       
   462 
       
   463     _alias, statuscmd = cmdutil.findcmd('status', commands.table)
       
   464     pstatusopts = [o for o in statuscmd[1] if o[1] != 'rev']
       
   465 
       
   466     @eh.command('pstatus', pstatusopts)
       
   467     def pstatus(ui, repo, *args, **kwargs):
       
   468         """show status combining committed and uncommited changes
       
   469 
       
   470         This show the combined status of the current working copy parent commit and
       
   471         the uncommitted change in the working copy itself. The status displayed
       
   472         match the content of the commit that a bare :hg:`amend` will creates.
       
   473 
       
   474         See :hg:`help status` for details."""
       
   475         kwargs['rev'] = ['.^']
       
   476         return statuscmd[0](ui, repo, *args, **kwargs)
       
   477 
       
   478     _alias, diffcmd = cmdutil.findcmd('diff', commands.table)
       
   479     pdiffopts = [o for o in diffcmd[1] if o[1] != 'rev']
       
   480 
       
   481     @eh.command('pdiff', pdiffopts)
       
   482     def pdiff(ui, repo, *args, **kwargs):
       
   483         """show diff combining committed and uncommited changes
       
   484 
       
   485         This show the combined diff of the current working copy parent commit and
       
   486         the uncommitted change in the working copy itself. The diff displayed
       
   487         match the content of the commit that a bare :hg:`amend` will creates.
       
   488 
       
   489         See :hg:`help diff` for details."""
       
   490         kwargs['rev'] = ['.^']
       
   491         return diffcmd[0](ui, repo, *args, **kwargs)
       
   492 
       
   493 @eh.uisetup
   461 def _installalias(ui):
   494 def _installalias(ui):
   462     if ui.config('alias', 'pstatus', None) is None:
       
   463         ui.setconfig('alias', 'pstatus', 'status --rev .^', 'evolve')
       
   464     if ui.config('alias', 'pdiff', None) is None:
       
   465         ui.setconfig('alias', 'pdiff', 'diff --rev .^', 'evolve')
       
   466     if ui.config('alias', 'odiff', None) is None:
   495     if ui.config('alias', 'odiff', None) is None:
   467         ui.setconfig('alias', 'odiff',
   496         ui.setconfig('alias', 'odiff',
   468                      "diff --hidden --rev 'limit(precursors(.),1)' --rev .",
   497                      "diff --hidden --rev 'limit(precursors(.),1)' --rev .",
   469                      'evolve')
   498                      'evolve')
   470     if ui.config('alias', 'grab', None) is None:
   499     if ui.config('alias', 'grab', None) is None: