+from bup import metadata, options, vfs2 as vfs
+from bup.repo import LocalRepo
+from helpers import columnate, istty1, last, log
+
+def item_hash(item, tree_for_commit):
+ """If the item is a Commit, return its commit oid, otherwise return
+ the item's oid, if it has one.
+
+ """
+ if tree_for_commit and isinstance(item, vfs.Commit):
+ return item.coid
+ return getattr(item, 'oid', None)
+
+def item_info(item, name,