~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to services/diffservice

  • Committer: David Coles
  • Date: 2009-12-08 02:10:26 UTC
  • Revision ID: coles.david@gmail.com-20091208021026-3a27ecdzm49y39me
Configuration documentation - fixing a few references

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
import os
28
28
import sys
29
 
import locale
30
29
 
31
30
import cjson
32
31
import pysvn
33
32
 
34
33
import ivle.svn
35
34
 
36
 
# Set locale to UTF-8
37
 
locale.setlocale(locale.LC_CTYPE, "en_US.UTF-8")
38
35
 
39
36
# Default revisions
40
37
revs = [pysvn.Revision(x) for x in [pysvn.opt_revision_kind.base,
51
48
    svnclient = pysvn.Client()
52
49
    svnclient.exception_style = 1
53
50
    diff = svnclient.diff
54
 
 
55
 
    # pysvn's diff tempfile behaviour changes with Subversion 1.6.x.
56
 
    # < 1.6 wants a filename, >= 1.6 wants a directory.
57
 
    if pysvn.svn_version > (1, 6):
58
 
        tmp_path = '/tmp'
59
 
    else:
60
 
        tmp_path = '/tmp/svndiff'
61
 
 
62
 
    diff_text = diff(tmp_path,
 
51
    diff_text = diff( '/tmp/svndiff',
63
52
        os.path.join('/home', sys.argv[1]),
64
53
        revision1=revs[0],
65
54
        revision2=revs[1]
66
55
    )
67
 
    print cjson.encode({'diff': diff_text.decode('utf-8')})
 
56
    print cjson.encode({'diff': diff_text})
68
57
except pysvn.ClientError, e:
69
58
    error = e[0]
70
59