Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 38818:e411774a2e0f
narrow: move status-filtering to core and to ctx
One of my recent changes from repo.status(ctx1, ctx2) to
ctx1.status(ctx2) broke some of our Google-internal tests. The problem
turned out to be that the narrow extension was overriding
repo.status() to make it filter out paths outside the narrowspec. When
I changed to ctx1.status(ctx2), then that filtering obviously got
lost. ctx.status() seems like a better method to do the filtering in,
so this patch moves the filtering into that method, thereby also
moving it out of the extension and into core.
Differential Revision: https://phab.mercurial-scm.org/D4068
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 02 Aug 2018 23:50:47 -0700 |
parents | e7aa113b14f7 |
children | 2488dcfa71f8 |
comparison
equal
deleted
inserted
replaced
38817:32ece991955c | 38818:e411774a2e0f |
---|---|
370 clean=listclean, unknown=listunknown, | 370 clean=listclean, unknown=listunknown, |
371 listsubrepos=True) | 371 listsubrepos=True) |
372 for rfiles, sfiles in zip(r, s): | 372 for rfiles, sfiles in zip(r, s): |
373 rfiles.extend("%s/%s" % (subpath, f) for f in sfiles) | 373 rfiles.extend("%s/%s" % (subpath, f) for f in sfiles) |
374 | 374 |
375 narrowmatch = self._repo.narrowmatch() | |
376 if not narrowmatch.always(): | |
377 for l in r: | |
378 l[:] = list(filter(narrowmatch, l)) | |
375 for l in r: | 379 for l in r: |
376 l.sort() | 380 l.sort() |
377 | 381 |
378 return r | 382 return r |
379 | 383 |