keep track of edited files during reflections

This commit is contained in:
Paul Gauthier 2024-08-22 12:21:28 -07:00
parent 8c47b5e633
commit 72fd24e071
2 changed files with 7 additions and 3 deletions

View file

@ -1142,6 +1142,7 @@ class Coder:
return
edited = self.apply_updates()
dump(edited)
self.update_cur_messages()
@ -1753,7 +1754,9 @@ class Coder:
def update_files(self):
edits = self.get_edits()
dump("get", edits)
edits = self.prepare_to_edit(edits)
dump("prep", edits)
self.apply_edits(edits)
return set(edit[0] for edit in edits if edit[0])
@ -1771,11 +1774,11 @@ class Coder:
self.io.tool_error(str(err), strip=False)
self.reflected_message = str(err)
return
return edited
except git.exc.GitCommandError as err:
self.io.tool_error(str(err))
return
return edited
except Exception as err:
self.io.tool_error("Exception while updating files:")
self.io.tool_error(str(err), strip=False)
@ -1783,7 +1786,7 @@ class Coder:
traceback.print_exc()
self.reflected_message = str(err)
return
return edited
for path in edited:
if self.dry_run:

View file

@ -82,6 +82,7 @@ class EditBlockCoder(Coder):
new_content = do_replace(full_path, content, original, updated, self.fence)
if not new_content:
# try patching any of the other files in the chat
dump(self.abs_fnames)
for full_path in self.abs_fnames:
content = self.io.read_text(full_path)
new_content = do_replace(full_path, content, original, updated, self.fence)