Mercurial > hg > CommitWatcher
comparison commitwatcher/store.py @ 39:b04538e7f9f3
stub
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Tue, 05 Nov 2013 02:08:21 -0800 |
| parents | 035368f84847 |
| children | cd590e1722d6 |
comparison
equal
deleted
inserted
replaced
| 38:035368f84847 | 39:b04538e7f9f3 |
|---|---|
| 6 | 6 |
| 7 __all__ = ['CommitStore', 'MemoryStore'] | 7 __all__ = ['CommitStore', 'MemoryStore'] |
| 8 | 8 |
| 9 class CommitStore(object): | 9 class CommitStore(object): |
| 10 """ | 10 """ |
| 11 ABC for commits | 11 ABC for commit storage |
| 12 """ | 12 """ |
| 13 | 13 |
| 14 def __init__(self, verbose=True): | 14 def __init__(self, verbose=True, events=None): |
| 15 self.verbose = verbose | 15 self.verbose = verbose |
| 16 self.events = events | |
| 16 | 17 |
| 17 @abstractmethod | 18 @abstractmethod |
| 18 def __contains__(self, revision): | 19 def __contains__(self, revision): |
| 19 """if a particular revision is already added""" | 20 """if a particular revision is already added""" |
| 20 | 21 |
| 55 | 56 |
| 56 class MemoryStore(CommitStore): | 57 class MemoryStore(CommitStore): |
| 57 """store in volatile memory""" | 58 """store in volatile memory""" |
| 58 # volatile! | 59 # volatile! |
| 59 | 60 |
| 60 def __init__(self): | 61 def __init__(self, *args, **kwargs): |
| 62 CommitStore.__init__(self, *args, **kwargs) | |
| 61 self.path_to_commit = {} | 63 self.path_to_commit = {} |
| 62 self._commits = [] | 64 self._commits = [] |
| 63 | 65 |
| 64 def store(self, commit): | 66 def store(self, commit): |
| 65 paths = self.paths(commit) | 67 paths = self.paths(commit) |
