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
85bb2a0f
Commit
85bb2a0f
authored
Apr 15, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store merge/rebase in changes history
Issue #554 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
b4da1c88
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
0 deletions
+52
-0
weblate/html/last-changes.html
weblate/html/last-changes.html
+5
-0
weblate/trans/migrations/0029_auto_20150415_1318.py
weblate/trans/migrations/0029_auto_20150415_1318.py
+19
-0
weblate/trans/models/changes.py
weblate/trans/models/changes.py
+12
-0
weblate/trans/models/subproject.py
weblate/trans/models/subproject.py
+16
-0
No files found.
weblate/html/last-changes.html
View file @
85bb2a0f
...
...
@@ -36,6 +36,11 @@
{% endif %}
</td>
</tr>
{% elif c.target %}
<tr>
<td
colspan=
"4"
><pre>
{{ c.target }}
</td>
<td></td>
</tr>
{% endif %}
{% empty %}
<tr><td
colspan=
"4"
class=
"tablenotice"
>
...
...
weblate/trans/migrations/0029_auto_20150415_1318.py
0 → 100644
View file @
85bb2a0f
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
models
,
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'trans'
,
'0028_auto_20150402_1430'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'change'
,
name
=
'action'
,
field
=
models
.
IntegerField
(
default
=
2
,
choices
=
[(
0
,
'Resource update'
),
(
1
,
'Translation completed'
),
(
2
,
'Translation changed'
),
(
5
,
'New translation'
),
(
3
,
'Comment added'
),
(
4
,
'Suggestion added'
),
(
6
,
'Automatic translation'
),
(
7
,
'Suggestion accepted'
),
(
8
,
'Translation reverted'
),
(
9
,
'Translation uploaded'
),
(
10
,
'Glossary added'
),
(
11
,
'Glossary updated'
),
(
12
,
'Glossary uploaded'
),
(
13
,
'New source string'
),
(
14
,
'Component locked'
),
(
15
,
'Component unlocked'
),
(
16
,
'Detected duplicate string'
),
(
17
,
'Commited changes'
),
(
18
,
'Pushed changes'
),
(
19
,
'Reset repository'
),
(
20
,
'Merged repository'
),
(
21
,
'Rebased repository'
),
(
22
,
'Failed merge on repository'
),
(
23
,
'Failed rebase on repository'
)]),
),
]
weblate/trans/models/changes.py
View file @
85bb2a0f
...
...
@@ -154,6 +154,10 @@ class Change(models.Model):
ACTION_COMMIT
=
17
ACTION_PUSH
=
18
ACTION_RESET
=
19
ACTION_MERGE
=
20
ACTION_REBASE
=
21
ACTION_FAILED_MERGE
=
22
ACTION_FAILED_REBASE
=
23
ACTION_CHOICES
=
(
(
ACTION_UPDATE
,
ugettext_lazy
(
'Resource update'
)),
...
...
@@ -176,6 +180,10 @@ class Change(models.Model):
(
ACTION_COMMIT
,
ugettext_lazy
(
'Commited changes'
)),
(
ACTION_PUSH
,
ugettext_lazy
(
'Pushed changes'
)),
(
ACTION_RESET
,
ugettext_lazy
(
'Reset repository'
)),
(
ACTION_MERGE
,
ugettext_lazy
(
'Merged repository'
)),
(
ACTION_REBASE
,
ugettext_lazy
(
'Rebased repository'
)),
(
ACTION_FAILED_MERGE
,
ugettext_lazy
(
'Failed merge on repository'
)),
(
ACTION_FAILED_REBASE
,
ugettext_lazy
(
'Failed rebase on repository'
)),
)
ACTIONS_SUBPROJECT
=
set
((
...
...
@@ -185,6 +193,10 @@ class Change(models.Model):
ACTION_DUPLICATE_STRING
,
ACTION_PUSH
,
ACTION_RESET
,
ACTION_MERGE
,
ACTION_REBASE
,
ACTION_FAILED_MERGE
,
ACTION_FAILED_REBASE
,
))
unit
=
models
.
ForeignKey
(
'Unit'
,
null
=
True
)
...
...
weblate/trans/models/subproject.py
View file @
85bb2a0f
...
...
@@ -814,9 +814,13 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
if
method
==
'rebase'
:
method
=
self
.
repository
.
rebase
error_msg
=
_
(
'Failed to rebase our branch onto remote branch %s.'
)
action
=
Change
.
ACTION_REBASE
action_failed
=
Change
.
ACTION_FAILED_REBASE
else
:
method
=
self
.
repository
.
merge
error_msg
=
_
(
'Failed to merge remote branch into %s.'
)
action
=
Change
.
ACTION_MERGE
action_failed
=
Change
.
ACTION_FAILED_MERGE
with
self
.
repository_lock
:
try
:
...
...
@@ -826,6 +830,11 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
'%s remote into repo'
,
self
.
merge_style
,
)
Change
.
objects
.
create
(
translation
=
self
.
translation_set
.
all
()[
0
],
user
=
request
.
user
if
request
else
None
,
action
=
action
,
)
return
True
except
RepositoryException
as
error
:
# In case merge has failer recover
...
...
@@ -842,6 +851,13 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
# Reset repo back
method
(
abort
=
True
)
Change
.
objects
.
create
(
translation
=
self
.
translation_set
.
all
()[
0
],
user
=
request
.
user
if
request
else
None
,
action
=
action_failed
,
target
=
str
(
error
),
)
# Notify subscribers and admins
self
.
notify_merge_failure
(
error
,
status
)
...
...
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