comparison mercurial/merge.py @ 42057:566daffc607d

cleanup: use set literals where possible Differential Revision: https://phab.mercurial-scm.org/D6192
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 03 Apr 2019 11:21:27 -0700
parents 02fa567f8a3c
children 3a7efcbdf288
comparison
equal deleted inserted replaced
42056:4950ae4d034f 42057:566daffc607d
813 elif m == ACTION_LOCAL_DIR_RENAME_GET: 813 elif m == ACTION_LOCAL_DIR_RENAME_GET:
814 if _checkunknownfile(repo, wctx, mctx, f, args[0]): 814 if _checkunknownfile(repo, wctx, mctx, f, args[0]):
815 fileconflicts.add(f) 815 fileconflicts.add(f)
816 816
817 allconflicts = fileconflicts | pathconflicts 817 allconflicts = fileconflicts | pathconflicts
818 ignoredconflicts = set([c for c in allconflicts 818 ignoredconflicts = {c for c in allconflicts
819 if repo.dirstate._ignore(c)]) 819 if repo.dirstate._ignore(c)}
820 unknownconflicts = allconflicts - ignoredconflicts 820 unknownconflicts = allconflicts - ignoredconflicts
821 collectconflicts(ignoredconflicts, ignoredconfig) 821 collectconflicts(ignoredconflicts, ignoredconfig)
822 collectconflicts(unknownconflicts, unknownconfig) 822 collectconflicts(unknownconflicts, unknownconfig)
823 else: 823 else:
824 for f, (m, args, msg) in actions.iteritems(): 824 for f, (m, args, msg) in actions.iteritems():
1102 Filters out actions that can ignored because the repo is narrowed. 1102 Filters out actions that can ignored because the repo is narrowed.
1103 1103
1104 Raise an exception if the merge cannot be completed because the repo is 1104 Raise an exception if the merge cannot be completed because the repo is
1105 narrowed. 1105 narrowed.
1106 """ 1106 """
1107 nooptypes = set(['k']) # TODO: handle with nonconflicttypes 1107 nooptypes = {'k'} # TODO: handle with nonconflicttypes
1108 nonconflicttypes = set('a am c cm f g r e'.split()) 1108 nonconflicttypes = set('a am c cm f g r e'.split())
1109 # We mutate the items in the dict during iteration, so iterate 1109 # We mutate the items in the dict during iteration, so iterate
1110 # over a copy. 1110 # over a copy.
1111 for f, action in list(actions.items()): 1111 for f, action in list(actions.items()):
1112 if narrowmatch(f): 1112 if narrowmatch(f):