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
87f57a3b
Commit
87f57a3b
authored
Aug 27, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent too many push with push on commit
parent
2ce688bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
weblate/trans/models.py
weblate/trans/models.py
+9
-9
No files found.
weblate/trans/models.py
View file @
87f57a3b
...
...
@@ -601,7 +601,7 @@ class SubProject(models.Model):
# Commit any pending changes
if
force_commit
:
self
.
commit_pending
()
self
.
commit_pending
(
skip_push
=
True
)
# Do we have anything to push?
if
not
self
.
git_needs_push
():
...
...
@@ -668,19 +668,19 @@ class SubProject(models.Model):
'''
return
SubProject
.
objects
.
filter
(
repo
=
'weblate://%s/%s'
%
(
self
.
project
.
slug
,
self
.
slug
))
def
commit_pending
(
self
,
from_link
=
False
):
def
commit_pending
(
self
,
from_link
=
False
,
skip_push
=
False
):
'''
Checks whether there is any translation which needs commit.
'''
if
not
from_link
and
self
.
is_repo_link
():
return
self
.
get_linked_repo
().
commit_pending
(
True
)
return
self
.
get_linked_repo
().
commit_pending
(
True
,
skip_push
=
skip_push
)
for
translation
in
self
.
translation_set
.
all
():
translation
.
commit_pending
()
translation
.
commit_pending
(
skip_push
=
skip_push
)
# Process linked projects
for
sp
in
self
.
get_linked_childs
():
sp
.
commit_pending
(
True
)
sp
.
commit_pending
(
True
,
skip_push
=
skip_push
)
def
update_branch
(
self
,
request
=
None
):
'''
...
...
@@ -1259,7 +1259,7 @@ class Translation(models.Model):
except
IndexError
:
return
None
def
commit_pending
(
self
,
author
=
None
):
def
commit_pending
(
self
,
author
=
None
,
skip_push
=
False
):
'''
Commits any pending changes.
'''
...
...
@@ -1271,7 +1271,7 @@ class Translation(models.Model):
return
# Commit changes
self
.
git_commit
(
last
,
self
.
get_last_change
(),
True
,
True
)
self
.
git_commit
(
last
,
self
.
get_last_change
(),
True
,
True
,
skip_push
)
def
get_author_name
(
self
,
user
,
email
=
True
):
'''
...
...
@@ -1369,7 +1369,7 @@ class Translation(models.Model):
def
git_needs_push
(
self
):
return
self
.
subproject
.
git_needs_push
()
def
git_commit
(
self
,
author
,
timestamp
,
force_commit
=
False
,
sync
=
False
):
def
git_commit
(
self
,
author
,
timestamp
,
force_commit
=
False
,
sync
=
False
,
skip_push
=
False
):
'''
Wrapper for commiting translation to git.
...
...
@@ -1401,7 +1401,7 @@ class Translation(models.Model):
self
.
__git_commit
(
gitrepo
,
author
,
timestamp
,
sync
)
# Push if we should
if
self
.
subproject
.
project
.
push_on_commit
:
if
self
.
subproject
.
project
.
push_on_commit
and
not
skip_push
:
self
.
subproject
.
do_push
(
force_commit
=
False
)
return
True
...
...
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