# HG changeset patch # User Jeff Hammel # Date 1380511431 25200 # Node ID a8e21cfda5febf5d8d072d8eb437e21c817a4c1e # Parent 091fd9f40b05281c2952076e62b7b3e55af8c868 wip diff -r 091fd9f40b05 -r a8e21cfda5fe commitwatcher/agent.py --- a/commitwatcher/agent.py Sat Sep 28 20:33:17 2013 -0700 +++ b/commitwatcher/agent.py Sun Sep 29 20:23:51 2013 -0700 @@ -42,11 +42,14 @@ feed = feedparser.parse(self.feed()) for entry in feed['entries']: + # get files from the changeset diff link = entry['link'] files = self.files(link) - # TODO - # TODO commit = Commit() + # make commit object + import pdb; pdb.set_trace() + commit = Commit() + class FeedAgentDiff(FeedAgent): """read files from diff""" @@ -71,7 +74,7 @@ a_b[i] = getattr(p, i) # strip 'a/', 'b/' from front, just to make sure - # XXX because + # XXX because the current version is b0rken sometimes for prefix in ('a/', 'b/'): if a_b[i].startswith(prefix): a_b[i] = a_b[i][len(prefix):] @@ -114,3 +117,6 @@ '\n'.join([(' %s' % path) for path in sorted(paths)])) + +class FeedAgentHTML(FeedAgent): + pass # TODO! diff -r 091fd9f40b05 -r a8e21cfda5fe commitwatcher/commit.py --- a/commitwatcher/commit.py Sat Sep 28 20:33:17 2013 -0700 +++ b/commitwatcher/commit.py Sun Sep 29 20:23:51 2013 -0700 @@ -4,11 +4,11 @@ class Commit(object): - def __init__(self, message, datetime, author, paths, link=None, identity=None): + def __init__(self, message, datetime, author, paths, revision): self.message = message self.datetime = datetime self.author= author self.paths = paths - self.link = link - self.identity = identify + self.revision + diff -r 091fd9f40b05 -r a8e21cfda5fe commitwatcher/store.py --- a/commitwatcher/store.py Sat Sep 28 20:33:17 2013 -0700 +++ b/commitwatcher/store.py Sun Sep 29 20:23:51 2013 -0700 @@ -15,11 +15,23 @@ def paths(self, *commits): """return all paths touched for a given commit""" + def ancestry(self, path): + sep = '/' # unix/url-style separators + path = path.split('/') + paths = [] + while path: + paths.append(sep.join(path)) + path.pop() + return paths + class MemoryStore(CommitStore): """store in volatile memory""" # volatile! + def __init__(self): + self.path_to_commit = {} + def add(self, commit): raise NotImplementedError() @@ -27,3 +39,9 @@ """ return touched by commits """ + + paths = set() + for commit in commits: + for f in commit.files: + + raise NotImplementedError