Mercurial > hg
comparison hgext/narrow/narrowcommands.py @ 40766:773572e5cba2
narrowcommands: remove an unrequired `repo.narrowpats` call
We call that few lines above and do nothing significant in between which can
change the narrowpats. So let's use values returned by that call.
Differential Revision: https://phab.mercurial-scm.org/D5348
author | Pulkit Goyal <pulkit@yandex-team.ru> |
---|---|
date | Fri, 30 Nov 2018 17:42:55 +0300 |
parents | a2c4502e409b |
children | 77173267878b |
comparison
equal
deleted
inserted
replaced
40765:7e6834ade51d | 40766:773572e5cba2 |
---|---|
410 widening = addedincludes or removedexcludes | 410 widening = addedincludes or removedexcludes |
411 narrowing = removedincludes or addedexcludes | 411 narrowing = removedincludes or addedexcludes |
412 | 412 |
413 # Only print the current narrowspec. | 413 # Only print the current narrowspec. |
414 if only_show: | 414 if only_show: |
415 include, exclude = repo.narrowpats | |
416 | |
417 ui.pager('tracked') | 415 ui.pager('tracked') |
418 fm = ui.formatter('narrow', opts) | 416 fm = ui.formatter('narrow', opts) |
419 for i in sorted(include): | 417 for i in sorted(oldincludes): |
420 fm.startitem() | 418 fm.startitem() |
421 fm.write('status', '%s ', 'I', label='narrow.included') | 419 fm.write('status', '%s ', 'I', label='narrow.included') |
422 fm.write('pat', '%s\n', i, label='narrow.included') | 420 fm.write('pat', '%s\n', i, label='narrow.included') |
423 for i in sorted(exclude): | 421 for i in sorted(oldexcludes): |
424 fm.startitem() | 422 fm.startitem() |
425 fm.write('status', '%s ', 'X', label='narrow.excluded') | 423 fm.write('status', '%s ', 'X', label='narrow.excluded') |
426 fm.write('pat', '%s\n', i, label='narrow.excluded') | 424 fm.write('pat', '%s\n', i, label='narrow.excluded') |
427 fm.end() | 425 fm.end() |
428 return 0 | 426 return 0 |