changeset 30:4c53f4cc6ffe

commitwatcher/commit.py commitwatcher/store.py
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 09 Oct 2013 14:50:07 -0700
parents 826155711744
children 3edb91cfd3c1
files commitwatcher/commit.py commitwatcher/store.py
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/commitwatcher/commit.py	Sat Oct 05 15:50:02 2013 -0700
+++ b/commitwatcher/commit.py	Wed Oct 09 14:50:07 2013 -0700
@@ -9,6 +9,4 @@
         self.datetime = datetime
         self.author= author
         self.paths = paths
-        self.revision
-
-
+        self.revision = revision
--- a/commitwatcher/store.py	Sat Oct 05 15:50:02 2013 -0700
+++ b/commitwatcher/store.py	Wed Oct 09 14:50:07 2013 -0700
@@ -7,9 +7,22 @@
     ABC for commits
     """
 
+    def __init__(self, verbose=True):
+        self.verbose = verbose
+
     @abstractmethod
+    def __contains__(self, revision):
+        """if a particular revision is already added"""
+
+    @abstractmethod
+    def store(self, commit):
+        """store a commit"""
+
     def add(self, commit):
         """adds a commit to the store"""
+        if commit.revision not in self:
+            return
+        self.store(commit)
 
     @abstractmethod
     def paths(self, *commits):