comparison 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
comparison
equal deleted inserted replaced
37127:6715e8035b4f 37128:6f570c501e3e
627 'backout') 627 'backout')
628 stats = mergemod.update(repo, parent, True, True, node, False) 628 stats = mergemod.update(repo, parent, True, True, node, False)
629 repo.setparents(op1, op2) 629 repo.setparents(op1, op2)
630 dsguard.close() 630 dsguard.close()
631 hg._showstats(repo, stats) 631 hg._showstats(repo, stats)
632 if stats[3]: 632 if stats.unresolvedcount:
633 repo.ui.status(_("use 'hg resolve' to retry unresolved " 633 repo.ui.status(_("use 'hg resolve' to retry unresolved "
634 "file merges\n")) 634 "file merges\n"))
635 return 1 635 return 1
636 finally: 636 finally:
637 ui.setconfig('ui', 'forcemerge', '', '') 637 ui.setconfig('ui', 'forcemerge', '', '')
2309 stats = mergemod.graft(repo, ctx, ctx.p1(), 2309 stats = mergemod.graft(repo, ctx, ctx.p1(),
2310 ['local', 'graft']) 2310 ['local', 'graft'])
2311 finally: 2311 finally:
2312 repo.ui.setconfig('ui', 'forcemerge', '', 'graft') 2312 repo.ui.setconfig('ui', 'forcemerge', '', 'graft')
2313 # report any conflicts 2313 # report any conflicts
2314 if stats[3] > 0: 2314 if stats.unresolvedcount > 0:
2315 # write out state for --continue 2315 # write out state for --continue
2316 nodelines = [repo[rev].hex() + "\n" for rev in revs[pos:]] 2316 nodelines = [repo[rev].hex() + "\n" for rev in revs[pos:]]
2317 repo.vfs.write('graftstate', ''.join(nodelines)) 2317 repo.vfs.write('graftstate', ''.join(nodelines))
2318 extra = '' 2318 extra = ''
2319 if opts.get('user'): 2319 if opts.get('user'):