| 1 |
$ hg init r1 |
| 2 |
$ cd r1 |
| 3 |
$ hg ci --config ui.allowemptycommit=true -m c0 |
| 4 |
$ hg ci --config ui.allowemptycommit=true -m c1 |
| 5 |
$ hg ci --config ui.allowemptycommit=true -m c2 |
| 6 |
$ hg co -q 0 |
| 7 |
$ hg ci --config ui.allowemptycommit=true -m c3 |
| 8 |
created new head |
| 9 |
$ hg co -q 3 |
| 10 |
$ hg merge --quiet |
| 11 |
$ hg ci --config ui.allowemptycommit=true -m c4 |
| 12 |
|
| 13 |
$ hg log -G -T'{desc}' |
| 14 |
@ c4 |
| 15 |
|\ |
| 16 |
| o c3 |
| 17 |
| | |
| 18 |
o | c2 |
| 19 |
| | |
| 20 |
o | c1 |
| 21 |
|/ |
| 22 |
o c0 |
| 23 |
|
| 24 |
|
| 25 |
>>> from mercurial import ui as uimod |
| 26 |
>>> from mercurial.repo import factory |
| 27 |
>>> repo = factory.repository(uimod.ui()) |
| 28 |
>>> for anc in repo.changelog.ancestors([4], inclusive=True): |
| 29 |
... print(anc) |
| 30 |
4 |
| 31 |
3 |
| 32 |
2 |
| 33 |
1 |
| 34 |
0 |