Marcus Leon
Marcus Leon

Reputation: 56699

Mercurial - use hg log to view all ancestors

Given changesets

a
--b
----c
------d
--------e

How can I get a listing of all changesets that come before d. Ie: how can you use hg log to return a-b-c?

Upvotes: 3

Views: 1227

Answers (3)

Vlad H
Vlad H

Reputation: 3689

You can do hg log -r :d (but it will also display d).

Upvotes: 3

Ry4an Brase
Ry4an Brase

Reputation: 78350

Use:

hg log -r "ancestors(d)"

This requires the revsets feature in Mercurial 1.7 and later. See hg help revsets for some great fun.

Upvotes: 8

Omnifarious
Omnifarious

Reputation: 56088

hg log -r d::a

or

hg log -r a::d

This will require a reasonably recent (I believe 1.6 or later) version of Mercurial to work.

Upvotes: 3

Related Questions