6 class PatchIDCache(object):
8 def __init__(self
, dbfile
):
9 self
._db
= shelve
.open(dbfile
)
12 for line
in git('rev-list', '--all', ret_pipe
=True):
16 def __getitem__(self
, key
):
19 patch
= git('show', key
+'^!')[0]
20 v
= self
._db
[key
] = git('patch-id', input=patch
)[0].split()[0]
24 return self
._db
.iteritems()
27 if __name__
== '__main__':
28 c
= PatchIDCache(sys
.argv
[1])