hg-log - Man Page

show revision history of entire repository or files

Examples (TL;DR)

Synopsis

hg log [OPTION]... [FILE]

Description

Print the revision history of the specified files or the entire project.

If no revision range is specified, the default is tip:0 unless --follow is set.

File history is shown without following rename or copy history of files. Use -f/--follow with a filename to follow history across renames and copies. --follow without a filename will only show ancestors of the starting revisions. The starting revisions can be specified by -r/--rev, which default to the working directory parent.

By default this command prints revision number and changeset id, tags, non-trivial parents, user, date and time, and a summary for each commit. When the -v/--verbose switch is used, the list of changed files and full commit message are shown.

With --graph the revisions are shown as an ASCII art DAG with the most recent changeset at the top. 'o' is a changeset, '@' is a working directory parent, '%' is a changeset involved in an unresolved merge conflict, '_' closes a branch, 'x' is obsolete, '*' is unstable, and '+' represents a fork where the changeset from the lines below is a parent of the 'o' merge on the same line. Paths in the DAG are represented with '|', '/' and so forth. ':' in place of a '|' indicates one or more revisions in a path are omitted.

Use -L/--line-range FILE,M:N options to follow the history of lines from M to N in FILE. With -p/--patch only diff hunks affecting specified line range will be shown. This option requires --follow; it can be specified multiple times. Currently, this option is not compatible with --graph. This option is experimental.

Note

hg log --patch may generate unexpected diff output for merge changesets, as it will only compare the merge changeset against its first parent. Also, only files different from BOTH parents will appear in files:.

Note

For performance reasons, hg log FILE may omit duplicate changes made on branches and will not show removals or mode changes. To see all such changes, use the --removed switch.

Note

The history resulting from -L/--line-range options depends on diff options; for instance if white-spaces are ignored, respective changes with only white-spaces in specified line range will not be listed.

Some examples:

Options

-f,  --follow

follow changeset history, or file history across copies and renames

--follow-first

only follow the first parent of merge changesets (DEPRECATED)

-d,--date <DATE>

show revisions matching date spec

-C,  --copies

show copied files

-k,--keyword <TEXT[+]>

do case-insensitive search for a given text

-r,--rev <REV[+]>

revisions to select or follow from

-L,--line-range <FILE,RANGE[+]>

follow line range of specified file (EXPERIMENTAL)

--removed

include revisions where files were removed

-m,  --only-merges

show only merges (DEPRECATED) (use -r "merge()" instead)

-u,--user <USER[+]>

revisions committed by user

--only-branch <BRANCH[+]>

show only changesets within the given named branch (DEPRECATED)

-b,--branch <BRANCH[+]>

show changesets within the given named branch

-B,--bookmark <BOOKMARK[+]>

show changesets within the given bookmark

-P,--prune <REV[+]>

do not display revision or any of its ancestors

-p,  --patch

show patch

-g,  --git

use git extended diff format

-l,--limit <NUM>

limit number of changes displayed

-M,  --no-merges

do not show merges

--stat

output diffstat-style summary of changes

-G,  --graph

show the revision DAG

--style <STYLE>

display using template map file (DEPRECATED)

-T,--template <TEMPLATE>

display with template

-I,--include <PATTERN[+]>

include names matching the given patterns

-X,--exclude <PATTERN[+]>

exclude names matching the given patterns

[+] marked option can be specified multiple times

Aliases

history