@@ -208,34 +208,44 @@ def eints_download(settings, credits_file):
208208 )
209209
210210
211- def update_eints_from_git (settings , force ):
211+ def update_eints_from_git (settings , force , pull ):
212212 """
213213 Perform the complete operation from syncing Eints from the repository.
214214
215215 @param force: Upload even if no changes.
216216 @type force: C{bool}
217+
218+ @param pull: Pull from remote, or use working copy as-it.
219+ @type pull: C{bool}
217220 """
218221
219222 with FileLock (lock_file ):
220- print_info ("Check updates from git" )
221- if git_pull (settings ) or force :
223+ has_changes = False
224+ if pull :
225+ print_info ("Check updates from git" )
226+ has_changes = git_pull (settings )
227+ if has_changes or force :
222228 print_info ("Upload translations" )
223229 eints_upload (settings )
224230 print_info ("Done" )
225231
226232
227- def commit_eints_to_git (settings , dry_run ):
233+ def commit_eints_to_git (settings , dry_run , pull ):
228234 """
229235 Perform the complete operation from commit Eints changes to the repository.
230236
231237 @param dry_run: Do not commit, leave as modified.
232238 @type dry_run: C{bool}
239+
240+ @param pull: Pull from remote, or use working copy as-it.
241+ @type pull: C{bool}
233242 """
234243
235244 with FileLock (lock_file ):
236245 # Upload first in any case.
237- print_info ("Update from git" )
238- git_pull (settings )
246+ if pull :
247+ print_info ("Update from git" )
248+ git_pull (settings )
239249 print_info ("Upload/Merge translations" )
240250 eints_upload (settings )
241251
@@ -267,6 +277,7 @@ def run():
267277 [
268278 "help" ,
269279 "force" ,
280+ "pull" ,
270281 "dry-run" ,
271282 "base-url=" ,
272283 "project=" ,
@@ -283,6 +294,7 @@ def run():
283294 # Parse options
284295 force = False
285296 dry_run = False
297+ pull = False
286298 settings = Settings ()
287299
288300 for opt , val in opts :
@@ -302,6 +314,9 @@ def run():
302314--force
303315 See individual operations below
304316
317+ --pull
318+ Update working copy from remote
319+
305320--dry-run
306321 See individual operations below
307322
@@ -343,6 +358,10 @@ def run():
343358 force = True
344359 continue
345360
361+ if opt == "--pull" :
362+ pull = True
363+ continue
364+
346365 if opt == "--dry-run" :
347366 dry_run = True
348367 continue
@@ -395,10 +414,10 @@ def run():
395414
396415 # Execute operations
397416 if do_update :
398- update_eints_from_git (settings , force )
417+ update_eints_from_git (settings , force , pull )
399418
400419 if do_commit :
401- commit_eints_to_git (settings , dry_run )
420+ commit_eints_to_git (settings , dry_run , pull )
402421
403422 sys .exit (0 )
404423
0 commit comments