# HG changeset patch # User Steve Losh # Date 1258689107 18000 # Node ID fd8097ccb5c12aea18df45c864008e930287201a # Parent 3db7e53f85e315294dd8e498ee8a20063b16c822 hg-prompt: Update documentation. diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/.DS_Store Binary file hg-prompt/.DS_Store has changed diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/documentation/index.html --- a/hg-prompt/documentation/index.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/documentation/index.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
- - + +
+

Documentation

Usage

@@ -42,13 +42,15 @@

Keywords available to use with the command.

- +
+ -
\ No newline at end of file diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/documentation/keywords/index.html --- a/hg-prompt/documentation/keywords/index.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/documentation/keywords/index.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
- - + +
+

Keywords

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

@@ -47,7 +47,9 @@
  • Keywords
    • bookmark
    • branch
    • +
    • incoming
    • node
    • +
    • outgoing
    • patch
    • rev
    • root
    • @@ -68,6 +70,22 @@
      Display the current branch.
      +

      incoming

      +
      +
      +

      Display nothing, but if the default path contains incoming changesets the +extra text will be expanded.

      +

      For example: {incoming changes{incoming}} will expand to +incoming changes if there are changes, otherwise nothing.

      +

      Checking for incoming changesets is an expensive operation, so hg-prompt +will cache the results in .hg/prompt/cache/ and refresh them every 15 +minutes.

      +
      +
      |count
      +
      Display the number of incoming changesets (if greater than 0).
      +
      +
      +

      node

      @@ -80,6 +98,22 @@
      +

      outgoing

      +
      +
      +

      Display nothing, but if the current repository contains outgoing +changesets (to default) the extra text will be expanded.

      +

      For example: {outgoing changes{outgoing}} will expand to +outgoing changes if there are changes, otherwise nothing.

      +

      Checking for outgoing changesets is an expensive operation, so hg-prompt +will cache the results in .hg/prompt/cache/ and refresh them every 15 +minutes.

      +
      +
      |count
      +
      Display the number of outgoing changesets (if greater than 0).
      +
      +
      +

      patch

      @@ -170,13 +204,15 @@
      - +
  • + -
    \ No newline at end of file diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/documentation/keywords/list.html --- a/hg-prompt/documentation/keywords/list.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/documentation/keywords/list.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    ls /documentation/keywords

    @@ -52,13 +52,15 @@ - +
    + -
    \ No newline at end of file diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/documentation/list.html --- a/hg-prompt/documentation/list.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/documentation/list.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    ls /documentation

    @@ -70,13 +70,15 @@ - +
    + -
    \ No newline at end of file diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/documentation/usage/index.html --- a/hg-prompt/documentation/usage/index.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/documentation/usage/index.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    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
    +
    $ hg prompt "test"
    +test
     

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

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

    Keywords also have an extended form:

    -
    {optional text{branch}more optional text}
    +
    {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 and at
     
    -$ hg prompt "currently on {branch} {and at {bookmark}}"
    -currently on branch default
    +$ hg prompt "currently on {branch} {and at {bookmark}}"
    +currently on branch default
     
    -$ hg bookmark my-book
    +$ hg bookmark my-book
     
    -$ hg prompt "currently on {branch} {and at {bookmark}}"
    -currently on branch default and at 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 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/documentation/usage/list.html --- a/hg-prompt/documentation/usage/list.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/documentation/usage/list.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    ls /documentation/usage

    @@ -52,13 +52,15 @@ - +
    + -
    \ No newline at end of file diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/index.html --- a/hg-prompt/index.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/index.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    hg-prompt

    hg-prompt is a Mercurial extension that adds an 'hg prompt' command to Mercurial for viewing repository information. It's designed to be used in a shell prompt.

    @@ -40,13 +40,15 @@

    My bash prompt while using hg-prompt.

    - +
    + -
    \ No newline at end of file diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/installation/index.html --- a/hg-prompt/installation/index.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/installation/index.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    Installation

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

    First, clone the repository:

    -
    $ hg clone http://bitbucket.org/sjl/hg-prompt/
    +
    $ hg clone http://bitbucket.org/sjl/hg-prompt/
     
    @@ -49,21 +49,23 @@

    Make sure everything is working:

    -
    $ hg prompt 'test'
    -test
    +
    $ 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 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/installation/list.html --- a/hg-prompt/installation/list.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/installation/list.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    ls /installation

    @@ -48,13 +48,15 @@ - +
    + -
    \ No newline at end of file diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/list.html --- a/hg-prompt/list.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/list.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    ls /

    @@ -82,13 +82,15 @@ - +
    + -
    \ No newline at end of file diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/media/css/index.html --- a/hg-prompt/media/css/index.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/media/css/index.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    ls /media/css

    @@ -55,7 +55,7 @@ - +
    2K3K layout.css @@ -94,13 +94,15 @@ - + + - \ No newline at end of file diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/media/css/layout.css --- a/hg-prompt/media/css/layout.css Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/media/css/layout.css Thu Nov 19 22:51:47 2009 -0500 @@ -1,79 +1,104 @@ body, html { - background-color: #f6f6f6; + background-color: #226F89; margin: 0; padding: 0; } div#breadcrumbs { - border-bottom: 4px dashed #f6f6f6; - margin: 0 -1.2em; - padding: 0.3em 1.4em 0.3em 1.4em; + border-bottom: 4px dashed #265565; + border-left: 1px solid #265565; + border-right: 1px solid #265565; + margin: 0 auto; + padding: 0.5em 1.5em; + background-color: #fff; + width: 55em; } - div#breadcrumbs p { margin-bottom: 0.2em; } - div#content { background-color: #fff; height: 100%; margin: 0 auto; overflow: hidden; - padding: 0 1.2em 1.2em 1.2em; - width: 700px; + padding: 1em 1.5em 1.5em 1.5em; + width: 55em; + border-left: 1px solid #265565; + border-right: 1px solid #265565; } h1 { margin: 0.3em 0; padding: 0.1em 0; } - h2, h3, h4, h5, h6 { margin-top: 1em; margin-bottom: 0.4em; } - p, ul, blockquote { line-height: 1.8em; margin-top: 0; margin-bottom: 1em; } +a { + color: #133C4C; +} +a:hover { + color: #F14800; +} -p#footer { - border-top: 1px solid #999; - font-size: 0.7em; - margin-bottom: 0; - padding: 0.7em 0; +div#footer { + background-color: #fff; + border: 1px solid #265565; + border-top: 4px dashed #265565; + width: 55em; + padding: 1em 1.5em; + margin: 0 auto; + margin-bottom: 3em; text-align: center; + color: #666; +} +div#footer p { + margin: 0; + padding: 0; } ul { padding-left: 1.5em; } - ul li { list-style-type: disc; margin-left: 1.5em; margin-top: 0.4em; } +div.toc ul { + padding: 0; +} +div.toc ul li { + list-style-type: none; + margin: 0; +} +div.toc > ul > li { + list-style-type: none; + margin: 0; +} +div.toc > ul ul { + margin: 0 3em; +} + code { background-color: #f6f6f6; border: 1px solid #999; - border-left: none; - border-right: none; - padding-left: 2px; - padding-right: 2px; + padding: 2px; white-space: nowrap; } - pre code { border: none; padding: 0; background: none; white-space: pre-wrap; } - a code { background: none; border: none; @@ -81,7 +106,6 @@ padding: 0; text-decoration: inherit; } - a.code { background-color: #3f3f3f; } @@ -90,29 +114,32 @@ font-weight: bold; margin-top: 1em; } - dd { line-height: 1.8em; margin-left: 1.5em; } - blockquote p { margin: 0; } +img { + background-color: #f6f6f6; + border: 1px solid #999; + padding: 1em; + display: block; + margin: 0 auto; +} + table { margin: 1em; } - table thead { background-color: #f6f6f6; } - table thead th { border: 1px solid #999; padding: 0.5em 1em; } - table tbody tr td { border: 1px solid #999; padding: 0.5em 1em; @@ -121,26 +148,21 @@ pre, blockquote, table.codehilitetable { background-color: #f6f6f6; border: 1px solid #999; - border-left: none; - border-right: none; display: block; line-height: 1.5em; - margin-left: 1.2em; - margin-right: 1em; + margin-left: 1.5em; + margin-right: 1.5em; padding: 0.5em; padding-left: 1em; } - pre, table.codehilitetable { margin-bottom: 1em; } - table.codehilitetable div.linenodiv { border-right: 1px solid #ccc; margin-right: 1em; padding-right: 1em; } - table.codehilitetable pre { background: none; border: none; @@ -152,16 +174,13 @@ border-top: 1px solid #999; border-bottom: 1px solid #999; } - table tr td.name a { display: block; padding: 0.5em 1em; } - table tr td.name a:hover { background-color: #f6f6f6; } - table tr td.size { padding: 0.5em 1em; width: 40px; diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/media/css/list.html --- a/hg-prompt/media/css/list.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/media/css/list.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    ls /media/css

    @@ -55,7 +55,7 @@ - +
    2K3K layout.css @@ -94,13 +94,15 @@ - + + - \ No newline at end of file diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/media/css/typography.css --- a/hg-prompt/media/css/typography.css Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/media/css/typography.css Thu Nov 19 22:51:47 2009 -0500 @@ -33,14 +33,9 @@ } a { - color: #ba0000; text-decoration: none; } -a:hover { - color: #e34400; -} - table#files a:hover, table#subdirs a:hover, table#pages a:hover { color: #a00000; } diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/media/index.html --- a/hg-prompt/media/index.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/media/index.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    ls /media

    @@ -62,13 +62,15 @@ - +
    + -
    \ No newline at end of file diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/media/list.html --- a/hg-prompt/media/list.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/media/list.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    ls /media

    @@ -62,13 +62,15 @@ - +
    + -
    \ No newline at end of file diff -r 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/quickstart/index.html --- a/hg-prompt/quickstart/index.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/quickstart/index.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    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
    -}
    +
    hg_ps1() {
    +    hg prompt "{ on {branch}}{ at {bookmark}}{status}" 2> /dev/null
    +}
     
    -export PS1='\u at \h in \w$(hg_ps1)\n$ '
    +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?
    -$
    +
    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
    -}
    +
    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$ '
    +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
    -$
    +
    [+1]-->hg-prompt/default-->[+2] at feature-bookmark
    +steve at myhost in ~/src/hg-prompt
    +$
     
    @@ -75,13 +75,15 @@

    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 3db7e53f85e3 -r fd8097ccb5c1 hg-prompt/quickstart/list.html --- a/hg-prompt/quickstart/list.html Thu Nov 19 21:35:53 2009 -0500 +++ b/hg-prompt/quickstart/list.html Thu Nov 19 22:51:47 2009 -0500 @@ -16,9 +16,7 @@ -
    - - + +
    +

    ls /quickstart

    @@ -48,13 +48,15 @@ - +
    + -
    \ No newline at end of file