@@ -92,19 +92,24 @@ def update_is_required(self, force: bool = False) -> Optional[Version]:
9292 logger .debug (f"{ self .__project .name } Current ({ current } ), Available ({ wanted } )" )
9393 return wanted
9494
95- def update (self , force : bool = False ) -> None :
95+ def update (
96+ self , force : bool = False , files_to_ignore : Optional [Sequence [str ]] = None
97+ ) -> None :
9698 """Update this VCS if required.
9799
98100 Args:
99101 force (bool, optional): Ignore if version is ok or any local changes were done.
100102 Defaults to False.
103+ files_to_ignore (Sequence[str], optional): list of files that are ok to overwrite.
101104 """
102105 to_fetch = self .update_is_required (force )
103106
104107 if not to_fetch :
105108 return
106109
107- if not force and self ._are_there_local_changes ():
110+ files_to_ignore = files_to_ignore or []
111+
112+ if not force and self ._are_there_local_changes (files_to_ignore ):
108113 self ._log_project (
109114 "skipped - local changes after last update (use --force to overwrite)"
110115 )
@@ -151,7 +156,9 @@ def apply_patch(self) -> None:
151156 else :
152157 raise RuntimeError (f'Applying patch "{ self .__project .patch } " failed' )
153158
154- def check_for_update (self , reporters : Sequence [AbstractCheckReporter ]) -> None :
159+ def check_for_update (
160+ self , reporters : Sequence [AbstractCheckReporter ], files_to_ignore : Sequence [str ]
161+ ) -> None :
155162 """Check if there is an update available."""
156163 on_disk_version = self .on_disk_version ()
157164 with Halo (
@@ -177,7 +184,7 @@ def check_for_update(self, reporters: Sequence[AbstractCheckReporter]) -> None:
177184
178185 return
179186
180- if self ._are_there_local_changes ():
187+ if self ._are_there_local_changes (files_to_ignore ):
181188 for reporter in reporters :
182189 reporter .local_changes (self .__project )
183190
@@ -339,7 +346,7 @@ def _check_for_newer_version(self) -> Optional[Version]:
339346 revision = self ._latest_revision_on_branch (branch )
340347 return Version (revision = revision , branch = branch ) if revision else None
341348
342- def _are_there_local_changes (self ) -> bool :
349+ def _are_there_local_changes (self , files_to_ignore : Sequence [ str ] ) -> bool :
343350 """Check if there are local changes.
344351
345352 Returns:
@@ -349,7 +356,8 @@ def _are_there_local_changes(self) -> bool:
349356 on_disk_hash = self ._on_disk_hash ()
350357
351358 return bool (on_disk_hash ) and on_disk_hash != hash_directory (
352- self .local_path , skiplist = [self .__metadata .FILENAME ]
359+ self .local_path ,
360+ skiplist = [self .__metadata .FILENAME ] + list (files_to_ignore ),
353361 )
354362
355363 @abstractmethod
0 commit comments