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
779bcc87
Commit
779bcc87
authored
Mar 07, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save only if there are some changes and push on commit
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
e1036ef8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
examples/hook-update-resx
examples/hook-update-resx
+7
-1
No files found.
examples/hook-update-resx
View file @
779bcc87
...
...
@@ -25,17 +25,21 @@ def build_index(storage):
def
update_file
(
template
,
index
,
filename
):
storage
=
RESXFile
.
parsefile
(
filename
)
sindex
=
build_index
(
storage
)
changed
=
False
# Add missing units
for
unit
in
template
.
units
:
if
unit
.
getid
()
not
in
sindex
:
storage
.
addunit
(
unit
,
True
)
changed
=
True
# Remove extra units
for
unit
in
storage
.
units
:
if
unit
.
getid
()
not
in
index
:
storage
.
body
.
remove
(
unit
.
xmlelement
)
changed
=
True
if
changed
:
storage
.
save
()
...
...
@@ -71,6 +75,8 @@ def main():
ret
=
subprocess
.
call
(
[
'git'
,
'commit'
,
'-a'
,
'-m'
,
'Updated translation files'
]
)
if
ret
==
0
:
ret
=
subprocess
.
call
([
'git'
,
'push'
])
sys
.
exit
(
ret
)
...
...
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