943
943
class cmd_revision_history(Command):
944
"""Display list of revision ids on this branch."""
944
"""Display the list of revision ids on a branch."""
945
takes_args = ['location?']
949
branch = WorkingTree.open_containing(u'.')[0].branch
950
for patchid in branch.revision_history():
951
self.outf.write(patchid)
950
def run(self, location="."):
951
branch = Branch.open_containing(location)[0]
952
for revid in branch.revision_history():
953
self.outf.write(revid)
952
954
self.outf.write('\n')
955
957
class cmd_ancestry(Command):
956
958
"""List all revisions merged into this branch."""
959
takes_args = ['location?']
961
tree = WorkingTree.open_containing(u'.')[0]
963
# FIXME. should be tree.last_revision
964
revision_ids = b.repository.get_ancestry(b.last_revision())
964
def run(self, location="."):
966
wt = WorkingTree.open_containing(location)[0]
967
except errors.NoWorkingTree:
968
b = Branch.open(location)
969
last_revision = b.last_revision()
972
last_revision = wt.last_revision()
974
revision_ids = b.repository.get_ancestry(last_revision)
965
975
assert revision_ids[0] == None
966
976
revision_ids.pop(0)
967
977
for revision_id in revision_ids: