[py-svn] r23295 - py/dist/py/misc

hpk at codespeak.net hpk at codespeak.net
Mon Feb 13 19:58:34 CET 2006


Author: hpk
Date: Mon Feb 13 19:58:33 2006
New Revision: 23295

Modified:
   py/dist/py/misc/svnlook.py
Log:
actually commit the impl :)


Modified: py/dist/py/misc/svnlook.py
==============================================================================
--- py/dist/py/misc/svnlook.py	(original)
+++ py/dist/py/misc/svnlook.py	Mon Feb 13 19:58:33 2006
@@ -1,13 +1,23 @@
 
 import py
 
+class ChangeItem:
+    def __init__(self, line):
+        self.action = action = line[:4]
+        self.path = line[4:].strip()
+        self.added = action[0] == "A"
+        self.modified = action[0] == "M"
+        self.propchanged = action[1] == "U"
+        self.deleted = action[0] == "D"
+
+    def __repr__(self):
+        return "<ChangeItem %r>" %(self.action + self.path)
+
 def changed(repo, revision):
     out = py.process.cmdexec("svnlook changed -r %s %s" %(revision, repo))
     l = []
     for line in out.strip().split('\n'):
-        action = line[:4]
-        path = line[4:].strip()
-        l.append((action, path))
+        l.append(ChangeItem(line))
     return l
         
     



More information about the pytest-commit mailing list