[Python-checkins] r88970 - tracker/instances/python-dev/scripts/addpatchsets

martin.v.loewis python-checkins at python.org
Wed May 30 19:31:50 CEST 2012


Author: martin.v.loewis
Date: Wed May 30 19:31:50 2012
New Revision: 88970

Log:
Port to new Rietveld API.


Modified:
   tracker/instances/python-dev/scripts/addpatchsets

Modified: tracker/instances/python-dev/scripts/addpatchsets
==============================================================================
--- tracker/instances/python-dev/scripts/addpatchsets	(original)
+++ tracker/instances/python-dev/scripts/addpatchsets	Wed May 30 19:31:50 2012
@@ -16,7 +16,7 @@
 from codereview.models import (Repository, Branch, Patch, 
                                PatchSet, Issue, Content)
 from django.contrib.auth.models import User
-from codereview import engine, patching
+from codereview import patching, utils
 from roundup_helper.models import File, RoundupIssue
 from django.db import connection, transaction
 from google.appengine.ext import db as gae_db
@@ -44,7 +44,7 @@
         # been a non-empty base, patching will fail.
         base = ""
     else:
-        base = engine.UnifyLinebreaks(r.read())
+        base = utils.unify_linebreaks(r.read())
     lines = base.splitlines(True)
     for (start, end), newrange, oldlines, newlines in chunks:
         if lines[start:end] != oldlines:
@@ -148,7 +148,7 @@
         issue = issue[0]
     if verbose:
         print "Doing", f.id
-    data = engine.UnifyLinebreaks(data)
+    data = utils.unify_linebreaks(data)
     branch, bases = find_bases(data)
     if not branch:
         if f.id < 15000:
@@ -159,7 +159,6 @@
 
     blob = gae_db.Blob(data)
     patchset = PatchSet(issue=issue, data=blob, parent=issue,
-                        owner=User.objects.get(id=f._creator),
                         created=f._creation, modified=f._creation)
     patchset.put()
     issue.patchset=patchset
@@ -168,10 +167,10 @@
     f._patchset = str(patchset.id)
     f.save()
     for filename, data, chunks, base in bases:
-        patch = Patch(patchset=patchset, text=engine.ToText(data),
+        patch = Patch(patchset=patchset, text=utils.to_dbtext(data),
                       filename=filename, parent=patchset)
         patch.put()
-        content = Content(text=engine.ToText(base), parent=patch)
+        content = Content(text=utils.to_dbtext(base), parent=patch)
         content.put()
         patch.content = content
         patch.put()


More information about the Python-checkins mailing list