Mercurial > kallithea
comparison rhodecode/lib/utils.py @ 633:fcf599cd3404 beta
Move changes for git implementation
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 24 Oct 2010 22:27:28 +0200 |
parents | 05528ad948c4 |
children | ffd07396d315 |
comparison
equal
deleted
inserted
replaced
631:05528ad948c4 | 633:fcf599cd3404 |
---|---|
14 # | 14 # |
15 # You should have received a copy of the GNU General Public License | 15 # You should have received a copy of the GNU General Public License |
16 # along with this program; if not, write to the Free Software | 16 # along with this program; if not, write to the Free Software |
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | 17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
18 # MA 02110-1301, USA. | 18 # MA 02110-1301, USA. |
19 """ | |
20 Created on April 18, 2010 | |
21 Utilities for RhodeCode | |
22 @author: marcink | |
23 """ | |
24 | |
19 from UserDict import DictMixin | 25 from UserDict import DictMixin |
20 from mercurial import ui, config, hg | 26 from mercurial import ui, config, hg |
21 from mercurial.error import RepoError | 27 from mercurial.error import RepoError |
22 from rhodecode.model import meta | 28 from rhodecode.model import meta |
23 from rhodecode.model.caching_query import FromCache | 29 from rhodecode.model.caching_query import FromCache |
31 from vcs.utils.lazy import LazyProperty | 37 from vcs.utils.lazy import LazyProperty |
32 import datetime | 38 import datetime |
33 import logging | 39 import logging |
34 import os | 40 import os |
35 | 41 |
36 """ | |
37 Created on April 18, 2010 | |
38 Utilities for RhodeCode | |
39 @author: marcink | |
40 """ | |
41 | |
42 log = logging.getLogger(__name__) | 42 log = logging.getLogger(__name__) |
43 | 43 |
44 | 44 |
45 def get_repo_slug(request): | 45 def get_repo_slug(request): |
46 return request.environ['pylons.routes_dict'].get('repo_name') | 46 return request.environ['pylons.routes_dict'].get('repo_name') |
108 :param recursive: | 108 :param recursive: |
109 :param initial: | 109 :param initial: |
110 """ | 110 """ |
111 from vcs.utils.helpers import get_scm | 111 from vcs.utils.helpers import get_scm |
112 from vcs.exceptions import VCSError | 112 from vcs.exceptions import VCSError |
113 scm = get_scm(path) | 113 |
114 if scm: | 114 try: |
115 scm = get_scm(path) | |
116 except: | |
117 pass | |
118 else: | |
115 raise Exception('The given path %s should not be a repository got %s', | 119 raise Exception('The given path %s should not be a repository got %s', |
116 path, scm) | 120 path, scm) |
117 | 121 |
118 for dirpath in os.listdir(path): | 122 for dirpath in os.listdir(path): |
119 try: | 123 try: |