~abentley/bzr/bzr.ab

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /usr/bin/env python

import sys

from bzrlib.branch import Branch

b = Branch.open('.')
rev_id = sys.argv[1]
rh = []
while True:
    rh.append(rev_id)
    rev = b.get_revision(rev_id)
    if rev.parent_ids:
        rev_id = rev.parent_ids[0]
    else:
        break
rh.reverse()
for rev_id in rh:
    print rev_id