MCPcopy
hub / github.com/aiming-lab/AutoResearchClaw / resolve

Method resolve

researchclaw/overleaf/conflict.py:42–57  ·  view source on GitHub ↗

Resolve all conflicts in .tex files using the given strategy. strategy: "ours" keeps the local (AI) version, "theirs" keeps the remote (human) version

(self, repo_dir: Path, strategy: str = "ours")

Source from the content-addressed store, hash-verified

40 return conflicts
41
42 def resolve(self, repo_dir: Path, strategy: str = "ours") -> list[str]:
43 """Resolve all conflicts in .tex files using the given strategy.
44
45 strategy: "ours" keeps the local (AI) version,
46 "theirs" keeps the remote (human) version
47 """
48 resolved_files: list[str] = []
49 for tex in repo_dir.glob("**/*.tex"):
50 content = tex.read_text(encoding="utf-8", errors="replace")
51 if not _CONFLICT_MARKER.search(content):
52 continue
53 resolved = _resolve_content(content, strategy)
54 tex.write_text(resolved, encoding="utf-8")
55 resolved_files.append(str(tex.relative_to(repo_dir)))
56 logger.info("Resolved conflicts in %s (strategy=%s)", tex.name, strategy)
57 return resolved_files
58
59
60def _extract_conflicts(content: str) -> list[dict[str, str]]:

Callers 15

test_resolve_oursMethod · 0.95
test_resolve_theirsMethod · 0.95
run_ais_v2.pyFile · 0.80
_rename_t_to_ml.pyFile · 0.80
make_manifests.pyFile · 0.80
run_e2e_topic.pyFile · 0.80
run_baseline.pyFile · 0.80
run_bench.pyFile · 0.80
judge_manual.pyFile · 0.80

Calls 3

_resolve_contentFunction · 0.85
searchMethod · 0.45
appendMethod · 0.45

Tested by 3

test_resolve_oursMethod · 0.76
test_resolve_theirsMethod · 0.76