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
940e6780
Commit
940e6780
authored
Aug 22, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for pushing
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
13a6316f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
weblate/trans/tests/test_vcs.py
weblate/trans/tests/test_vcs.py
+5
-1
weblate/trans/vcs.py
weblate/trans/vcs.py
+9
-1
No files found.
weblate/trans/tests/test_vcs.py
View file @
940e6780
...
...
@@ -46,6 +46,10 @@ class VCSGitTest(RepoTestCase):
repo
.
last_remote_revision
)
def
test_
remote_upda
te
(
self
):
def
test_
update_remo
te
(
self
):
repo
=
GitRepository
.
clone
(
self
.
repo_path
,
self
.
_tempdir
)
repo
.
update_remote
()
def
test_push
(
self
):
repo
=
GitRepository
.
clone
(
self
.
repo_path
,
self
.
_tempdir
)
repo
.
push
(
'master'
)
weblate/trans/vcs.py
View file @
940e6780
...
...
@@ -40,6 +40,7 @@ class Repository(object):
_cmd_last_remote_revision
=
None
_cmd_clone
=
'clone'
_cmd_update_remote
=
None
_cmd_push
=
None
def
__init__
(
self
,
path
):
self
.
path
=
path
...
...
@@ -91,10 +92,16 @@ class Repository(object):
def
update_remote
(
self
):
"""
Updates remote
branch
.
Updates remote
repository
.
"""
self
.
_execute
(
self
.
_cmd_update_remote
)
def
push
(
self
,
branch
):
"""
Pushes given branch to remote repository.
"""
self
.
_execute
(
self
.
_cmd_push
+
[
branch
])
class
GitRepository
(
Repository
):
"""
...
...
@@ -108,3 +115,4 @@ class GitRepository(Repository):
'log'
,
'-n'
,
'1'
,
'--format=format:%H'
,
'@{upstream}'
]
_cmd_update_remote
=
[
'remote'
,
'update'
,
'origin'
]
_cmd_push
=
[
'push'
,
'origin'
]
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