From bc2d071880a64e376f338458662768875ba9b68f Mon Sep 17 00:00:00 2001 From: Sayamindu Dasgupta Date: Sat, 09 Jan 2010 09:14:26 +0000 Subject: Apply pull before push patch to translate 1.5.1 --- 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""" -- cgit v0.9.1