# HG changeset patch # User Gregory Szorc # Date 2018-02-11 21:09:16 # Node ID 4fe2041007ed78c846a8e9dc284f83c595870620 # Parent e3674c2a585c7a7bc3d5011e73e9b15384884f7d py3: use bytes() to cast context instances __str__ and __bytes__ are both implemented on context types. However, __str__ behaves differently on Python 2 and 3. Differential Revision: https://phab.mercurial-scm.org/D2143 diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -973,14 +973,14 @@ def checkpathconflicts(repo, wctx, mctx, # Rename all local conflicting files that have not been deleted. for p in localconflicts: if p not in deletedfiles: - ctxname = str(wctx).rstrip('+') + ctxname = bytes(wctx).rstrip('+') pnew = util.safename(p, ctxname, wctx, set(actions.keys())) actions[pnew] = ('pr', (p,), "local path conflict") actions[p] = ('p', (pnew, 'l'), "path conflict") if remoteconflicts: # Check if all files in the conflicting directories have been removed. - ctxname = str(mctx).rstrip('+') + ctxname = bytes(mctx).rstrip('+') for f, p in _filesindirs(repo, mf, remoteconflicts): if f not in deletedfiles: m, args, msg = actions[p]