How (is it possible) to create an hg command alias that runs multiple commands?

前端 未结 2 736
感动是毒
感动是毒 2021-01-01 09:46

I would like to define a Mercurial command alias in my hgrc file that invokes multiple commands. For example I would like to do something like the following:



        
2条回答
  •  遥遥无期
    2021-01-01 10:19

    I'm unable to comment on the previous answer, but for anyone else looking to do this on Windows, the following syntax worked for me, without having to use PowerShell or cygwin.

    giveup = !hg revert --all --no-backup && hg purge
    

    Alternatively, this version will execute the purge regardless of whether the revert was successful:

    giveup = !hg revert --all --no-backup & hg purge
    

    It is possible to string together more than two commands, for instance:

    shebase = !hg shelve && hg rebase && hg unshelve
    

提交回复
热议问题