Skip to content

Commit b0d21a1

Browse files
committed
Change: Disable git pull by default, github actions do that already.
1 parent 90c7fde commit b0d21a1

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

scripts/eintsgit.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,34 +208,41 @@ 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):
220223
print_info("Check updates from git")
221-
if git_pull(settings) or force:
224+
if pull and git_pull(settings) or force:
222225
print_info("Upload translations")
223226
eints_upload(settings)
224227
print_info("Done")
225228

226229

227-
def commit_eints_to_git(settings, dry_run):
230+
def commit_eints_to_git(settings, dry_run, pull):
228231
"""
229232
Perform the complete operation from commit Eints changes to the repository.
230233
231234
@param dry_run: Do not commit, leave as modified.
232235
@type dry_run: C{bool}
236+
237+
@param pull: Pull from remote, or use working copy as-it.
238+
@type pull: C{bool}
233239
"""
234240

235241
with FileLock(lock_file):
236242
# Upload first in any case.
237-
print_info("Update from git")
238-
git_pull(settings)
243+
if pull:
244+
print_info("Update from git")
245+
git_pull(settings)
239246
print_info("Upload/Merge translations")
240247
eints_upload(settings)
241248

@@ -267,6 +274,7 @@ def run():
267274
[
268275
"help",
269276
"force",
277+
"pull",
270278
"dry-run",
271279
"base-url=",
272280
"project=",
@@ -283,6 +291,7 @@ def run():
283291
# Parse options
284292
force = False
285293
dry_run = False
294+
pull = False
286295
settings = Settings()
287296

288297
for opt, val in opts:
@@ -302,6 +311,9 @@ def run():
302311
--force
303312
See individual operations below
304313
314+
--pull
315+
Update working copy from remote
316+
305317
--dry-run
306318
See individual operations below
307319
@@ -343,6 +355,10 @@ def run():
343355
force = True
344356
continue
345357

358+
if opt == "--pull":
359+
pull = True
360+
continue
361+
346362
if opt == "--dry-run":
347363
dry_run = True
348364
continue
@@ -395,10 +411,10 @@ def run():
395411

396412
# Execute operations
397413
if do_update:
398-
update_eints_from_git(settings, force)
414+
update_eints_from_git(settings, force, pull)
399415

400416
if do_commit:
401-
commit_eints_to_git(settings, dry_run)
417+
commit_eints_to_git(settings, dry_run, pull)
402418

403419
sys.exit(0)
404420

0 commit comments

Comments
 (0)