Mercurial > hg > CommitWatcher
comparison commitwatcher/store.py @ 30:4c53f4cc6ffe
commitwatcher/commit.py commitwatcher/store.py
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Wed, 09 Oct 2013 14:50:07 -0700 |
| parents | 60a67934c64e |
| children | 3edb91cfd3c1 |
comparison
equal
deleted
inserted
replaced
| 29:826155711744 | 30:4c53f4cc6ffe |
|---|---|
| 5 class CommitStore(object): | 5 class CommitStore(object): |
| 6 """ | 6 """ |
| 7 ABC for commits | 7 ABC for commits |
| 8 """ | 8 """ |
| 9 | 9 |
| 10 def __init__(self, verbose=True): | |
| 11 self.verbose = verbose | |
| 12 | |
| 10 @abstractmethod | 13 @abstractmethod |
| 14 def __contains__(self, revision): | |
| 15 """if a particular revision is already added""" | |
| 16 | |
| 17 @abstractmethod | |
| 18 def store(self, commit): | |
| 19 """store a commit""" | |
| 20 | |
| 11 def add(self, commit): | 21 def add(self, commit): |
| 12 """adds a commit to the store""" | 22 """adds a commit to the store""" |
| 23 if commit.revision not in self: | |
| 24 return | |
| 25 self.store(commit) | |
| 13 | 26 |
| 14 @abstractmethod | 27 @abstractmethod |
| 15 def paths(self, *commits): | 28 def paths(self, *commits): |
| 16 """return all paths touched for a given commit""" | 29 """return all paths touched for a given commit""" |
| 17 | 30 |
