docs/wiki/quickstart/index.mdown @ d93fe1c921f9
- Add |anyapplied, |anyunapplied, |anycount, and |nondefault filters. - |anyapplied, |anyunapplied, |anycount, are filters to patch and when applied will make change the behavior so that if no patches are present then nothing will be printed - |nondefault is a filter for branch that will stop anything being printed if the branch is the default one. So only non-default branches are printed.
| author | Jason Harris <jasonh@wolfram.com> |
|---|---|
| date | Fri, 27 Nov 2009 13:24:49 +0100 |
| parents | f9616d40630b |
| children | 187b25ff6e1a |
Quick Start =========== This guide will get you up and running so you can put some useful information into your shell prompt. If you haven't already [installed][install] it, do that now. [install]: /hg-prompt/installation/ A Simple (But Useful) Prompt ---------------------------- Edit your `~/.bashrc` file to include something like this: :::bash hg_ps1() { hg prompt "{ on {branch}}{ at {bookmark}}{status}" 2> /dev/null } export PS1='\u at \h in \w$(hg_ps1)\n$ ' `source ~/.bashrc` after to test it out. Make sure you're in a Mercurial repository or you won't see anything. This little prompt will give you something like this: :::console steve at myhost in ~/src/hg-prompt on default at feature-bookmark? $ An Advanced Prompt ------------------ How about something a little more interesting? :::bash hg_ps1() { hg prompt "{[+{incoming|count}]-->}{root|basename}{/{branch}}{-->[+{outgoing|count}]}{ at {bookmark}}{status}" 2> /dev/null } export PS1='$(hg_ps1)\n\u at \h in \w\n$ ' And the result (this example assumes one incoming changeset and two outgoing): :::console [+1]-->hg-prompt/default-->[+2] at feature-bookmark steve at myhost in ~/src/hg-prompt $ Learn More ---------- From here you can take a look at the [full documentation][] to see all the interesting things `hg-prompt` can do. [full documentation]: /hg-prompt/documentation/