bup 0.13.3__tar.gz → 0.14.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bup-0.13.3/bup.egg-info → bup-0.14.0}/PKG-INFO +1 -1
- {bup-0.13.3 → bup-0.14.0}/bup/__version__.py +1 -1
- {bup-0.13.3 → bup-0.14.0}/bup/github_backup.py +21 -6
- {bup-0.13.3 → bup-0.14.0/bup.egg-info}/PKG-INFO +1 -1
- {bup-0.13.3 → bup-0.14.0}/LICENSE +0 -0
- {bup-0.13.3 → bup-0.14.0}/LICENSE.txt +0 -0
- {bup-0.13.3 → bup-0.14.0}/README.md +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/LICENSE +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/__init__.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/__main__.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/arguments.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/aws_cli.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/backup_types.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/bup.ico +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/bup.png +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/bup_base.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/cli/__init__.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/cli/cli_main.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/dynamodb_backup.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/gpl-3.0.md +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/gui/__init__.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/gui/about.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/gui/bup_dialog.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/gui/gui_icon.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/gui/gui_main.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/gui/log_widget.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/gui/preferences_widget.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/gui/run_backup_widget.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/log_routing.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/preferences.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/robust_os_calls.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/s3_backup.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup/ui_types.py +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup.egg-info/SOURCES.txt +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup.egg-info/dependency_links.txt +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup.egg-info/entry_points.txt +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup.egg-info/requires.txt +0 -0
- {bup-0.13.3 → bup-0.14.0}/bup.egg-info/top_level.txt +0 -0
- {bup-0.13.3 → bup-0.14.0}/pyproject.toml +0 -0
- {bup-0.13.3 → bup-0.14.0}/setup.cfg +0 -0
|
@@ -99,7 +99,7 @@ class GithubBackup(BupBase):
|
|
|
99
99
|
except GitCommandError as e:
|
|
100
100
|
self.warning_out(self.redact(f'could not pull "{repo_dir}" - will try to start over and do a clone of "{repo_owner_and_name},{e}","{__file__}"'))
|
|
101
101
|
|
|
102
|
-
# new to us (or the
|
|
102
|
+
# new to us (or the fetch/reset failed, e.g. a corrupt local clone) - clone the repo
|
|
103
103
|
if not pull_success:
|
|
104
104
|
try:
|
|
105
105
|
if repo_dir.exists():
|
|
@@ -145,6 +145,20 @@ class GithubBackup(BupBase):
|
|
|
145
145
|
except (GitCommandError, AttributeError, ValueError) as e:
|
|
146
146
|
log.warning(self.redact(f'could not set remote url for "{repo_dir}" : {e}'))
|
|
147
147
|
|
|
148
|
+
# A backup is a mirror: the goal is "local == remote, exactly", never to integrate histories.
|
|
149
|
+
# So this is fetch + hard reset to the remote-tracking ref (the model git itself uses for mirrors),
|
|
150
|
+
# not "git pull" - a merge would fail on any force-pushed branch (rebased feature branches,
|
|
151
|
+
# CI-owned branches such as gh-pages or badges, orphan branches) and trigger a needless full re-clone.
|
|
152
|
+
# One fetch per repo transfers every branch's objects in a single negotiation; --prune drops
|
|
153
|
+
# remote-tracking refs for branches deleted on GitHub so the local ref set stays honest.
|
|
154
|
+
self.info_out(f'git fetch "{repo_name}"')
|
|
155
|
+
try:
|
|
156
|
+
git_repo.git.fetch("--prune", "origin")
|
|
157
|
+
except GitCommandError as e:
|
|
158
|
+
# recoverable - the caller falls back to a fresh clone, and escalates to an error if that also fails
|
|
159
|
+
self.warning_out(self.redact(f"{repo_name} : {e}"))
|
|
160
|
+
return False
|
|
161
|
+
|
|
148
162
|
for branch in branches:
|
|
149
163
|
if self.stop_requested:
|
|
150
164
|
break
|
|
@@ -154,17 +168,18 @@ class GithubBackup(BupBase):
|
|
|
154
168
|
if branch_name.lower() == "main" or (main_branch is None and branch_name.lower() == "master"):
|
|
155
169
|
main_branch = branch
|
|
156
170
|
|
|
157
|
-
self.info_out(f'git
|
|
171
|
+
self.info_out(f'git reset "{repo_name}" branch:"{branch_name}"')
|
|
158
172
|
try:
|
|
159
173
|
git_repo.git.reset("--hard")
|
|
160
174
|
git_repo.git.clean("-fd")
|
|
161
|
-
git_repo.git.checkout(branch_name)
|
|
162
|
-
git_repo.git.
|
|
175
|
+
git_repo.git.checkout(branch_name) # creates a local tracking branch from origin/<name> on first sight
|
|
176
|
+
git_repo.git.reset("--hard", f"origin/{branch_name}")
|
|
177
|
+
git_repo.git.clean("-fd")
|
|
163
178
|
success = True
|
|
164
179
|
except GitCommandError as e:
|
|
165
180
|
if "did not match any file".lower() in str(e).lower():
|
|
166
181
|
# new branch with no files yet - skip it and continue with other branches
|
|
167
|
-
self.info_out(f"git
|
|
182
|
+
self.info_out(f"git reset {repo_name} branch:{branch_name} - no files")
|
|
168
183
|
continue
|
|
169
184
|
elif "would be overwritten by checkout" in str(e).lower():
|
|
170
185
|
# typically caused by CRLF line-ending normalization on Windows, not actual user edits
|
|
@@ -172,7 +187,7 @@ class GithubBackup(BupBase):
|
|
|
172
187
|
success = False
|
|
173
188
|
break
|
|
174
189
|
else:
|
|
175
|
-
# recoverable (e.g. a
|
|
190
|
+
# recoverable (e.g. a corrupt object store) -
|
|
176
191
|
# the caller falls back to a fresh clone, and escalates to an error if that also fails
|
|
177
192
|
self.warning_out(self.redact(f"{repo_name} : {e}"))
|
|
178
193
|
success = False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|