compat: directly use status attribute instead of the compat layer
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Mar 2020 11:06:37 +0100
changeset 5179 7c41a1ebcf7f
parent 5178 61e49d2654cc
child 5180 515d425c0a05
compat: directly use status attribute instead of the compat layer With 4.5 dropped, this compat layer is no longer needed.
hgext3rd/evolve/cmdrewrite.py
hgext3rd/evolve/compat.py
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/cmdrewrite.py	Tue Mar 10 11:07:34 2020 +0100
+++ b/hgext3rd/evolve/cmdrewrite.py	Tue Mar 10 11:06:37 2020 +0100
@@ -1497,7 +1497,7 @@
             with ui.configoverride(overrides, b'pick'):
                 stats = merge.graft(repo, origctx, origctx.p1(),
                                     [b'local', b'destination'])
-            if compat.hasconflict(stats):
+            if stats.unresolvedcount:
                 pickstate.addopts({b'orignode': origctx.node(),
                                    b'oldpctx': pctx.node()})
                 pickstate.save()
--- a/hgext3rd/evolve/compat.py	Tue Mar 10 11:07:34 2020 +0100
+++ b/hgext3rd/evolve/compat.py	Tue Mar 10 11:06:37 2020 +0100
@@ -159,11 +159,6 @@
 except AttributeError:
     bmrevset = scmutil.bookmarkrevs
 
-def hasconflict(upres):
-    if updateresult is None:
-        return bool(upres[-1])
-    return bool(upres.unresolvedcount)
-
 hg48 = util.safehasattr(copies, 'stringutil')
 # code imported from Mercurial core at ae17555ef93f + patch
 def fixedcopytracing(repo, c1, c2, base):
--- a/hgext3rd/evolve/evolvecmd.py	Tue Mar 10 11:07:34 2020 +0100
+++ b/hgext3rd/evolve/evolvecmd.py	Tue Mar 10 11:06:37 2020 +0100
@@ -608,7 +608,7 @@
         hg._showstats(repo, stats)
 
         # conflicts while merging content-divergent changesets
-        if compat.hasconflict(stats):
+        if stats.unresolvedcount:
             hint = _(b"see 'hg help evolve.interrupted'")
             raise error.InterventionRequired(_(b"unresolved merge conflicts"),
                                              hint=hint)
@@ -1013,7 +1013,7 @@
     tr = repo.currenttransaction()
     assert tr is not None
     r = _evolvemerge(repo, orig, dest, pctx, keepbranch)
-    if compat.hasconflict(r): # some conflict
+    if r.unresolvedcount: # some conflict
         with repo.dirstate.parentchange(), compat.parentchange(repo):
             repo.setparents(dest.node(), orig.node())
             repo.dirstate.write(tr)