# HG changeset patch # User Terry Smith # Date 1189530834 14400 # Node ID ad8783fe20f73fb92c30cb7b36beb38dff3efcca # Parent b62a59fa9d26824ebc7b30645a02fc1e042d7f15 darcs2hg: Now detects and recovers from simple darcs conflicts. diff --git a/contrib/darcs2hg.py b/contrib/darcs2hg.py --- a/contrib/darcs2hg.py +++ b/contrib/darcs2hg.py @@ -15,6 +15,7 @@ import os, sys import tempfile import xml.dom.minidom as xml_dom from time import strptime, mktime +import re DARCS_REPO = None HG_REPO = None @@ -93,6 +94,10 @@ def darcs_tip(darcs_repo): def darcs_pull(hg_repo, darcs_repo, chash): old_tip = darcs_tip(darcs_repo) res = cmd("darcs pull \"%s\" --all --match=\"hash %s\"" % (darcs_repo, chash), hg_repo) + if re.search('^We have conflicts in the following files:$', res, re.MULTILINE): + print "Trying to revert files to work around conflict..." + rev_res = cmd ("darcs revert --all", hg_repo) + print rev_res print res new_tip = darcs_tip(darcs_repo) if not new_tip != old_tip + 1: