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
17fb3253
Commit
17fb3253
authored
Apr 16, 2015
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
d15ba60b
22d323d1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
39 deletions
+39
-39
weblate/html/js/git-status.html
weblate/html/js/git-status.html
+4
-4
weblate/trans/management/commands/commit_pending.py
weblate/trans/management/commands/commit_pending.py
+1
-1
weblate/trans/models/project.py
weblate/trans/models/project.py
+6
-6
weblate/trans/models/subproject.py
weblate/trans/models/subproject.py
+10
-10
weblate/trans/models/translation.py
weblate/trans/models/translation.py
+6
-6
weblate/trans/tests/test_views.py
weblate/trans/tests/test_views.py
+12
-12
No files found.
weblate/html/js/git-status.html
View file @
17fb3253
{% load i18n %}
{% load translations %}
{% with object.
git
_needs_commit as needs_commit %}
{% with object.
repo
_needs_commit as needs_commit %}
<div
class=
"row"
>
<div
class=
"col-md-8"
>
...
...
@@ -18,13 +18,13 @@
<p><a
href=
"{% documentation "
faq
"
"
merge
"
%}"
>
{% trans "Check our FAQ for information how to resolve this." %}
</a></p>
</div>
{% else %}
{% if object.
git
_needs_merge %}
{% if object.
repo
_needs_merge %}
<div
class=
"alert alert-warning"
role=
"alert"
>
{% trans "The remote repository needs to be merged!" %}
</div>
{% endif %}
{% if object.
git
_needs_push %}
{% if object.
repo
_needs_push %}
<div
class=
"alert alert-warning"
role=
"alert"
>
{% trans "There are some new commits in the local repository!" %}
</div>
{% endif %}
{% if not needs_commit and not object.
git_needs_merge and not object.git
_needs_push %}
{% if not needs_commit and not object.
repo_needs_merge and not object.repo
_needs_push %}
<div
class=
"alert alert-success"
role=
"alert"
>
{% trans "The local repository is up to date." %}
</div>
{% endif %}
{% endif %}
...
...
weblate/trans/management/commands/commit_pending.py
View file @
17fb3253
...
...
@@ -42,7 +42,7 @@ class Command(WeblateLangCommand):
age
=
timezone
.
now
()
-
timedelta
(
hours
=
options
[
'age'
])
for
translation
in
self
.
get_translations
(
*
args
,
**
options
):
if
not
translation
.
git
_needs_commit
():
if
not
translation
.
repo
_needs_commit
():
continue
last_change
=
translation
.
last_change
...
...
weblate/trans/models/project.py
View file @
17fb3253
...
...
@@ -343,24 +343,24 @@ class Project(models.Model, PercentMixin, URLMixin, PathMixin):
"""
return
self
.
get_languages
().
count
()
def
git
_needs_commit
(
self
):
def
repo
_needs_commit
(
self
):
"""
Checks whether there are some not committed changes.
"""
for
component
in
self
.
subproject_set
.
all
():
if
component
.
git
_needs_commit
():
if
component
.
repo
_needs_commit
():
return
True
return
False
def
git
_needs_merge
(
self
):
def
repo
_needs_merge
(
self
):
for
component
in
self
.
subproject_set
.
all
():
if
component
.
git
_needs_merge
():
if
component
.
repo
_needs_merge
():
return
True
return
False
def
git
_needs_push
(
self
):
def
repo
_needs_push
(
self
):
for
component
in
self
.
subproject_set
.
all
():
if
component
.
git
_needs_push
():
if
component
.
repo
_needs_push
():
return
True
return
False
...
...
weblate/trans/models/subproject.py
View file @
17fb3253
...
...
@@ -651,7 +651,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
self
.
update_remote_branch
()
# do we have something to merge?
if
not
self
.
git
_needs_merge
()
and
method
!=
'rebase'
:
if
not
self
.
repo
_needs_merge
()
and
method
!=
'rebase'
:
return
True
# commit possible pending changes
...
...
@@ -667,7 +667,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
self
.
create_translations
(
request
=
request
)
# Push after possible merge
if
(
self
.
git
_needs_push
()
and
if
(
self
.
repo
_needs_push
()
and
ret
and
self
.
project
.
push_on_commit
and
self
.
can_push
()):
...
...
@@ -696,7 +696,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
self
.
commit_pending
(
request
,
skip_push
=
True
)
# Do we have anything to push?
if
not
self
.
git
_needs_push
():
if
not
self
.
repo
_needs_push
():
return
False
if
do_update
:
...
...
@@ -704,7 +704,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
self
.
do_update
(
request
)
# Were all changes merged?
if
self
.
git
_needs_merge
():
if
self
.
repo
_needs_merge
():
return
False
# Do actual push
...
...
@@ -1282,28 +1282,28 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
'''
return
self
.
translation_set
.
get_percents
()
def
git
_needs_commit
(
self
):
def
repo
_needs_commit
(
self
):
'''
Checks whether there are some not committed changes.
'''
if
self
.
is_repo_link
:
return
self
.
linked_subproject
.
git
_needs_commit
()
return
self
.
linked_subproject
.
repo
_needs_commit
()
return
self
.
repository
.
needs_commit
()
def
git
_needs_merge
(
self
):
def
repo
_needs_merge
(
self
):
'''
Checks whether there is something to merge from remote repository.
'''
if
self
.
is_repo_link
:
return
self
.
linked_subproject
.
git
_needs_merge
()
return
self
.
linked_subproject
.
repo
_needs_merge
()
return
self
.
repository
.
needs_merge
(
self
.
branch
)
def
git
_needs_push
(
self
):
def
repo
_needs_push
(
self
):
'''
Checks whether there is something to push to remote repository.
'''
if
self
.
is_repo_link
:
return
self
.
linked_subproject
.
git
_needs_push
()
return
self
.
linked_subproject
.
repo
_needs_push
()
return
self
.
repository
.
needs_push
(
self
.
branch
)
@
property
...
...
weblate/trans/models/translation.py
View file @
17fb3253
...
...
@@ -777,17 +777,17 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
if
sync
:
self
.
store_hash
()
def
git
_needs_commit
(
self
):
def
repo
_needs_commit
(
self
):
'''
Checks whether there are some not committed changes.
'''
return
self
.
repository
.
needs_commit
(
self
.
filename
)
def
git
_needs_merge
(
self
):
return
self
.
subproject
.
git
_needs_merge
()
def
repo
_needs_merge
(
self
):
return
self
.
subproject
.
repo
_needs_merge
()
def
git
_needs_push
(
self
):
return
self
.
subproject
.
git
_needs_push
()
def
repo
_needs_push
(
self
):
return
self
.
subproject
.
repo
_needs_push
()
def
git_commit
(
self
,
request
,
author
,
timestamp
,
force_commit
=
False
,
sync
=
False
,
skip_push
=
False
):
...
...
@@ -800,7 +800,7 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
translation rescan will be needed)
'''
# Is there something for commit?
if
not
self
.
git
_needs_commit
():
if
not
self
.
repo
_needs_commit
():
return
False
# Can we delay commit?
...
...
weblate/trans/tests/test_views.py
View file @
17fb3253
...
...
@@ -608,25 +608,25 @@ class EditTest(ViewTestCase):
)
# We should get to second message
self
.
assertRedirectsOffset
(
response
,
self
.
translate_url
,
1
)
self
.
assertTrue
(
self
.
translation
.
git
_needs_commit
())
self
.
assertTrue
(
self
.
subproject
.
git
_needs_commit
())
self
.
assertTrue
(
self
.
subproject
.
project
.
git
_needs_commit
())
self
.
assertTrue
(
self
.
translation
.
repo
_needs_commit
())
self
.
assertTrue
(
self
.
subproject
.
repo
_needs_commit
())
self
.
assertTrue
(
self
.
subproject
.
project
.
repo
_needs_commit
())
self
.
translation
.
commit_pending
(
self
.
get_request
(
'/'
))
self
.
assertFalse
(
self
.
translation
.
git
_needs_commit
())
self
.
assertFalse
(
self
.
subproject
.
git
_needs_commit
())
self
.
assertFalse
(
self
.
subproject
.
project
.
git
_needs_commit
())
self
.
assertFalse
(
self
.
translation
.
repo
_needs_commit
())
self
.
assertFalse
(
self
.
subproject
.
repo
_needs_commit
())
self
.
assertFalse
(
self
.
subproject
.
project
.
repo
_needs_commit
())
self
.
assertTrue
(
self
.
translation
.
git
_needs_push
())
self
.
assertTrue
(
self
.
subproject
.
git
_needs_push
())
self
.
assertTrue
(
self
.
subproject
.
project
.
git
_needs_push
())
self
.
assertTrue
(
self
.
translation
.
repo
_needs_push
())
self
.
assertTrue
(
self
.
subproject
.
repo
_needs_push
())
self
.
assertTrue
(
self
.
subproject
.
project
.
repo
_needs_push
())
self
.
translation
.
do_push
(
self
.
get_request
(
'/'
))
self
.
assertFalse
(
self
.
translation
.
git
_needs_push
())
self
.
assertFalse
(
self
.
subproject
.
git
_needs_push
())
self
.
assertFalse
(
self
.
subproject
.
project
.
git
_needs_push
())
self
.
assertFalse
(
self
.
translation
.
repo
_needs_push
())
self
.
assertFalse
(
self
.
subproject
.
repo
_needs_push
())
self
.
assertFalse
(
self
.
subproject
.
project
.
repo
_needs_push
())
def
test_auto
(
self
):
'''
...
...
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