From patchwork Mon Feb 26 05:16:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2442: filemerge: do what the context __bytes__ does, but locally From: phabricator X-Patchwork-Id: 28366 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Mon, 26 Feb 2018 05:16:37 +0000 durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY str() here is clearly the wrong thing, and I think the code is clearer when it doesn't just depend on the magic __{str,bytes}__ behavior. I decided to grep around for \sstr\( and see what low-hanging fruit that showed me. This was part of that hunt. That grep pattern still has some things worth exploring. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2442 AFFECTED FILES mercurial/filemerge.py CHANGE DETAILS To: durin42, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -520,8 +520,8 @@ baselabel = 'base' env = {'HG_FILE': fcd.path(), 'HG_MY_NODE': short(mynode), - 'HG_OTHER_NODE': str(fco.changectx()), - 'HG_BASE_NODE': str(fca.changectx()), + 'HG_OTHER_NODE': short(fco.changectx().node()), + 'HG_BASE_NODE': short(fca.changectx().node()), 'HG_MY_ISLINK': 'l' in fcd.flags(), 'HG_OTHER_ISLINK': 'l' in fco.flags(), 'HG_BASE_ISLINK': 'l' in fca.flags(),