Mercurial > kallithea
changeset 1801:b6d23aa3754c beta
fixed problem with uploading files into rhodecode that wasn't detected as streams
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 21 Dec 2011 06:19:28 +0200 |
parents | 6c86c987cf93 |
children | 145677a36675 e84b3d98c07b |
files | rhodecode/model/scm.py |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/model/scm.py Wed Dec 21 02:56:39 2011 +0200 +++ b/rhodecode/model/scm.py Wed Dec 21 06:19:28 2011 +0200 @@ -26,6 +26,7 @@ import time import traceback import logging +import cStringIO from vcs import get_backend from vcs.exceptions import RepositoryError @@ -60,6 +61,7 @@ def __repr__(self): return "<%s('id:%s')>" % (self.__class__.__name__, self.repo_id) + class CachedRepoList(object): def __init__(self, db_repo_list, repos_path, order_by=None): @@ -112,6 +114,7 @@ tmp_d['dbrepo_fork'] = dbr.fork.get_dict() if dbr.fork else {} yield tmp_d + class ScmModel(BaseModel): """ Generic Scm Model @@ -359,8 +362,12 @@ if isinstance(content, (basestring,)): content = safe_str(content) - elif isinstance(content, file): + elif isinstance(content, (file, cStringIO.OutputType,)): content = content.read() + else: + raise Exception('Content is of unrecognized type %s' % ( + type(content) + )) message = safe_str(message) path = safe_str(f_path)