Differences between revisions 9 and 10
Revision 9 as of 2008-04-12 17:00:52
Size: 1669
Editor: JoelRosdahl
Comment:
Revision 10 as of 2008-09-11 08:34:40
Size: 3613
Editor: abuehl
Comment: adding two additional examples
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
This extension adds a new command {{{glog}}} that behaves like (a subset of) the normal {{{log}}} command except that it also prints a graph representing the [:Revision:revision] history using ASCII characters to the left of the log. Example: This extension adds a new command {{{glog}}} that behaves like (a subset of) the normal {{{log}}} command except that it also prints a graph representing the [:Revision:revision] history using ASCII characters to the left of the log.

====
Examples ====
Line 28: Line 30:
Nodes printed as an {{{@}}} character are [:Parent:parents] of the [:WorkingDirectory:working directory]. Otherwise, the graph is hopefully self-explanatory. Nodes printed as an {{{@}}} character are [:Parent:parents] of the [:WorkingDirectory:working directory].

After a merge (but before the commit):
{{{
$ hg glog
@ changeset: 3:86794f718fb1
| tag: tip
| parent: 1:82e55d328c8c
| user: mpm@selenic.com
| date: Mon May 05 01:20:46 2008 +0200
| summary: Express great joy at existence of Mercurial
|
| @ changeset: 2:c3844fde99f0
|/ user: mpm@selenic.com
| date: Tue May 06 20:10:35 2008 +0200
| summary: Add description of hello.c
|
o changeset: 1:82e55d328c8c
| user: mpm@selenic.com
| date: Fri Aug 26 01:21:28 2005 -0700
| summary: Create a makefile
|
o changeset: 0:0a04b987be5a
   user: mpm@selenic.com
   date: Fri Aug 26 01:20:50 2005 -0700
   summary: Create a standard "hello, world" program
}}}

Using {{{[ui] style = compact}}} in [http://www.selenic.com/mercurial/hgrc.5.html#ui hgrc] and option `-l`:
{{{
> hg glog -l9
@ 7017[tip]:7015,7016 8362086a1227 2008-09-10 08:49 +0200 benoit
|\ merge backout
| |
| o 7016:7009 58dcf10eea2b 2008-09-10 08:48 +0200 benoit
| | Backed out changeset 3d54cf97598d (see issue916 for details)
| |
o | 7015 6651de7176a0 2008-09-09 21:32 +0200 mg
| | i18n, record: improve use of translated docstring in prompts
| |
o | 7014 46456a51e247 2008-09-09 21:32 +0200 mg
| | i18n: use gettext instead of _
| |
o | 7013 f56e788fa292 2008-09-09 21:32 +0200 mg
| | i18n: mark help strings for translation
| |
o | 7012 78341ea65d16 2008-09-09 21:32 +0200 mg
| | restructure helptable
| |
o | 7011 7da76778dbd7 2008-09-09 14:43 +0200 benoit
| | Do not try to load extensions twice (issue811)
| |
o | 7010 9141bebefe3e 2008-09-08 14:22 +0200 benoit
|/ enhance the error output in case of failure during http push
|
o 7009 3d54cf97598d 2008-09-08 14:04 +0200 benoit
| tag: without a checkout, base the tag changeset on tip instead of nullid
|
}}}

Graph log extension

This extension is currently being distributed along with Mercurial.

Author: Joel Rosdahl

Overview

This extension adds a new command glog that behaves like (a subset of) the normal log command except that it also prints a graph representing the [:Revision:revision] history using ASCII characters to the left of the log.

1. Examples

% hg glog
@    changeset:   4276:cb6107f78b92
|\   tag:         tip
| |  parent:      4269:73c918c71300
| |  parent:      4275:81402b2b294d
| |  user:        Matt Mackall <mpm@selenic.com>
| |  date:        Sat Mar 24 02:57:27 2007 -0500
| |  summary:     Merge with crew
| |
o |  changeset:   4275:81402b2b294d
| |  user:        Alexis S. L. Carvalho <alexis@cecm.usp.br>
| |  date:        Fri Mar 23 23:40:25 2007 -0300
| |  summary:     use os.path.islink instead of util.is_link
[...]

Nodes printed as an @ character are [:Parent:parents] of the [:WorkingDirectory:working directory].

After a merge (but before the commit):

$ hg glog
@  changeset:   3:86794f718fb1
|  tag:         tip
|  parent:      1:82e55d328c8c
|  user:        mpm@selenic.com
|  date:        Mon May 05 01:20:46 2008 +0200
|  summary:     Express great joy at existence of Mercurial
|
| @  changeset:   2:c3844fde99f0
|/   user:        mpm@selenic.com
|    date:        Tue May 06 20:10:35 2008 +0200
|    summary:     Add description of hello.c
|
o  changeset:   1:82e55d328c8c
|  user:        mpm@selenic.com
|  date:        Fri Aug 26 01:21:28 2005 -0700
|  summary:     Create a makefile
|
o  changeset:   0:0a04b987be5a
   user:        mpm@selenic.com
   date:        Fri Aug 26 01:20:50 2005 -0700
   summary:     Create a standard "hello, world" program

Using [ui] style = compact in [http://www.selenic.com/mercurial/hgrc.5.html#ui hgrc] and option -l:

> hg glog -l9
@    7017[tip]:7015,7016   8362086a1227   2008-09-10 08:49 +0200   benoit
|\     merge backout
| |
| o  7016:7009   58dcf10eea2b   2008-09-10 08:48 +0200   benoit
| |    Backed out changeset 3d54cf97598d (see issue916 for details)
| |
o |  7015   6651de7176a0   2008-09-09 21:32 +0200   mg
| |    i18n, record: improve use of translated docstring in prompts
| |
o |  7014   46456a51e247   2008-09-09 21:32 +0200   mg
| |    i18n: use gettext instead of _
| |
o |  7013   f56e788fa292   2008-09-09 21:32 +0200   mg
| |    i18n: mark help strings for translation
| |
o |  7012   78341ea65d16   2008-09-09 21:32 +0200   mg
| |    restructure helptable
| |
o |  7011   7da76778dbd7   2008-09-09 14:43 +0200   benoit
| |    Do not try to load extensions twice (issue811)
| |
o |  7010   9141bebefe3e   2008-09-08 14:22 +0200   benoit
|/     enhance the error output in case of failure during http push
|
o  7009   3d54cf97598d   2008-09-08 14:04 +0200   benoit
|    tag: without a checkout, base the tag changeset on tip instead of nullid
|

Configuration

Enable this extension by adding the following lines to your configuration file ([:.hgrc:hgrc]):

[extensions]
hgext.graphlog = 

Usage

hg glog [OPTIONS]

where options are:

-l --limit LIMIT        limit number of changes displayed
-p --patch              show patch
-r --rev REV            show the specified revision or range
   --style STYLE        display using template map file STYLE (e.g., "compact")
   --template TEMPLATE  display with template TEMPLATE (e.g., "{desc}\n\n")


CategoryExtension

GraphlogExtension (last edited 2018-06-06 11:11:09 by AntonShestakov)