Mercurial > kallithea
annotate rhodecode/lib/vcs/__init__.py @ 2543:03a770980b55 beta
Synced vcs with upstream
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 04 Jul 2012 11:42:16 +0200 |
parents | 324ac367a4da |
children | d7488551578e |
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 # -*- coding: utf-8 -*- |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
2 """ |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
3 vcs |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
4 ~~~ |
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 Various version Control System (vcs) management abstraction layer for |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
7 Python. |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
8 |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
9 :created_on: Apr 8, 2010 |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
10 :copyright: (c) 2010-2011 by Marcin Kuzminski, Lukasz Balcerzak. |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
11 """ |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
12 |
2543
03a770980b55
Synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
2007
diff
changeset
|
13 VERSION = (0, 3, 0, 'dev') |
2007
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 __version__ = '.'.join((str(each) for each in VERSION[:4])) |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
16 |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
17 __all__ = [ |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
18 'get_version', 'get_repo', 'get_backend', |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
19 'VCSError', 'RepositoryError', 'ChangesetError'] |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
20 |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
21 import sys |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
22 from rhodecode.lib.vcs.backends import get_repo, get_backend |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
23 from rhodecode.lib.vcs.exceptions import VCSError, RepositoryError, ChangesetError |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
24 |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
25 |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
26 def get_version(): |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
27 """ |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
28 Returns shorter version (digit parts only) as string. |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
29 """ |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
30 return '.'.join((str(each) for each in VERSION[:3])) |
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 def main(argv=None): |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
33 if argv is None: |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
34 argv = sys.argv |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
35 from rhodecode.lib.vcs.cli import ExecutionManager |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
36 manager = ExecutionManager(argv) |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
37 manager.execute() |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
38 return 0 |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
39 |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
40 if __name__ == '__main__': |
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
41 sys.exit(main(sys.argv)) |