comparison commitwatcher/store.py @ 20:a8e21cfda5fe

wip
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 29 Sep 2013 20:23:51 -0700
parents 883c88b13142
children be7090ee7738
comparison
equal deleted inserted replaced
19:091fd9f40b05 20:a8e21cfda5fe
13 13
14 @abstractmethod 14 @abstractmethod
15 def paths(self, *commits): 15 def paths(self, *commits):
16 """return all paths touched for a given commit""" 16 """return all paths touched for a given commit"""
17 17
18 def ancestry(self, path):
19 sep = '/' # unix/url-style separators
20 path = path.split('/')
21 paths = []
22 while path:
23 paths.append(sep.join(path))
24 path.pop()
25 return paths
26
18 27
19 class MemoryStore(CommitStore): 28 class MemoryStore(CommitStore):
20 """store in volatile memory""" 29 """store in volatile memory"""
21 # volatile! 30 # volatile!
31
32 def __init__(self):
33 self.path_to_commit = {}
22 34
23 def add(self, commit): 35 def add(self, commit):
24 raise NotImplementedError() 36 raise NotImplementedError()
25 37
26 def paths(self, *commits): 38 def paths(self, *commits):
27 """ 39 """
28 return touched by commits 40 return touched by commits
29 """ 41 """
42
43 paths = set()
44 for commit in commits:
45 for f in commit.files:
46
47 raise NotImplementedError