annotate commitwatcher/store.py @ 11:546695da018c

commitwatcher/agent.py tests/unit.py
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 28 Sep 2013 05:15:59 -0700
parents 883c88b13142
children a8e21cfda5fe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 from abc import abstractmethod
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
6
883c88b13142 commitwatcher/agent.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
3 __all__ = ['CommitStore', 'MemoryStore']
883c88b13142 commitwatcher/agent.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
4
2
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 class CommitStore(object):
5
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
6 """
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
7 ABC for commits
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
8 """
2
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 @abstractmethod
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 def add(self, commit):
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 """adds a commit to the store"""
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13
5
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
14 @abstractmethod
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
15 def paths(self, *commits):
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
16 """return all paths touched for a given commit"""
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
17
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
18
2
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 class MemoryStore(CommitStore):
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20 """store in volatile memory"""
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21 # volatile!
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 def add(self, commit):
5
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
24 raise NotImplementedError()
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
25
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
26 def paths(self, *commits):
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
27 """
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
28 return touched by commits
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
29 """