# HG changeset patch # User Steve Losh # Date 1247627605 14400 # Node ID 20882172679c07c8fc9eecb3fc73ed15f1d8fb46 # Parent 2b5e5ab15f3be181bb84c6c28dce8cb1f875d5d3 Add another example to the README. diff -r 2b5e5ab15f3b -r 20882172679c README --- a/README Tue Jul 14 22:44:00 2009 -0400 +++ b/README Tue Jul 14 23:13:25 2009 -0400 @@ -77,9 +77,26 @@ hg prompt "{ on {branch}}{ at {bookmark}}{status}" 2> /dev/null } - export PS1='\u at \h in \w$(hg_ps1) $ ' + 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: + + steve at myhost in ~/src/hg-prompt on default at feature-bookmark? + $ + +How about something a little more interesting? -`source ~/.bashrc` after to test it out. Make sure you're in a Mercurial repository or you won't see anything. + 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): + + [+1]-->hg-prompt/default-->[+2] at feature-bookmark + steve at myhost in ~/src/hg-prompt + $ Questions, Comments, Suggestions --------------------------------