Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
e4310902
Commit
e4310902
authored
Sep 26, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement getting git version in VCS module and use it
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
03596358
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
13 deletions
+24
-13
weblate/requirements.py
weblate/requirements.py
+7
-13
weblate/trans/tests/test_vcs.py
weblate/trans/tests/test_vcs.py
+3
-0
weblate/trans/vcs.py
weblate/trans/vcs.py
+14
-0
No files found.
weblate/requirements.py
View file @
e4310902
...
...
@@ -21,6 +21,7 @@
# For some reasons, this fails in PyLint sometimes...
# pylint: disable=E0611,F0401
from
distutils.version
import
LooseVersion
from
weblate.trans.vcs
import
GitRepository
import
importlib
import
sys
...
...
@@ -149,19 +150,12 @@ def get_versions():
'0.5.4'
,
))
name
=
'Git'
url
=
'http://git-scm.com/'
mod
=
get_version_module
(
'git'
,
name
,
url
)
try
:
result
.
append
((
name
,
url
,
mod
.
Git
().
version
().
replace
(
'git version '
,
''
),
'1.7.2'
,
))
except
TypeError
:
# Happens with too old GitPython
pass
result
.
append
((
'Git'
,
'http://git-scm.com/'
,
GitRepository
.
get_version
(),
'1.7.2'
,
))
name
=
'South'
url
=
'http://south.aeracode.org/'
...
...
weblate/trans/tests/test_vcs.py
View file @
e4310902
...
...
@@ -111,3 +111,6 @@ class VCSGitTest(RepoTestCase):
repo
=
GitRepository
.
clone
(
self
.
repo_path
,
self
.
_tempdir
)
self
.
assertFalse
(
repo
.
needs_merge
(
'master'
))
self
.
assertFalse
(
repo
.
needs_push
(
'master'
))
def
test_get_version
(
self
):
self
.
assertTrue
(
GitRepository
.
get_version
()
!=
''
)
weblate/trans/vcs.py
View file @
e4310902
...
...
@@ -164,6 +164,13 @@ class Repository(object):
"""
raise
NotImplementedError
()
@
classmethod
def
get_version
(
cls
):
"""
Returns VCS program version.
"""
return
cls
.
_popen
([
'--version'
])
class
GitRepository
(
Repository
):
"""
...
...
@@ -258,3 +265,10 @@ class GitRepository(Repository):
(has additional revisions).
"""
return
self
.
_log_revisions
(
'origin/{0}..'
.
format
(
branch
))
!=
''
@
classmethod
def
get_version
(
cls
):
"""
Returns VCS program version.
"""
return
cls
.
_popen
([
'--version'
]).
split
()[
-
1
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment