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

« back to all changes in this revision

Viewing changes to services/svnlogservice

  • Committer: William Grant
  • Date: 2010-02-23 08:48:09 UTC
  • mfrom: (1673 trunk)
  • mto: This revision was merged to the branch mainline in revision 1674.
  • Revision ID: grantw@unimelb.edu.au-20100223084809-du6dvsxrjhw15ytr
Merge trunk.

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
29
30
 
30
31
import cjson
31
32
import pysvn
32
33
 
33
34
import ivle.svn
34
35
 
 
36
# Set locale to UTF-8
 
37
locale.setlocale(locale.LC_CTYPE, "en_US.UTF-8")
 
38
 
35
39
try:
36
40
    client = pysvn.Client()
37
41
    client.exception_style = 1
38
 
    logs = client.log(os.path.join('/home', sys.argv[1]),
 
42
    logs = client.log(os.path.join('/home', sys.argv[1].decode('utf-8')),
39
43
                      discover_changed_paths=True)
40
44
    print cjson.encode({'logs': [{'revno': log.revision.number,
41
 
                                  'author': log.author,
42
 
                                  'message': log.message,
 
45
                                  'author': log.author.decode('utf-8'),
 
46
                                  'message': log.message.decode('utf-8'),
43
47
                                  'date': log.date,
44
 
                                  'paths': [(p.path, p.action)
 
48
                                  'paths': [(p.path.decode('utf-8'), p.action)
45
49
                                            for p in log.changed_paths]}
46
50
                                 for log in logs]})
47
51
except pysvn.ClientError, e: