From 938fa8a446de3d1fbb50efc780577a1854ec6c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Fri, 24 Nov 2023 13:48:25 +0800 Subject: [PATCH] feat: git archive --- metagpt/software_company.py | 2 ++ metagpt/utils/git_repository.py | 1 + 2 files changed, 3 insertions(+) diff --git a/metagpt/software_company.py b/metagpt/software_company.py index d3c2c463b..5aa0864e0 100644 --- a/metagpt/software_company.py +++ b/metagpt/software_company.py @@ -59,4 +59,6 @@ class SoftwareCompany(BaseModel): logger.debug(f"{n_round=}") self._check_balance() await self.environment.run() + if CONFIG.git_repo: + CONFIG.git_repo.archive() return self.environment.history diff --git a/metagpt/utils/git_repository.py b/metagpt/utils/git_repository.py index c2eb2360e..660561bf3 100644 --- a/metagpt/utils/git_repository.py +++ b/metagpt/utils/git_repository.py @@ -151,6 +151,7 @@ class GitRepository: :param comments: Comments for the archive commit. """ + logger.info(f"Archive: {[list(self.changed_files.keys())]}") self.add_change(self.changed_files) self.commit(comments)