~jelmer/loggerhead/breezy-compat

« back to all changes in this revision

Viewing changes to loggerhead/controllers/revision_ui.py

  • Committer: Colin Watson
  • Date: 2019-09-19 08:10:36 UTC
  • mfrom: (491.2.62 breezy)
  • Revision ID: cjwatson@canonical.com-20190919081036-q1symc2h2iedtlh3
[r=cjwatson] Switch loggerhead over to using the Breezy rather than Bazaar APIs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#
19
19
 
20
20
import simplejson
21
 
import urllib
22
21
 
23
22
from paste.httpexceptions import HTTPServerError
24
23
 
25
 
from loggerhead import util
26
 
from loggerhead.controllers import TemplatedBranchView
27
 
from loggerhead.controllers.filediff_ui import diff_chunks_for_file
 
24
from breezy import urlutils
 
25
 
 
26
from .. import util
 
27
from ..controllers import TemplatedBranchView
 
28
from ..controllers.filediff_ui import diff_chunks_for_file
28
29
 
29
30
 
30
31
DEFAULT_LINE_COUNT_LIMIT = 3000
31
32
 
32
33
def dq(p):
33
 
    return urllib.quote(urllib.quote(p, safe=''))
 
34
    return urlutils.quote(urlutils.quote(p, safe=''))
34
35
 
35
36
 
36
37
class RevisionUI(TemplatedBranchView):
37
38
 
38
 
    template_path = 'loggerhead.templates.revision'
 
39
    template_name = 'revision'
39
40
    supports_json = True
40
41
 
41
42
    def get_values(self, path, kwargs, headers):
88
89
            merged_in = None
89
90
 
90
91
        return {
91
 
            'revid': revid,
 
92
            'revid': revid.decode('utf-8'),
92
93
            'change': change,
93
94
            'file_changes': file_changes,
94
95
            'merged_in': merged_in,