Differences between revisions 1 and 15 (spanning 14 versions)
Revision 1 as of 2005-09-29 00:08:45
Size: 1383
Editor: mpm
Comment:
Revision 15 as of 2007-04-13 18:12:25
Size: 3981
Editor: GeorgeDunlap
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Mercurial includes a tool called hgk that allows browsing the history of a repository in a GUI. It's a direct port of the gitk tool used with git. ## page was renamed from UsingHgk
== Hgk extension ==
'''This extension is currently being distributed along with Mercurial.'''
Line 3: Line 5:
To use hgk, you'll want to install the hgk.py extension which adds a view command as well as
other interfaces that hgk uses to communicate with Mercurial in a git-like manner.
''Author: Chris Mason''
Line 6: Line 7:
Both hgk and hgk.py are found in the contrib directory. === Overview ===
The hgk extension allows browsing the history of a repository in a graphical way.
It's a direct port of the gitk tool used with git and requires Tcl/Tk version 8.4 or later. (Tcl/TK is not distributed with Mercurial.)
Line 8: Line 11:
To load an extension, you add it to your .hgrc file. You can specify an absolute path: === Configuration ===
hgk consists of two parts: a tcl script that does the displaying and querying of information, and an extension to mercurial named hgk.py, which allows hgk to interact with mercurial in a git-like manner.

hgk is found in the contrib directory. '''Linux note''': the contrib directory may not be installed by default either from the direct download or from a distribution. You can find it in the main Mercurial tar.gz from the download section. Either make the entire contrib directory accessible to those who need it, or just 'hgk' (Ex: place 'hgk' somewhere in the path, or specify it's exact location as per the instructions below.) WARNING: if you fetch the contrib directory by hand, be careful to get the one that matches your version of Mercurial!

hgk.py is located in the hgext directory.

To load an extension, you add it to your .hgrc file (you have to use your global $HOME/.hgrc file,
not one in a repository). You can specify an absolute path:
Line 15: Line 26:
Mercurial can also scan the default python library path for a file named 'hgk.py': Mercurial can also scan the default python library path for a file named 'hgk.py' if you set {{{hgk}}} empty:
Line 20: Line 31:
}}}

The {{{hg view}}} command will launch {{{hgk}}}. For this command to work, hgk must be in your search path. Alternately, you can specify the path to hgk in your .hgrc file:

{{{
[hgk]
path=/location/of/hgk
Line 41: Line 59:

=== Configuration for Windows NT ===
Under Windows NT, we need to make sure Hg can invoke the hgk script. So, assuming you have Tcl/TK installed, create a file called {{{hgk.cmd}}} with the following content (just replace the path to the hgk script on your system):
{{{
@wish C:\path\to\hgk %*
}}}

As with the Unix environment, you need to add {{{hgk.cmd}}} to the search path, or specify the path to hgk in your mercurial.ini file:

{{{
[hgk]
path=C:\location\of\hgk.cmd
}}}

=== Keyboard Accelerators ===

The following key combinations can be used to perform certain actions:

{{{
Ctrl+q quit
Ctrl+f find
Ctrl+= or Ctrl+<Keypad +> increase font size
Ctrl+- or Ctrl+<Keypad -> decrease font size
Ctrl+g, Return, or '/' find next match
Ctrl+r or '?' find previous match
Arrow-up select previous changeset
Arrow-down select next changeset
Page-up or 'p' scroll changeset list up one page
Page-down or 'n' scroll changeset list down one page
Delete, Backspace or 'b' scroll viewed changeset up one page
Space scroll viewed changeset down one page
'd' scroll viewed changeset down 18 lines
'u' scroll viewed changeset up 18 lines
}}}

Selected font size will be saved in ~/.gitk and reused in the next session.
----
CategoryExtension

Hgk extension

This extension is currently being distributed along with Mercurial.

Author: Chris Mason

Overview

The hgk extension allows browsing the history of a repository in a graphical way. It's a direct port of the gitk tool used with git and requires Tcl/Tk version 8.4 or later. (Tcl/TK is not distributed with Mercurial.)

Configuration

hgk consists of two parts: a tcl script that does the displaying and querying of information, and an extension to mercurial named hgk.py, which allows hgk to interact with mercurial in a git-like manner.

hgk is found in the contrib directory. Linux note: the contrib directory may not be installed by default either from the direct download or from a distribution. You can find it in the main Mercurial tar.gz from the download section. Either make the entire contrib directory accessible to those who need it, or just 'hgk' (Ex: place 'hgk' somewhere in the path, or specify it's exact location as per the instructions below.) WARNING: if you fetch the contrib directory by hand, be careful to get the one that matches your version of Mercurial!

hgk.py is located in the hgext directory.

To load an extension, you add it to your .hgrc file (you have to use your global $HOME/.hgrc file, not one in a repository). You can specify an absolute path:

[extensions]
hgk=/usr/local/lib/hgk.py

Mercurial can also scan the default python library path for a file named 'hgk.py' if you set hgk empty:

[extensions]
hgk=

The hg view command will launch hgk. For this command to work, hgk must be in your search path. Alternately, you can specify the path to hgk in your .hgrc file:

[hgk]
path=/location/of/hgk

<!> In version 0.7, this extension is named "hgit" (without the .py) and does not provide the view command. You must invoke hgk directly.

Now hg help will show the new commands provided by the hgk extension:

$ hg help
...
 status      show changed files in the working directory
 tag         add a tag for the current tip or a given revision
 tags        list repository tags
 tip         show the tip revision
 unbundle    apply a changegroup file
 undo        undo the last commit or pull
 update      update or merge working directory
 verify      verify the integrity of the repository
 version     output version and copyright information
 view        start interactive history viewer
$ hg view

Configuration for Windows NT

Under Windows NT, we need to make sure Hg can invoke the hgk script. So, assuming you have Tcl/TK installed, create a file called hgk.cmd with the following content (just replace the path to the hgk script on your system):

@wish C:\path\to\hgk %*

As with the Unix environment, you need to add hgk.cmd to the search path, or specify the path to hgk in your mercurial.ini file:

[hgk]
path=C:\location\of\hgk.cmd

Keyboard Accelerators

The following key combinations can be used to perform certain actions:

Ctrl+q                    quit
Ctrl+f                    find
Ctrl+= or Ctrl+<Keypad +> increase font size
Ctrl+- or Ctrl+<Keypad -> decrease font size
Ctrl+g, Return, or '/'    find next match
Ctrl+r or '?'             find previous match
Arrow-up                  select previous changeset
Arrow-down                select next changeset
Page-up or 'p'            scroll changeset list up one page
Page-down or 'n'          scroll changeset list down one page
Delete, Backspace or 'b'  scroll viewed changeset up one page
Space                     scroll viewed changeset down one page
'd'                       scroll viewed changeset down 18 lines
'u'                       scroll viewed changeset up 18 lines

Selected font size will be saved in ~/.gitk and reused in the next session.


CategoryExtension

HgkExtension (last edited 2014-04-23 12:33:48 by MartinGeisler)