Help: log

hg log [OPTION]... [FILE]

aliases: history

show revision history of entire repository or files

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, in which case the working directory parent is used as the starting revision.

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 or descendants of the starting revision.

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, 'x' is obsolete, and '+' represents a fork where the changeset from the lines below is a parent of the 'o' merge on the same line.

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.

Some examples:

  • changesets with full descriptions and file lists:
    hg log -v
    
  • changesets ancestral to the working directory:
    hg log -f
    
  • last 10 commits on the current branch:
    hg log -l 10 -b .
    
  • changesets showing all modifications of a file, including removals:
    hg log --removed file.c
    
  • all changesets that touch a directory, with diffs, excluding merges:
    hg log -Mp lib/
    
  • all revision numbers that match a keyword:
    hg log -k bug --template "{rev}\n"
    
  • the full hash identifier of the working directory parent:
    hg log -r . --template "{node}\n"
    
  • list available log templates:
    hg log -T list
    
  • check if a given changeset is included in a tagged release:
    hg log -r "a21ccf and ancestor(1.9)"
    
  • find all changesets by some user in a date range:
    hg log -k alice -d "may 2008 to jul 2008"
    
  • summary of all changesets after the last tag:
    hg log -r "last(tagged())::" --template "{desc|firstline}\n"
    

See 'hg help dates' for a list of formats valid for -d/--date.

See 'hg help revisions' and 'hg help revsets' for more about specifying and ordering revisions.

See 'hg help templates' for more about pre-packaged styles and specifying custom templates.

Returns 0 on success.

options ([+] can be repeated):

-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 [+] show the specified revision or revset
--removed include revisions where files were removed
-m --only-merges show only merges (DEPRECATED)
-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
-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

global options ([+] can be repeated):

-R --repository REPO repository root directory or name of overlay bundle file
--cwd DIR change working directory
-y --noninteractive do not prompt, automatically pick the first choice for all prompts
-q --quiet suppress output
-v --verbose enable additional output
--config CONFIG [+] set/override config option (use 'section.name=value')
--debug enable debugging output
--debugger start debugger
--encoding ENCODE set the charset encoding (default: utf-8)
--encodingmode MODE set the charset encoding mode (default: strict)
--traceback always print a traceback on exception
--time time how long the command takes
--profile print command execution profile
--version output version information and exit
-h --help display help and exit
--hidden consider hidden changesets
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)