annotate 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
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
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
3 class CommitStore(object):
5
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
4 """
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
5 ABC for commits
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
6 """
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
7
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
8 @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
9 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
10 """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
11
5
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
12 @abstractmethod
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
13 def paths(self, *commits):
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
14 """return all paths touched for a given commit"""
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
15
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
16
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
17 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
18 """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
19 # 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
20
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 def add(self, commit):
5
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
22 raise NotImplementedError()
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
23
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
24 def paths(self, *commits):
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 return touched by commits
d85093ba9f45 commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
27 """