Skip to content
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.

Commit

Permalink
moved unicode handling into backends.
Browse files Browse the repository at this point in the history
git-svn-id: https://django-rcsfield.googlecode.com/svn/trunk@49 d91cc5cc-1343-0410-b1ed-e1360c4e4ba3
  • Loading branch information
arneb committed Jul 31, 2008
1 parent 7aaf1cc commit b8d60db
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rcsfield/backends/bzr.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def fetch(self, key, rev):
finally:
# needed to leave the tree in a usable state.
rt.unlock()
return olddata
return unicode(olddata, 'utf-8')


def commit(self, key, data):
Expand Down
2 changes: 1 addition & 1 deletion rcsfield/backends/svn.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def fetch(self, key, rev):
c = pysvn.Client()
svnrev = pysvn.Revision(pysvn.opt_revision_kind.number, int(rev))
olddata = c.cat(os.path.join(settings.SVN_WC_PATH, key), revision = svnrev)
return olddata
return unicode(olddata, 'utf-8')


def commit(self, key, data):
Expand Down
2 changes: 1 addition & 1 deletion rcsfield/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def iterator(self):
file_path = '%s/%s/%s/%s.txt' % (obj._meta.app_label,obj.__class__.__name__, field.attname,obj.id)
try:
olddata = backend.fetch(file_path, self._rev)
setattr(obj, field.attname, unicode(olddata))
setattr(obj, field.attname, olddata)
except:
# for now just ignore errors raised in the backend
# and return the content from the db (aka head revision)
Expand Down

0 comments on commit b8d60db

Please sign in to comment.