Mercurial > hg > CommitWatcher
comparison commitwatcher/store.py @ 5:d85093ba9f45
commitwatcher/store.py
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 27 Sep 2013 11:17:27 -0700 |
parents | 4cb3971d9d9d |
children | 883c88b13142 |
comparison
equal
deleted
inserted
replaced
4:2bc7eee11207 | 5:d85093ba9f45 |
---|---|
1 from abc import abstractmethod | 1 from abc import abstractmethod |
2 | 2 |
3 class CommitStore(object): | 3 class CommitStore(object): |
4 """ABC for commits""" | 4 """ |
5 ABC for commits | |
6 """ | |
5 | 7 |
6 @abstractmethod | 8 @abstractmethod |
7 def add(self, commit): | 9 def add(self, commit): |
8 """adds a commit to the store""" | 10 """adds a commit to the store""" |
11 | |
12 @abstractmethod | |
13 def paths(self, *commits): | |
14 """return all paths touched for a given commit""" | |
15 | |
9 | 16 |
10 class MemoryStore(CommitStore): | 17 class MemoryStore(CommitStore): |
11 """store in volatile memory""" | 18 """store in volatile memory""" |
12 # volatile! | 19 # volatile! |
13 | 20 |
14 def add(self, commit): | 21 def add(self, commit): |
15 raise NotImplementedError | 22 raise NotImplementedError() |
23 | |
24 def paths(self, *commits): | |
25 """ | |
26 return touched by commits | |
27 """ |