[Python-checkins] r88762 - in tracker/instances/python-dev: detectors/rietveldreactor.py scripts/addpatchsets

martin.v.loewis python-checkins at python.org
Mon Mar 7 09:47:20 CET 2011


Author: martin.v.loewis
Date: Mon Mar 7 09:47:19 2011
New Revision: 88762
Log:
Update CC list from nosy list.
Modified:
 tracker/instances/python-dev/detectors/rietveldreactor.py
 tracker/instances/python-dev/scripts/addpatchsets
Modified: tracker/instances/python-dev/detectors/rietveldreactor.py
==============================================================================
--- tracker/instances/python-dev/detectors/rietveldreactor.py	(original)
+++ tracker/instances/python-dev/detectors/rietveldreactor.py	Mon Mar 7 09:47:19 2011
@@ -15,7 +15,21 @@
 "values(%s, %s, %s, '!', '', '', false, true, false, now(), now())",
 (nodeid, username, email))
 
+def update_issue_cc(db, cl, nodeid, oldvalues):
+ if 'nosy' not in oldvalues:
+ return
+ c = db.cursor
+ c.execute("select count(*) from codereview_issue where id=%s", (nodeid,))
+ if c.fetchone()[0] == 0:
+ return
+ cc = []
+ for user in db.issue.get(nodeid, 'nosy'):
+ cc.append(db.user.get(user, 'address'))
+ cc = base64.encodestring(cPickle.dumps(cc))
+ c.execute("update codereview_issue set cc=%s where id=%s", (cc, nodeid))
+
 def init(db):
 db.user.react('create', create_django_user)
+ db.issue.react('set', update_issue_cc)
 # XXX react to email changes, roles
 # XXX react to subject, closed changes on issues
Modified: tracker/instances/python-dev/scripts/addpatchsets
==============================================================================
--- tracker/instances/python-dev/scripts/addpatchsets	(original)
+++ tracker/instances/python-dev/scripts/addpatchsets	Mon Mar 7 09:47:19 2011
@@ -126,9 +126,12 @@
 continue
 issue = Issue.objects.filter(id=nodeid)
 if not issue:
+ c.execute("select _address from _user,issue_nosy where nodeid=%s and id=linkid",
+ (nodeid,))
+ cc = [r[0] for r in c.fetchall()]
 c.execute("select _title, _creator from _issue where id=%s", (nodeid,))
 title, creator = c.fetchone()
- issue = Issue(id=nodeid, subject=title, owner_id=creator)
+ issue = Issue(id=nodeid, subject=title, owner_id=creator, cc=cc)
 issue.put()
 else:
 issue = issue[0]


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /