diff mercurial/commands.py @ 37128:6f570c501e3e

merge: deprecate accessing update results by index Now that we have named attributes, let's convert the code base to use them. We also add deprecation warnings so legacy consumers are aware of their transgressions. ``stats.unresolvedcount`` is much easier to read than ``stats[3]``, don't you think? Differential Revision: https://phab.mercurial-scm.org/D2694
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 05 Mar 2018 00:30:00 -0500
parents a8a902d7176e
children a2a6755a3def
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Mar 25 11:58:05 2018 +0900
+++ b/mercurial/commands.py	Mon Mar 05 00:30:00 2018 -0500
@@ -629,7 +629,7 @@
             repo.setparents(op1, op2)
             dsguard.close()
             hg._showstats(repo, stats)
-            if stats[3]:
+            if stats.unresolvedcount:
                 repo.ui.status(_("use 'hg resolve' to retry unresolved "
                                  "file merges\n"))
                 return 1
@@ -2311,7 +2311,7 @@
             finally:
                 repo.ui.setconfig('ui', 'forcemerge', '', 'graft')
             # report any conflicts
-            if stats[3] > 0:
+            if stats.unresolvedcount > 0:
                 # write out state for --continue
                 nodelines = [repo[rev].hex() + "\n" for rev in revs[pos:]]
                 repo.vfs.write('graftstate', ''.join(nodelines))