Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/translate-toolkit-1.5.1/translate/storage/versioncontrol/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'translate-toolkit-1.5.1/translate/storage/versioncontrol/git.py')
-rw-r--r--translate-toolkit-1.5.1/translate/storage/versioncontrol/git.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/translate-toolkit-1.5.1/translate/storage/versioncontrol/git.py b/translate-toolkit-1.5.1/translate/storage/versioncontrol/git.py
index 41f6410..817ac38 100644
--- a/translate-toolkit-1.5.1/translate/storage/versioncontrol/git.py
+++ b/translate-toolkit-1.5.1/translate/storage/versioncontrol/git.py
@@ -69,6 +69,13 @@ class git(GenericRevisionControlSystem):
def commit(self, message=None, author=None):
"""Commits the file and supplies the given commit message if present"""
+ # pull first.
+ # This is required since a lot of updates happen outside the po/ directory
+ # and git won't push unless those are pulled in
+ command = self._get_git_command(["pull"])
+ exitcode, output_pull, error = run_command(command, self.root_dir)
+ if exitcode != 0:
+ raise IOError("[GIT] pull failed (%s): %s" % (command, error))
# add the file
command = self._get_git_command(["add", self.location_rel])
exitcode, output_add, error = run_command(command, self.root_dir)
@@ -95,7 +102,7 @@ class git(GenericRevisionControlSystem):
if exitcode != 0:
raise IOError("[GIT] push of ('%s', '%s') failed: %s" \
% (self.root_dir, self.location_rel, error))
- return output_add + output_commit + output_push
+ return output_pull + output_add + output_commit + output_push
def getcleanfile(self, revision=None):
"""Get a clean version of a file from the git repository"""