narrowcommands: remove an unrequired `repo.narrowpats` call
authorPulkit Goyal <pulkit@yandex-team.ru>
Fri, 30 Nov 2018 17:42:55 +0300
changeset 40766 773572e5cba2
parent 40765 7e6834ade51d
child 40767 33d30fb1e4ae
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
hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py	Thu Nov 29 16:44:01 2018 -0500
+++ b/hgext/narrow/narrowcommands.py	Fri Nov 30 17:42:55 2018 +0300
@@ -412,15 +412,13 @@
 
     # Only print the current narrowspec.
     if only_show:
-        include, exclude = repo.narrowpats
-
         ui.pager('tracked')
         fm = ui.formatter('narrow', opts)
-        for i in sorted(include):
+        for i in sorted(oldincludes):
             fm.startitem()
             fm.write('status', '%s ', 'I', label='narrow.included')
             fm.write('pat', '%s\n', i, label='narrow.included')
-        for i in sorted(exclude):
+        for i in sorted(oldexcludes):
             fm.startitem()
             fm.write('status', '%s ', 'X', label='narrow.excluded')
             fm.write('pat', '%s\n', i, label='narrow.excluded')