[PATCH 2 of 2] Revert repo when darcs pull reports conflict

Guy Brand gb at isis.u-strasbg.fr
Sun Feb 25 13:35:03 CST 2007


# HG changeset patch
# User Guy Brand <gb at isis.u-strasbg.fr>
# Date 1172431749 -3600
# Node ID a64dd0da774a6eda4a04acc588df7a72f875d7f5
# Parent  58c0b0dba8572908e6ad77a1e75166c2ccac1712
Revert repo when darcs pull reports conflict

diff -r 58c0b0dba857 -r a64dd0da774a contrib/darcs2hg.py
--- a/contrib/darcs2hg.py	Sun Feb 25 20:29:08 2007 +0100
+++ b/contrib/darcs2hg.py	Sun Feb 25 20:29:09 2007 +0100
@@ -94,6 +94,8 @@ def darcs_pull(hg_repo, darcs_repo, chas
 	old_tip = darcs_tip(darcs_repo)
 	res     = cmd("darcs pull \"%s\" --all --match=\"hash %s\"" % (darcs_repo, chash), hg_repo)
 	print res
+	if res.count('We have conflicts'):
+		cmd("darcs revert --all", hg_repo, silent=False)
 	new_tip = darcs_tip(darcs_repo)
 	if not new_tip != old_tip + 1:
 		error("Darcs pull did not work as expected: " + res)


More information about the Mercurial-devel mailing list