# HG changeset patch # User Steve Losh # Date 1259738019 18000 # Node ID 36f30b33ea49580f1546a913b5b1d8113759280e # Parent c8cf11aa648c89779ec1e67374719a11e301bbce hg-prompt: Update documentation. diff -r c8cf11aa648c -r 36f30b33ea49 hg-prompt/documentation/index.html --- a/hg-prompt/documentation/index.html Fri Nov 27 13:48:20 2009 -0500 +++ b/hg-prompt/documentation/index.html Wed Dec 02 02:13:39 2009 -0500 @@ -40,6 +40,8 @@

How the hg prompt command can be used.

Keywords

Keywords available to use with the command.

+

Sample Prompts

+

Some sample prompts to get you started.

diff -r c8cf11aa648c -r 36f30b33ea49 hg-prompt/documentation/list.html --- a/hg-prompt/documentation/list.html Fri Nov 27 13:48:20 2009 -0500 +++ b/hg-prompt/documentation/list.html Wed Dec 02 02:13:39 2009 -0500 @@ -56,6 +56,14 @@ + + samples/ + + + + + + usage/ diff -r c8cf11aa648c -r 36f30b33ea49 hg-prompt/documentation/samples/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hg-prompt/documentation/samples/index.html Wed Dec 02 02:13:39 2009 -0500 @@ -0,0 +1,105 @@ + + + + + + + + hg-prompt » Sample Prompts + + + + + + + + + + + + + +
+ + +

Sample Prompts

+

hg-prompt supports many keywords, but you probably don't want to use them +all at once. Which keywords you'll find useful depends on the workflow(s) you +commonly use.

+

Here are some example prompts to get you started.

+

A Basic Prompt

+

A very simple prompt could tell you:

+ +

To get a prompt like this you could add this to your ~/.bashrc file:

+
export PS1='\u in \w`hg prompt "{on {branch}}{status}{update}" 2>/dev/null` $'
+
+ + +

The result would look something like this:

+
username in ~/src $ cd project
+username in ~/src/project on feature-branch $ touch sample
+username in ~/src/project on feature-branch? $ hg add sample
+username in ~/src/project on feature-branch! $ hg commit -m 'Add a file.'
+username in ~/src/project on feature-branch $ hg update default
+username in ~/src/project on default $ hg update 0
+username in ~/src/project on default^ $
+
+ + +

The 2>/dev/null part of the prompt command prevents errors from showing when +you're not currently in a Mercurial repository.

+

The keywords ({branch}, {status} and {update}) display the relevant +information.

+

The extra text in the {branch} keyword will only display if a branch exists, +so you won't see the word "on" if you're not in a repository.

+

A More Compact Basic Prompt

+

Some people prefer a smaller, less obtrusive prompt. To get that kind of +prompt you can omit some of the less important text:

+
export PS1='\w`hg prompt "[{branch}{status}{update}]" 2>/dev/null` $'
+
+ + +

That will give you something like this:

+
~/src $ cd project
+~/src/project[feature-branch] $ touch sample
+~/src/project[feature-branch?] $ hg add sample
+~/src/project[feature-branch!] $ hg commit -m 'Add a file.'
+~/src/project[feature-branch] $ hg update default
+~/src/project[default] $ hg update 0
+~/src/project[default^] $
+
+ + +
+ + + + \ No newline at end of file diff -r c8cf11aa648c -r 36f30b33ea49 hg-prompt/documentation/samples/list.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hg-prompt/documentation/samples/list.html Wed Dec 02 02:13:39 2009 -0500 @@ -0,0 +1,66 @@ + + + + + + + + hg-prompt » ls /documentation/samples + + + + + + + + + + + + + +
+ + +

ls /documentation/samples

+ + + + + + + + +
+ + + + \ No newline at end of file