Mercurial > hg
comparison mercurial/scmutil.py @ 36338:ddd9474d2e08
walkrepos: don't reimplement any()
Differential Revision: https://phab.mercurial-scm.org/D2371
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 06 Feb 2018 08:48:05 -0800 |
parents | 3f98634b6572 |
children | 04c319a07c7b |
comparison
equal
deleted
inserted
replaced
36337:0f36926b2651 | 36338:ddd9474d2e08 |
---|---|
355 if err.filename == path: | 355 if err.filename == path: |
356 raise err | 356 raise err |
357 samestat = getattr(os.path, 'samestat', None) | 357 samestat = getattr(os.path, 'samestat', None) |
358 if followsym and samestat is not None: | 358 if followsym and samestat is not None: |
359 def adddir(dirlst, dirname): | 359 def adddir(dirlst, dirname): |
360 match = False | |
361 dirstat = os.stat(dirname) | 360 dirstat = os.stat(dirname) |
362 for lstdirstat in dirlst: | 361 match = any(samestat(dirstat, lstdirstat) for lstdirstat in dirlst) |
363 if samestat(dirstat, lstdirstat): | |
364 match = True | |
365 break | |
366 if not match: | 362 if not match: |
367 dirlst.append(dirstat) | 363 dirlst.append(dirstat) |
368 return not match | 364 return not match |
369 else: | 365 else: |
370 followsym = False | 366 followsym = False |