Commit 71295ccd authored by Michal Čihař's avatar Michal Čihař

Implement pushgit command (issue #230)

This can be used to push changes upstream on commandline.
parent d8030a4f
......@@ -101,6 +101,17 @@ to date. Additionally you can limit languages to process with ``--lang``.
You can either define which project or subproject to update (eg.
``weblate/master``) or use ``--all`` to update all existing subprojects.
pushgit <project|project/subproject>
------------------------------------
.. django-admin:: pushgit
Pushes commited changes to upstream Git repository. With ``--force-commit``
it also commits any pending changes.
You can either define which project or subproject to update (eg.
``weblate/master``) or use ``--all`` to update all existing subprojects.
rebuild_index
-------------
......
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from trans.management.commands import WeblateCommand
from django.utils import timezone
from datetime import timedelta
from optparse import make_option
class Command(WeblateCommand):
help = 'pushes all changes to upstream respository'
option_list = WeblateCommand.option_list + (
make_option(
'--force-commit',
action='store_true',
dest='force_commit',
default=False,
help='Forces commiting pending changes'
),
)
def handle(self, *args, **options):
for subproject in self.get_subprojects(*args, **options):
subproject.do_push(force_commit=options['force_commit'])
......@@ -188,6 +188,10 @@ class CommitGitTest(CheckGitTest):
command_name = 'commitgit'
class PushGitTest(CheckGitTest):
command_name = 'pushgit'
class LoadTest(CheckGitTest):
command_name = 'loadpo'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment