Awesome features in Mercurial

Pulkit Goyal

@__pulkitg__

Revsets

A functional language for selecting a set of revisions.

Supports a list of operators and predicates to search through the history.

For example:

  • x::y -> select changesets from x to y
  • x~n -> nth ancestor of x
  • grep(regex) -> search commit message, user name and names of files changed for the regex.
  • author(string) -> changesets of the given author

and lot more ...

Customizing the output of commands

Mercurial gives you to the ability to define templates which will be used to render output for the commands.

Phases

Each commit in Mercurial has a phase which controls how your changesets can be exchanged, edited etc.

Type of phases:

  • Secret
  • Draft
  • Public

Secret Phase

Changesets with this phase are considered your private which are mutable and won't be shared by commands which do exchange.

Draft Phase

Changesets with this phase are not yet considered as permanent history and hence are mutable.

Public Phase

Changesets with this phase are part of your repository permanent history and are immutable.

Types of repositories

  • Publishing:  Commits are public by default.
  • Non-publishing:  Commits are draft by default.

History Editing with Mercurial

Safe

One can only edit non-public commits i.e. drafts and secrets one.

Evolve Extension

A Mercurial extension using which one can easily edit draft commits.

Let's switch to the terminal!

The best part!

Your history of editing commits is also stored.

History of History!

Don't like it, wants the version control to automatically decide where the changes should go?

Time for magic!

Just don't blink your eyes.

`hg absorb`

An extension which will absorb your working directory changes into commits.

Do we have more time?

Topics

Topics are temporary names which you can give to your commits.

They fade away when a changeset becomes public.

Questions

Thank You!

Made with Slides.com