github-backup 0.65.0__py3-none-any.whl → 0.65.1__py3-none-any.whl

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.
github_backup/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.65.0"
1
+ __version__ = "0.65.1"
@@ -2757,19 +2757,24 @@ def backup_issues(args, repo_cwd, repository, repos_template):
2757
2757
  stale_timelines = find_stale_timeline_issues(
2758
2758
  args, issue_cwd, repository, include_pulls=not should_include_pulls
2759
2759
  )
2760
- for number in sorted(stale_timelines - set(issues)):
2761
- try:
2762
- issues[number] = retrieve_data(
2763
- args, "{0}/{1}".format(_issue_template, number), paginated=False
2764
- )[0]
2765
- except (HTTPError, RepositoryUnavailableError, IndexError) as e:
2766
- # Deleted or transferred between the sweep and this fetch. The
2767
- # refresh is opportunistic, so skip rather than fail the run.
2768
- logger.warning(
2769
- "Unable to refresh cross-references for issue {0}: {1}".format(
2770
- number, e
2771
- )
2772
- )
2760
+
2761
+ # Issues selected only by the cross-reference sweep have not otherwise
2762
+ # changed. Reuse their complete stored payload and refresh only timeline_data.
2763
+ # Fetching the issue, comments, events and attachments again turns the first
2764
+ # --issue-timeline run into a near-full backup and can discard optional data
2765
+ # when the corresponding flags are absent.
2766
+ timeline_only_issues = stale_timelines - set(issues)
2767
+ for number in sorted(timeline_only_issues):
2768
+ existing = read_json_file_if_exists(
2769
+ "{0}/{1}.json".format(issue_cwd, number)
2770
+ )
2771
+ if existing is None:
2772
+ logger.warning(
2773
+ "Unable to refresh cross-references for issue {0}: "
2774
+ "stored issue data is unreadable".format(number)
2775
+ )
2776
+ continue
2777
+ issues[number] = existing
2773
2778
 
2774
2779
  if issues_skipped:
2775
2780
  issues_skipped_message = " (skipped {0} pull requests)".format(issues_skipped)
@@ -2784,6 +2789,7 @@ def backup_issues(args, repo_cwd, repository, repos_template):
2784
2789
  timeline_template = _issue_template + "/{0}/timeline"
2785
2790
  for number, issue in list(issues.items()):
2786
2791
  issue_file = "{0}/{1}.json".format(issue_cwd, number)
2792
+ timeline_only_refresh = number in timeline_only_issues
2787
2793
  if (
2788
2794
  args.incremental_by_files
2789
2795
  and os.path.isfile(issue_file)
@@ -2799,10 +2805,14 @@ def backup_issues(args, repo_cwd, repository, repos_template):
2799
2805
  )
2800
2806
  continue
2801
2807
 
2802
- if args.include_issue_comments or args.include_everything:
2808
+ if not timeline_only_refresh and (
2809
+ args.include_issue_comments or args.include_everything
2810
+ ):
2803
2811
  template = comments_template.format(number)
2804
2812
  issues[number]["comment_data"] = retrieve_data(args, template)
2805
- if args.include_issue_events or args.include_everything:
2813
+ if not timeline_only_refresh and (
2814
+ args.include_issue_events or args.include_everything
2815
+ ):
2806
2816
  template = events_template.format(number)
2807
2817
  issues[number]["event_data"] = retrieve_data(args, template)
2808
2818
  if include_timeline:
@@ -2815,7 +2825,7 @@ def backup_issues(args, repo_cwd, repository, repos_template):
2815
2825
  for item in retrieve_data(args, template)
2816
2826
  if item.get("event") != "commented"
2817
2827
  ]
2818
- if args.include_attachments:
2828
+ if args.include_attachments and not timeline_only_refresh:
2819
2829
  download_attachments(
2820
2830
  args, issue_cwd, issues[number], number, repository, item_type="issue"
2821
2831
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: github-backup
3
- Version: 0.65.0
3
+ Version: 0.65.1
4
4
  Summary: backup a github user or organization
5
5
  Home-page: http://github.com/josegonzalez/python-github-backup
6
6
  Author: Jose Diaz-Gonzalez
@@ -0,0 +1,12 @@
1
+ github_backup/__init__.py,sha256=rGqIS-DtyspfkizhuNt82yLT-d6kScjVTMqpbJpBReo,23
2
+ github_backup/__main__.py,sha256=3yorCiC63maaxbjdtaeAs-G-yAAxKSO3mprhGfa1Fho,271
3
+ github_backup/cli.py,sha256=JTiXPOvB8id8LopREOEd1W_FLvuf9SOZU5buMRPFd9U,2922
4
+ github_backup/github_backup.py,sha256=XZjLwdQ8OftyImqmW2zMgqn8sEfuhAfAvmfNhdxF23o,126671
5
+ github_backup/graphql_queries.py,sha256=XcAQyp9nF7Ip9UzxsrXMkl2pO-W7SK8hhO2oE9HVcmA,6658
6
+ github_backup-0.65.1.dist-info/licenses/LICENSE.txt,sha256=ML-pLyn1qtAKo_DHMcQ8-p7k3f8cp-IR-mf5B49R2rk,1085
7
+ github_backup-0.65.1.dist-info/METADATA,sha256=r2IogtJ7P6ZA7ITMRM6h3yXhCFy9y2OrINvzzkz-Js8,36048
8
+ github_backup-0.65.1.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
9
+ github_backup-0.65.1.dist-info/entry_points.txt,sha256=cLPKK7MqC77QVb6HnT2mnyL_f-ciavJG_Y9vVHlCF68,57
10
+ github_backup-0.65.1.dist-info/top_level.txt,sha256=Za6fKRAlxZ0b3ZBH_osPqklLe14LetdNAkvAQANT2AA,14
11
+ github_backup-0.65.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
12
+ github_backup-0.65.1.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- github_backup/__init__.py,sha256=eauVKKmGRrPjcW6OLz78zXL8jRoYaQPOL0tbet7E8Vo,23
2
- github_backup/__main__.py,sha256=3yorCiC63maaxbjdtaeAs-G-yAAxKSO3mprhGfa1Fho,271
3
- github_backup/cli.py,sha256=JTiXPOvB8id8LopREOEd1W_FLvuf9SOZU5buMRPFd9U,2922
4
- github_backup/github_backup.py,sha256=jDGgAnhT_vn7QUmEJ95hwe8jfuVc3dETyLblGSQTZ0k,126285
5
- github_backup/graphql_queries.py,sha256=XcAQyp9nF7Ip9UzxsrXMkl2pO-W7SK8hhO2oE9HVcmA,6658
6
- github_backup-0.65.0.dist-info/licenses/LICENSE.txt,sha256=ML-pLyn1qtAKo_DHMcQ8-p7k3f8cp-IR-mf5B49R2rk,1085
7
- github_backup-0.65.0.dist-info/METADATA,sha256=lWXqgFoH_QhZEHy0fsp8cs_Iu8McBJZ4bUDrOL2VDp8,36048
8
- github_backup-0.65.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
9
- github_backup-0.65.0.dist-info/entry_points.txt,sha256=cLPKK7MqC77QVb6HnT2mnyL_f-ciavJG_Y9vVHlCF68,57
10
- github_backup-0.65.0.dist-info/top_level.txt,sha256=Za6fKRAlxZ0b3ZBH_osPqklLe14LetdNAkvAQANT2AA,14
11
- github_backup-0.65.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
12
- github_backup-0.65.0.dist-info/RECORD,,