changeset 16:59c94aaf311c

almost does somethign
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 28 Sep 2013 09:44:26 -0700
parents 77118f83b5b7
children 9ec036da252e
files commitwatcher/agent.py
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/commitwatcher/agent.py	Sat Sep 28 09:20:14 2013 -0700
+++ b/commitwatcher/agent.py	Sat Sep 28 09:44:26 2013 -0700
@@ -80,8 +80,15 @@
             # TODO: could break this in to added, modified, removed, renamed
             if a_b['source'] == a_b['target']:
                 files.setdefault('modified', set()).add(a_b['source'])
+            elif a_b['source'] in ('/dev/null', 'dev/null'):
+                files.setdefault('added', set()).add(a_b['target'])
+            elif a_b['target'] in ('/dev/null', 'dev/null'):
+                files.setdefault('removed', set()).add(a_b['source'])
             else:
-                raise NotImplementedError("%s %s" % (a_b['source'], a_b['target']))
+                raise NotImplementedError("source: %s;  target: %s" % (a_b['source'], a_b['target']))
+
+        # xxx flatten for simplicity for now and hope i don't regret this
+        files = set(sum([list(item) for item in files.values()], []))
 
         return files
 
@@ -100,6 +107,7 @@
         """
 
         raw_rev = self.diff_url(revision)
-        print raw_rev
 
         # get paths from diff
+        paths = self.lsdiff(raw_rev)
+        print '%s :\n%s\n' % (revision, ', '.join(sorted(paths)))