Anonymous avatar Anonymous committed 3c64839

Port to new Rietveld API.

Comments (0)

Files changed (1)


 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
         # been a non-empty base, patching will fail.
         base = ""
-        base = engine.UnifyLinebreaks(
+        base = utils.unify_linebreaks(
     lines = base.splitlines(True)
     for (start, end), newrange, oldlines, newlines in chunks:
         if lines[start:end] != oldlines:
         issue = issue[0]
     if verbose:
         print "Doing",
-    data = engine.UnifyLinebreaks(data)
+    data = utils.unify_linebreaks(data)
     branch, bases = find_bases(data)
     if not branch:
         if < 15000:
     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)
     f._patchset = str(
     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)
-        content = Content(text=engine.ToText(base), parent=patch)
+        content = Content(text=utils.to_dbtext(base), parent=patch)
         patch.content = content
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.