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
567fa230
Commit
567fa230
authored
May 21, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not hide failure from repository update
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
99e1eeab
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
weblate/trans/models/subproject.py
weblate/trans/models/subproject.py
+4
-1
weblate/trans/tests/test_remote.py
weblate/trans/tests/test_remote.py
+13
-0
No files found.
weblate/trans/models/subproject.py
View file @
567fa230
...
@@ -594,6 +594,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
...
@@ -594,6 +594,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
self
.
log_info
(
'update took %.2f seconds:'
,
timediff
)
self
.
log_info
(
'update took %.2f seconds:'
,
timediff
)
for
line
in
self
.
repository
.
last_output
.
splitlines
():
for
line
in
self
.
repository
.
last_output
.
splitlines
():
self
.
log_debug
(
'update: %s'
,
line
)
self
.
log_debug
(
'update: %s'
,
line
)
return
True
except
RepositoryException
as
error
:
except
RepositoryException
as
error
:
error_text
=
str
(
error
)
error_text
=
str
(
error
)
self
.
log_error
(
'failed to update repository: %s'
,
error_text
)
self
.
log_error
(
'failed to update repository: %s'
,
error_text
)
...
@@ -606,6 +607,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
...
@@ -606,6 +607,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
raise
ValidationError
(
raise
ValidationError
(
_
(
'Failed to fetch repository: %s'
)
%
error_text
_
(
'Failed to fetch repository: %s'
)
%
error_text
)
)
return
False
def
configure_repo
(
self
,
validate
=
False
):
def
configure_repo
(
self
,
validate
=
False
):
'''
'''
...
@@ -640,7 +642,8 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
...
@@ -640,7 +642,8 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
return
self
.
linked_subproject
.
do_update
(
request
)
return
self
.
linked_subproject
.
do_update
(
request
)
# pull remote
# pull remote
self
.
update_remote_branch
()
if
not
self
.
update_remote_branch
():
return
False
# do we have something to merge?
# do we have something to merge?
if
not
self
.
repo_needs_merge
()
and
method
!=
'rebase'
:
if
not
self
.
repo_needs_merge
()
and
method
!=
'rebase'
:
...
...
weblate/trans/tests/test_remote.py
View file @
567fa230
...
@@ -24,6 +24,8 @@ from weblate.trans.models import SubProject
...
@@ -24,6 +24,8 @@ from weblate.trans.models import SubProject
from
weblate.trans.tests.test_models
import
REPOWEB_URL
from
weblate.trans.tests.test_models
import
REPOWEB_URL
from
weblate.trans.tests.test_views
import
ViewTestCase
from
weblate.trans.tests.test_views
import
ViewTestCase
from
django.utils
import
timezone
from
django.utils
import
timezone
import
shutil
import
os
EXTRA_PO
=
'''
EXTRA_PO
=
'''
#: accounts/models.py:319 trans/views/basic.py:104 weblate/html/index.html:21
#: accounts/models.py:319 trans/views/basic.py:104 weblate/html/index.html:21
...
@@ -128,6 +130,17 @@ class MultiRepoTest(ViewTestCase):
...
@@ -128,6 +130,17 @@ class MultiRepoTest(ViewTestCase):
)
)
self
.
assertEqual
(
translation
.
translated
,
1
)
self
.
assertEqual
(
translation
.
translated
,
1
)
def
test_failed_update
(
self
):
"""Test failed remote update."""
if
os
.
path
.
exists
(
self
.
git_repo_path
):
shutil
.
rmtree
(
self
.
git_repo_path
)
if
os
.
path
.
exists
(
self
.
hg_repo_path
):
shutil
.
rmtree
(
self
.
hg_repo_path
)
translation
=
self
.
subproject
.
translation_set
.
get
(
language_code
=
'cs'
)
self
.
assertFalse
(
translation
.
do_update
(
self
.
request
))
def
test_update
(
self
):
def
test_update
(
self
):
'''
'''
Tests handling update in case remote has changed.
Tests handling update in case remote has changed.
...
...
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