annotate rhodecode/lib/vcs/conf/settings.py @ 3797:d7488551578e beta

synced vcs with upstream - moved subprocessio module to VCS - many small changes to make embedded vcs as similar to to external lib - use only absolute imports - patch vcs config during load pylons env
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 27 Apr 2013 11:24:25 +0200
parents 324ac367a4da
children 7e5f8c12a3fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2007
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 import os
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2 import tempfile
3797
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 2007
diff changeset
3 from rhodecode.lib.vcs.utils import aslist
2007
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4 from rhodecode.lib.vcs.utils.paths import get_user_home
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6 abspath = lambda * p: os.path.abspath(os.path.join(*p))
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 VCSRC_PATH = os.environ.get('VCSRC_PATH')
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 if not VCSRC_PATH:
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11 HOME_ = get_user_home()
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12 if not HOME_:
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
13 HOME_ = tempfile.gettempdir()
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
14
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15 VCSRC_PATH = VCSRC_PATH or abspath(HOME_, '.vcsrc')
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
16 if os.path.isdir(VCSRC_PATH):
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
17 VCSRC_PATH = os.path.join(VCSRC_PATH, '__init__.py')
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
18
3797
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 2007
diff changeset
19 # list of default encoding used in safe_unicode/safe_str methods
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 2007
diff changeset
20 DEFAULT_ENCODINGS = aslist('utf8')
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 2007
diff changeset
21
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 2007
diff changeset
22 # path to git executable runned by run_git_command function
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 2007
diff changeset
23 GIT_EXECUTABLE_PATH = 'git'
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 2007
diff changeset
24 # can be also --branches --tags
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 2007
diff changeset
25 GIT_REV_FILTER = '--all'
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 2007
diff changeset
26
2007
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
27 BACKENDS = {
3797
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 2007
diff changeset
28 'hg': 'rhodecode.lib.vcs.backends.hg.MercurialRepository',
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 2007
diff changeset
29 'git': 'rhodecode.lib.vcs.backends.git.GitRepository',
2007
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
30 }
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
31
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
32 ARCHIVE_SPECS = {
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
33 'tar': ('application/x-tar', '.tar'),
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
34 'tbz2': ('application/x-bzip2', '.tar.bz2'),
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
35 'tgz': ('application/x-gzip', '.tar.gz'),
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
36 'zip': ('application/zip', '.zip'),
324ac367a4da Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
37 }