comparison mercurial/cmdutil.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 550a172a603b
children db72f9f6580e
comparison
equal deleted inserted replaced
42056:4950ae4d034f 42057:566daffc607d
456 dirnode object as the value 456 dirnode object as the value
457 """ 457 """
458 458
459 def __init__(self, dirpath): 459 def __init__(self, dirpath):
460 self.path = dirpath 460 self.path = dirpath
461 self.statuses = set([]) 461 self.statuses = set()
462 self.files = [] 462 self.files = []
463 self.subdirs = {} 463 self.subdirs = {}
464 464
465 def _addfileindir(self, filename, status): 465 def _addfileindir(self, filename, status):
466 """Add a file in this directory as a direct child.""" 466 """Add a file in this directory as a direct child."""
2493 date = old.date() 2493 date = old.date()
2494 2494
2495 if len(old.parents()) > 1: 2495 if len(old.parents()) > 1:
2496 # ctx.files() isn't reliable for merges, so fall back to the 2496 # ctx.files() isn't reliable for merges, so fall back to the
2497 # slower repo.status() method 2497 # slower repo.status() method
2498 files = set([fn for st in base.status(old)[:3] 2498 files = {fn for st in base.status(old)[:3] for fn in st}
2499 for fn in st])
2500 else: 2499 else:
2501 files = set(old.files()) 2500 files = set(old.files())
2502 2501
2503 # add/remove the files to the working copy if the "addremove" option 2502 # add/remove the files to the working copy if the "addremove" option
2504 # was specified. 2503 # was specified.