comparison mercurial/merge.py @ 36042:4fe2041007ed

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
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 11 Feb 2018 13:09:16 -0800
parents 46a54de96a54
children 60dd840a7fdb
comparison
equal deleted inserted replaced
36041:e3674c2a585c 36042:4fe2041007ed
971 invalidconflicts.add(p) 971 invalidconflicts.add(p)
972 972
973 # Rename all local conflicting files that have not been deleted. 973 # Rename all local conflicting files that have not been deleted.
974 for p in localconflicts: 974 for p in localconflicts:
975 if p not in deletedfiles: 975 if p not in deletedfiles:
976 ctxname = str(wctx).rstrip('+') 976 ctxname = bytes(wctx).rstrip('+')
977 pnew = util.safename(p, ctxname, wctx, set(actions.keys())) 977 pnew = util.safename(p, ctxname, wctx, set(actions.keys()))
978 actions[pnew] = ('pr', (p,), "local path conflict") 978 actions[pnew] = ('pr', (p,), "local path conflict")
979 actions[p] = ('p', (pnew, 'l'), "path conflict") 979 actions[p] = ('p', (pnew, 'l'), "path conflict")
980 980
981 if remoteconflicts: 981 if remoteconflicts:
982 # Check if all files in the conflicting directories have been removed. 982 # Check if all files in the conflicting directories have been removed.
983 ctxname = str(mctx).rstrip('+') 983 ctxname = bytes(mctx).rstrip('+')
984 for f, p in _filesindirs(repo, mf, remoteconflicts): 984 for f, p in _filesindirs(repo, mf, remoteconflicts):
985 if f not in deletedfiles: 985 if f not in deletedfiles:
986 m, args, msg = actions[p] 986 m, args, msg = actions[p]
987 pnew = util.safename(p, ctxname, wctx, set(actions.keys())) 987 pnew = util.safename(p, ctxname, wctx, set(actions.keys()))
988 if m in ('dc', 'm'): 988 if m in ('dc', 'm'):