Browse Source

Merge "Set force_fetch=True on --fetch-missing-refs"

Jenkins 2 years ago
parent
commit
70b167ce6a
1 changed files with 11 additions and 4 deletions
  1. 11
    4
      gertty/sync.py

+ 11
- 4
gertty/sync.py View File

@@ -942,16 +942,21 @@ class CheckReposTask(Task):
942 942
                 except gitrepo.GitCloneError:
943 943
                     missing = True
944 944
                 if missing or app.fetch_missing_refs:
945
-                    sync.submitTask(CheckRevisionsTask(project.key,
946
-                                                       priority=LOW_PRIORITY))
945
+                    sync.submitTask(
946
+                        CheckRevisionsTask(project.key,
947
+                                           force_fetch=app.fetch_missing_refs,
948
+                                           priority=LOW_PRIORITY)
949
+                    )
947 950
             except Exception:
948 951
                 self.log.exception("Exception checking repo %s" %
949 952
                                    (project.name,))
950 953
 
951 954
 class CheckRevisionsTask(Task):
952
-    def __init__(self, project_key, priority=NORMAL_PRIORITY):
955
+    def __init__(self, project_key, force_fetch=False,
956
+                 priority=NORMAL_PRIORITY):
953 957
         super(CheckRevisionsTask, self).__init__(priority)
954 958
         self.project_key = project_key
959
+        self.force_fetch = force_fetch
955 960
 
956 961
     def __repr__(self):
957 962
         return '<CheckRevisionsTask %s>' % (self.project_key,)
@@ -981,7 +986,9 @@ class CheckRevisionsTask(Task):
981 986
                 else:
982 987
                     to_sync.add(change.id)
983 988
         for change_id in to_sync:
984
-            sync.submitTask(SyncChangeTask(change_id, priority=self.priority))
989
+            sync.submitTask(SyncChangeTask(change_id,
990
+                                           force_fetch=self.force_fetch,
991
+                                           priority=self.priority))
985 992
 
986 993
 class UploadReviewsTask(Task):
987 994
     def __repr__(self):

Loading…
Cancel
Save