comparison rhodecode/controllers/files.py @ 4186:7e5f8c12a3fc kallithea-2.2.5-rebrand

First step in two-part process to rename directories to kallithea. This first step is to change all references in the files where they refer to the old directory name.
author Bradley M. Kuhn <bkuhn@sfconservancy.org>
date Wed, 02 Jul 2014 19:04:28 -0400
parents ffd45b185016
children
comparison
equal deleted inserted replaced
4185:aaa7c3331186 4186:7e5f8c12a3fc
10 # GNU General Public License for more details. 10 # GNU General Public License for more details.
11 # 11 #
12 # You should have received a copy of the GNU General Public License 12 # You should have received a copy of the GNU General Public License
13 # along with this program. If not, see <http://www.gnu.org/licenses/>. 13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 """ 14 """
15 rhodecode.controllers.files 15 kallithea.controllers.files
16 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
17 17
18 Files controller for RhodeCode 18 Files controller for RhodeCode
19 19
20 :created_on: Apr 21, 2010 20 :created_on: Apr 21, 2010
31 import shutil 31 import shutil
32 32
33 from pylons import request, response, tmpl_context as c, url 33 from pylons import request, response, tmpl_context as c, url
34 from pylons.i18n.translation import _ 34 from pylons.i18n.translation import _
35 from pylons.controllers.util import redirect 35 from pylons.controllers.util import redirect
36 from rhodecode.lib.utils import jsonify, action_logger 36 from kallithea.lib.utils import jsonify, action_logger
37 37
38 from rhodecode.lib import diffs 38 from kallithea.lib import diffs
39 from rhodecode.lib import helpers as h 39 from kallithea.lib import helpers as h
40 40
41 from rhodecode.lib.compat import OrderedDict 41 from kallithea.lib.compat import OrderedDict
42 from rhodecode.lib.utils2 import convert_line_endings, detect_mode, safe_str,\ 42 from kallithea.lib.utils2 import convert_line_endings, detect_mode, safe_str,\
43 str2bool 43 str2bool
44 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator 44 from kallithea.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
45 from rhodecode.lib.base import BaseRepoController, render 45 from kallithea.lib.base import BaseRepoController, render
46 from rhodecode.lib.vcs.backends.base import EmptyChangeset 46 from kallithea.lib.vcs.backends.base import EmptyChangeset
47 from rhodecode.lib.vcs.conf import settings 47 from kallithea.lib.vcs.conf import settings
48 from rhodecode.lib.vcs.exceptions import RepositoryError, \ 48 from kallithea.lib.vcs.exceptions import RepositoryError, \
49 ChangesetDoesNotExistError, EmptyRepositoryError, \ 49 ChangesetDoesNotExistError, EmptyRepositoryError, \
50 ImproperArchiveTypeError, VCSError, NodeAlreadyExistsError,\ 50 ImproperArchiveTypeError, VCSError, NodeAlreadyExistsError,\
51 NodeDoesNotExistError, ChangesetError, NodeError 51 NodeDoesNotExistError, ChangesetError, NodeError
52 from rhodecode.lib.vcs.nodes import FileNode 52 from kallithea.lib.vcs.nodes import FileNode
53 53
54 from rhodecode.model.repo import RepoModel 54 from kallithea.model.repo import RepoModel
55 from rhodecode.model.scm import ScmModel 55 from kallithea.model.scm import ScmModel
56 from rhodecode.model.db import Repository 56 from kallithea.model.db import Repository
57 57
58 from rhodecode.controllers.changeset import anchor_url, _ignorews_url,\ 58 from kallithea.controllers.changeset import anchor_url, _ignorews_url,\
59 _context_url, get_line_ctx, get_ignore_ws 59 _context_url, get_line_ctx, get_ignore_ws
60 from webob.exc import HTTPNotFound 60 from webob.exc import HTTPNotFound
61 from rhodecode.lib.exceptions import NonRelativePathError, IMCCommitError 61 from kallithea.lib.exceptions import NonRelativePathError, IMCCommitError
62 62
63 63
64 log = logging.getLogger(__name__) 64 log = logging.getLogger(__name__)
65 65
66 66
534 except EmptyRepositoryError: 534 except EmptyRepositoryError:
535 return _('Empty repository') 535 return _('Empty repository')
536 except (ImproperArchiveTypeError, KeyError): 536 except (ImproperArchiveTypeError, KeyError):
537 return _('Unknown archive type') 537 return _('Unknown archive type')
538 # archive cache 538 # archive cache
539 from rhodecode import CONFIG 539 from kallithea import CONFIG
540 rev_name = cs.raw_id[:12] 540 rev_name = cs.raw_id[:12]
541 archive_name = '%s-%s%s' % (safe_str(repo_name.replace('/', '_')), 541 archive_name = '%s-%s%s' % (safe_str(repo_name.replace('/', '_')),
542 safe_str(rev_name), ext) 542 safe_str(rev_name), ext)
543 543
544 use_cached_archive = False # defines if we use cached version of archive 544 use_cached_archive = False # defines if we use cached version of archive