[damned-lies] Pull from repo before trying to commit



commit 96935cabf87a9660e68ada9943c27b6111e9ed5c
Author: Claude Paroz <claude 2xlibre net>
Date:   Wed Feb 5 17:36:57 2014 +0100

    Pull from repo before trying to commit
    
    Fixes bug #723688. Prevents non fast-forward commits (which fail
    anyway).

 stats/models.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index 25204f4..13a767c 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -696,13 +696,17 @@ class Branch(models.Model):
                 'msg':     "Updated %s translation" % language.name,
             }
             with ModuleLock(self.module):
-                utils.run_shell_command("cd \"%(dest)s\" && git checkout %(branch)s" % var_dict, 
raise_on_error=True)
+                utils.run_shell_command(
+                    "cd \"%(dest)s\" && git checkout %(branch)s" % var_dict, raise_on_error=True)
+                utils.run_shell_command(
+                    "cd \"%(dest)s\" && git pull" % var_dict, raise_on_error=True)
 
                 # Copy file in repo
                 utils.copy_file(po_file, dest_path)
 
                 # git add file.po
-                utils.run_shell_command("cd \"%(dest)s\" && git add %(po_file)s" % var_dict, 
raise_on_error=True)
+                utils.run_shell_command(
+                    "cd \"%(dest)s\" && git add %(po_file)s" % var_dict, raise_on_error=True)
                 if not already_exist:
                     # Add locale to LINGUAS
                     linguas_file = os.path.join(commit_dir, "LINGUAS")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]