# HG changeset patch # User Steve Losh # Date 1258684553 18000 # Node ID 3db7e53f85e315294dd8e498ee8a20063b16c822 # Parent 7b4c795217554bffb13f4316c01584044dab326c hg-prompt: Update documentation. diff -r 7b4c79521755 -r 3db7e53f85e3 hg-prompt/documentation/keywords.html --- a/hg-prompt/documentation/keywords.html Thu Nov 19 21:35:21 2009 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ - - - - - - - - hg-prompt » Keywords - - - - - - - - - -
- - - - - - -

Keywords

-

There a number of keywords available. If you have any suggestions for more please let me know.

-

Some of the keywords support filters. These filters can be combined when it makes sense. If in doubt, try it!

- -

bookmark

-
-
Display the current bookmark (requires the bookmarks extension).
-
-

branch

-
-
Display the current branch.
-
-

node

-
-
-

Display the (full) changeset hash of the current parent.

-
-
|short
-
Display the hash as the short, 12-character form.
-
|merge
-
Display the hash of the changeset you're merging with.
-
-
-
-

patch

-
-
-

Display the topmost currently-applied patch (requires the mq -extension).

-
-
|count
-
Display the number of patches in the queue.
-
|applied
-
Display the number of currently applied patches in the queue.
-
|unapplied
-
Display the number of currently unapplied patches in the queue.
-
-
-
-

rev

-
-
-

Display the repository-local changeset number of the current parent.

-
-
|merge
-
Display the repository-local changeset number of the changeset you're -merging with.
-
-
-
-

root

-
-
-

Display the full path to the root of the current repository, without a -trailing slash.

-
-
|basename
-
Display the directory name of the root of the current repository. For -example, if the repository is in /home/u/myrepo then this keyword -would expand to myrepo.
-
-
-
-

status

-
-
-

Display ! if the repository has any changed/added/removed files, -otherwise ? if it has any untracked (but not ignored) files, otherwise -nothing.

-
-
|modified
-
Display ! if the current repository contains files that have been -modified, added, removed, or deleted, otherwise nothing.
-
|unknown
-
Display ? if the current repository contains untracked files, -otherwise nothing.
-
-
-
-

tags

-
-
-

Display the tags of the current parent, separated by a space.

-
-
|SEP
-
Display the tags of the current parent, separated by SEP.
-
-
-
-

task

-
-
Display the current task (requires the tasks extension).
-
-

tip

-
-
-

Display the repository-local changeset number of the current tip.

-
-
|node
-
Display the (full) changeset hash of the current tip.
-
|short
-
Display a short form of the changeset hash of the current tip (must be -used with the |node filter)
-
-
-
-

update

-
-
Display ^ if the current parent is not the tip of the current branch, -otherwise nothing. In effect, this lets you see if running hg update -would do something.
-
- - - - -
- - \ No newline at end of file diff -r 7b4c79521755 -r 3db7e53f85e3 hg-prompt/documentation/keywords/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hg-prompt/documentation/keywords/index.html Thu Nov 19 21:35:53 2009 -0500 @@ -0,0 +1,182 @@ + + + + + + + + hg-prompt » Keywords + + + + + + + + + +
+ + + + + + +

Keywords

+

There a number of keywords available. If you have any suggestions for more please let me know.

+

Some of the keywords support filters. These filters can be combined when it makes sense. If in doubt, try it!

+ +

bookmark

+
+
Display the current bookmark (requires the bookmarks extension).
+
+

branch

+
+
Display the current branch.
+
+

node

+
+
+

Display the (full) changeset hash of the current parent.

+
+
|short
+
Display the hash as the short, 12-character form.
+
|merge
+
Display the hash of the changeset you're merging with.
+
+
+
+

patch

+
+
+

Display the topmost currently-applied patch (requires the mq +extension).

+
+
|count
+
Display the number of patches in the queue.
+
|applied
+
Display the number of currently applied patches in the queue.
+
|unapplied
+
Display the number of currently unapplied patches in the queue.
+
+
+
+

rev

+
+
+

Display the repository-local changeset number of the current parent.

+
+
|merge
+
Display the repository-local changeset number of the changeset you're +merging with.
+
+
+
+

root

+
+
+

Display the full path to the root of the current repository, without a +trailing slash.

+
+
|basename
+
Display the directory name of the root of the current repository. For +example, if the repository is in /home/u/myrepo then this keyword +would expand to myrepo.
+
+
+
+

status

+
+
+

Display ! if the repository has any changed/added/removed files, +otherwise ? if it has any untracked (but not ignored) files, otherwise +nothing.

+
+
|modified
+
Display ! if the current repository contains files that have been +modified, added, removed, or deleted, otherwise nothing.
+
|unknown
+
Display ? if the current repository contains untracked files, +otherwise nothing.
+
+
+
+

tags

+
+
+

Display the tags of the current parent, separated by a space.

+
+
|SEP
+
Display the tags of the current parent, separated by SEP.
+
+
+
+

task

+
+
Display the current task (requires the tasks extension).
+
+

tip

+
+
+

Display the repository-local changeset number of the current tip.

+
+
|node
+
Display the (full) changeset hash of the current tip.
+
|short
+
Display a short form of the changeset hash of the current tip (must be +used with the |node filter)
+
+
+
+

update

+
+
Display ^ if the current parent is not the tip of the current branch, +otherwise nothing. In effect, this lets you see if running hg update +would do something.
+
+ + + + +
+ + \ No newline at end of file diff -r 7b4c79521755 -r 3db7e53f85e3 hg-prompt/documentation/keywords/list.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hg-prompt/documentation/keywords/list.html Thu Nov 19 21:35:53 2009 -0500 @@ -0,0 +1,64 @@ + + + + + + + + hg-prompt » ls /documentation/keywords + + + + + + + + + +
+ + + + + + +

ls /documentation/keywords

+ + + + + + + + + + +
+ + \ No newline at end of file diff -r 7b4c79521755 -r 3db7e53f85e3 hg-prompt/documentation/usage.html --- a/hg-prompt/documentation/usage.html Thu Nov 19 21:35:21 2009 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ - - - - - - - - hg-prompt » Usage - - - - - - - - - -
- - - - - - -

Usage

-

The hg prompt command takes a single string as an argument and outputs it. Here's a simple (and useless) example:

-
$ hg prompt "test"
-test
-
- - -

Keywords in curly braces can be used to output repository information:

-
$ hg prompt "currently on {branch}"
-currently on default
-
- - -

Keywords also have an extended form:

-
{optional text{branch}more optional text}
-
- - -

This form will output the text and the expanded keyword only if the keyword successfully expands. This can be useful for displaying extra text only if it's applicable:

-
$ hg prompt "currently on {branch} and at {bookmark}"
-currently on branch default and at
-
-$ hg prompt "currently on {branch} {and at {bookmark}}"
-currently on branch default
-
-$ hg bookmark my-book
-
-$ hg prompt "currently on {branch} {and at {bookmark}}"
-currently on branch default and at my-book
-
- - -

Take a look at the keywords documentation to see all the keywords hg-prompt supports.

- - - - -
- - \ No newline at end of file diff -r 7b4c79521755 -r 3db7e53f85e3 hg-prompt/documentation/usage/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hg-prompt/documentation/usage/index.html Thu Nov 19 21:35:53 2009 -0500 @@ -0,0 +1,86 @@ + + + + + + + + hg-prompt » Usage + + + + + + + + + +
+ + + + + + +

Usage

+

The hg prompt command takes a single string as an argument and outputs it. Here's a simple (and useless) example:

+
$ hg prompt "test"
+test
+
+ + +

Keywords in curly braces can be used to output repository information:

+
$ hg prompt "currently on {branch}"
+currently on default
+
+ + +

Keywords also have an extended form:

+
{optional text{branch}more optional text}
+
+ + +

This form will output the text and the expanded keyword only if the keyword successfully expands. This can be useful for displaying extra text only if it's applicable:

+
$ hg prompt "currently on {branch} and at {bookmark}"
+currently on branch default and at
+
+$ hg prompt "currently on {branch} {and at {bookmark}}"
+currently on branch default
+
+$ hg bookmark my-book
+
+$ hg prompt "currently on {branch} {and at {bookmark}}"
+currently on branch default and at my-book
+
+ + +

Take a look at the keywords documentation to see all the keywords hg-prompt supports.

+ + + + +
+ + \ No newline at end of file diff -r 7b4c79521755 -r 3db7e53f85e3 hg-prompt/documentation/usage/list.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hg-prompt/documentation/usage/list.html Thu Nov 19 21:35:53 2009 -0500 @@ -0,0 +1,64 @@ + + + + + + + + hg-prompt » ls /documentation/usage + + + + + + + + + +
+ + + + + + +

ls /documentation/usage

+ + + + + + + + + + +
+ + \ No newline at end of file diff -r 7b4c79521755 -r 3db7e53f85e3 hg-prompt/installation.html --- a/hg-prompt/installation.html Thu Nov 19 21:35:21 2009 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ - - - - - - - - hg-prompt » Installation - - - - - - - - - -
- - - - - - -

Installation

-

Installing hg-prompt requires Python 2.5+ and (obviously) Mercurial.

-

First, clone the repository:

-
$ hg clone http://bitbucket.org/sjl/hg-prompt/
-
- - -

Edit the [extensions] section in your ~/.hgrc file:

-
[extensions]
-prompt = (path to)/hg-prompt/prompt.py
-
- - -

Make sure everything is working:

-
$ hg prompt 'test'
-test
-
- - -

Take a look at the Quick Start guide to learn how to put some useful information into your shell prompt.

- - - - -
- - \ No newline at end of file diff -r 7b4c79521755 -r 3db7e53f85e3 hg-prompt/installation/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hg-prompt/installation/index.html Thu Nov 19 21:35:53 2009 -0500 @@ -0,0 +1,69 @@ + + + + + + + + hg-prompt » Installation + + + + + + + + + +
+ + + + + + +

Installation

+

Installing hg-prompt requires Python 2.5+ and (obviously) Mercurial.

+

First, clone the repository:

+
$ hg clone http://bitbucket.org/sjl/hg-prompt/
+
+ + +

Edit the [extensions] section in your ~/.hgrc file:

+
[extensions]
+prompt = (path to)/hg-prompt/prompt.py
+
+ + +

Make sure everything is working:

+
$ hg prompt 'test'
+test
+
+ + +

Take a look at the Quick Start guide to learn how to put some useful information into your shell prompt.

+ + + + +
+ + \ No newline at end of file diff -r 7b4c79521755 -r 3db7e53f85e3 hg-prompt/installation/list.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hg-prompt/installation/list.html Thu Nov 19 21:35:53 2009 -0500 @@ -0,0 +1,60 @@ + + + + + + + + hg-prompt » ls /installation + + + + + + + + + +
+ + + + + + +

ls /installation

+ + + + + + + + + + +
+ + \ No newline at end of file diff -r 7b4c79521755 -r 3db7e53f85e3 hg-prompt/quickstart.html --- a/hg-prompt/quickstart.html Thu Nov 19 21:35:21 2009 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ - - - - - - - - hg-prompt » Quick Start - - - - - - - - - -
- - - - - - -

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 it, do that now.

-

A Simple (But Useful) Prompt

-

Edit your ~/.bashrc file to include something like this:

-
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:

-
steve at myhost in ~/src/hg-prompt on default at feature-bookmark?
-$
-
- - -

An Advanced Prompt

-

How about something a little more interesting?

-
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
-$
-
- - -

Learn More

-

From here you can take a look at the full documentation to see all the interesting things hg-prompt can do.

- - - - -
- - \ No newline at end of file diff -r 7b4c79521755 -r 3db7e53f85e3 hg-prompt/quickstart/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hg-prompt/quickstart/index.html Thu Nov 19 21:35:53 2009 -0500 @@ -0,0 +1,87 @@ + + + + + + + + hg-prompt » Quick Start + + + + + + + + + +
+ + + + + + +

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 it, do that now.

+

A Simple (But Useful) Prompt

+

Edit your ~/.bashrc file to include something like this:

+
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:

+
steve at myhost in ~/src/hg-prompt on default at feature-bookmark?
+$
+
+ + +

An Advanced Prompt

+

How about something a little more interesting?

+
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
+$
+
+ + +

Learn More

+

From here you can take a look at the full documentation to see all the interesting things hg-prompt can do.

+ + + + +
+ + \ No newline at end of file diff -r 7b4c79521755 -r 3db7e53f85e3 hg-prompt/quickstart/list.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hg-prompt/quickstart/list.html Thu Nov 19 21:35:53 2009 -0500 @@ -0,0 +1,60 @@ + + + + + + + + hg-prompt » ls /quickstart + + + + + + + + + +
+ + + + + + +

ls /quickstart

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