Compare commits

...

9 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
63441ebfbc Release version 0.41.0 2022-03-02 02:36:41 -05:00
Jose Diaz-Gonzalez
7ad324225e Merge pull request #191 from SkySoft-ATM/bug/lfs_mirror
git lfs clone does not respect --mirror
2022-03-02 02:34:17 -05:00
Louis Parisot
885e94a102 git lfs clone doe snot respect --mirror 2022-02-03 11:45:59 +01:00
Jose Diaz-Gonzalez
9e1800f56e Release version 0.40.2 2021-12-29 12:49:10 -05:00
Jose Diaz-Gonzalez
d057ee0d04 Merge pull request #186 from atinary-afoulon/patch-1
Fix lint issues raised by Flake8
2021-12-29 12:48:30 -05:00
atinary-afoulon
64562f2460 Fix lint issues raised by Flake8
According to job: 
[ https://app.circleci.com/pipelines/github/josegonzalez/python-github-backup/30/workflows/74eb93f2-2505-435d-b728-03b3cc04c14a/jobs/23 ]

Failed on the following checks:
./github_backup/github_backup.py:20:1: F811 redefinition of unused 'logging' from line 14
./github_backup/github_backup.py:45:1: E302 expected 2 blank lines, found 1
./github_backup/github_backup.py:136:20: E251 unexpected spaces around keyword / parameter equals
2021-12-13 14:33:21 +01:00
Jose Diaz-Gonzalez
f7f9ffd017 Release version 0.40.1 2021-09-22 12:29:08 -04:00
Jose Diaz-Gonzalez
048ef04e2a Merge pull request #180 from whwright/revert-to-fetch
Revert to fetch
2021-09-22 11:06:18 -04:00
Harrison Wright
b1acfed83a Revert to fetch 2021-07-14 10:53:14 -05:00
2 changed files with 9 additions and 8 deletions

View File

@@ -1 +1 @@
__version__ = '0.40.0' __version__ = '0.41.0'

View File

@@ -11,7 +11,6 @@ import datetime
import errno import errno
import getpass import getpass
import json import json
import logging
import os import os
import re import re
import select import select
@@ -42,6 +41,7 @@ FNULL = open(os.devnull, 'w')
def _get_log_date(): def _get_log_date():
return datetime.datetime.isoformat(datetime.datetime.now()) return datetime.datetime.isoformat(datetime.datetime.now())
def log_info(message): def log_info(message):
""" """
Log message (str) or messages (List[str]) to stdout Log message (str) or messages (List[str]) to stdout
@@ -133,7 +133,7 @@ def mask_password(url, secret='*****'):
return url.replace(parsed.password, secret) return url.replace(parsed.password, secret)
def parse_args(args = None): def parse_args(args=None):
parser = argparse.ArgumentParser(description='Backup a github account') parser = argparse.ArgumentParser(description='Backup a github account')
parser.add_argument('user', parser.add_argument('user',
metavar='USER', metavar='USER',
@@ -1098,7 +1098,7 @@ def fetch_repository(name,
if lfs_clone: if lfs_clone:
git_command = ['git', 'lfs', 'fetch', '--all', '--prune'] git_command = ['git', 'lfs', 'fetch', '--all', '--prune']
else: else:
git_command = ['git', 'pull', '--all', '--force', '--tags', '--prune'] git_command = ['git', 'fetch', '--all', '--force', '--tags', '--prune']
logging_subprocess(git_command, None, cwd=local_dir) logging_subprocess(git_command, None, cwd=local_dir)
else: else:
log_info('Cloning {0} repository from {1} to {2}'.format( log_info('Cloning {0} repository from {1} to {2}'.format(
@@ -1106,10 +1106,11 @@ def fetch_repository(name,
masked_remote_url, masked_remote_url,
local_dir)) local_dir))
if bare_clone: if bare_clone:
if lfs_clone:
git_command = ['git', 'lfs', 'clone', '--mirror', remote_url, local_dir]
else:
git_command = ['git', 'clone', '--mirror', remote_url, local_dir] git_command = ['git', 'clone', '--mirror', remote_url, local_dir]
logging_subprocess(git_command, None)
if lfs_clone:
git_command = ['git', 'lfs', 'fetch', '--all', '--prune']
logging_subprocess(git_command, None, cwd=local_dir)
else: else:
if lfs_clone: if lfs_clone:
git_command = ['git', 'lfs', 'clone', remote_url, local_dir] git_command = ['git', 'lfs', 'clone', remote_url, local_dir]