Mercurial > hg > CommitWatcher
comparison commitwatcher/agent.py @ 20:a8e21cfda5fe
wip
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Sun, 29 Sep 2013 20:23:51 -0700 (2013-09-30) |
| parents | 091fd9f40b05 |
| children | be7090ee7738 |
comparison
equal
deleted
inserted
replaced
| 19:091fd9f40b05 | 20:a8e21cfda5fe |
|---|---|
| 40 """update""" | 40 """update""" |
| 41 | 41 |
| 42 feed = feedparser.parse(self.feed()) | 42 feed = feedparser.parse(self.feed()) |
| 43 for entry in feed['entries']: | 43 for entry in feed['entries']: |
| 44 | 44 |
| 45 # get files from the changeset diff | |
| 45 link = entry['link'] | 46 link = entry['link'] |
| 46 files = self.files(link) | 47 files = self.files(link) |
| 47 # TODO | |
| 48 | 48 |
| 49 # TODO commit = Commit() | 49 # make commit object |
| 50 import pdb; pdb.set_trace() | |
| 51 commit = Commit() | |
| 52 | |
| 50 | 53 |
| 51 class FeedAgentDiff(FeedAgent): | 54 class FeedAgentDiff(FeedAgent): |
| 52 """read files from diff""" | 55 """read files from diff""" |
| 53 | 56 |
| 54 @staticmethod | 57 @staticmethod |
| 69 a_b = {} | 72 a_b = {} |
| 70 for i in ('source', 'target'): | 73 for i in ('source', 'target'): |
| 71 a_b[i] = getattr(p, i) | 74 a_b[i] = getattr(p, i) |
| 72 | 75 |
| 73 # strip 'a/', 'b/' from front, just to make sure | 76 # strip 'a/', 'b/' from front, just to make sure |
| 74 # XXX because | 77 # XXX because the current version is b0rken sometimes |
| 75 for prefix in ('a/', 'b/'): | 78 for prefix in ('a/', 'b/'): |
| 76 if a_b[i].startswith(prefix): | 79 if a_b[i].startswith(prefix): |
| 77 a_b[i] = a_b[i][len(prefix):] | 80 a_b[i] = a_b[i][len(prefix):] |
| 78 break | 81 break |
| 79 | 82 |
| 112 paths = self.lsdiff(raw_rev) | 115 paths = self.lsdiff(raw_rev) |
| 113 print '%s :\n%s\n' % (revision, | 116 print '%s :\n%s\n' % (revision, |
| 114 '\n'.join([(' %s' % path) | 117 '\n'.join([(' %s' % path) |
| 115 for path in sorted(paths)])) | 118 for path in sorted(paths)])) |
| 116 | 119 |
| 120 | |
| 121 class FeedAgentHTML(FeedAgent): | |
| 122 pass # TODO! |
