Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 31479:96929bd6e58d
pager: skip running the pager if it's set to 'cat'
Avoid useless uses of cat.
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 15 Mar 2017 20:34:26 -0400 |
parents | 9335dc6b2a9c |
children | a7c687c35119 |
comparison
equal
deleted
inserted
replaced
31478:9335dc6b2a9c | 31479:96929bd6e58d |
---|---|
933 """Actually start the pager and set up file descriptors. | 933 """Actually start the pager and set up file descriptors. |
934 | 934 |
935 This is separate in part so that extensions (like chg) can | 935 This is separate in part so that extensions (like chg) can |
936 override how a pager is invoked. | 936 override how a pager is invoked. |
937 """ | 937 """ |
938 if command == 'cat': | |
939 # Save ourselves some work. | |
940 return | |
938 # If the command doesn't contain any of these characters, we | 941 # If the command doesn't contain any of these characters, we |
939 # assume it's a binary and exec it directly. This means for | 942 # assume it's a binary and exec it directly. This means for |
940 # simple pager command configurations, we can degrade | 943 # simple pager command configurations, we can degrade |
941 # gracefully and tell the user about their broken pager. | 944 # gracefully and tell the user about their broken pager. |
942 shell = any(c in command for c in "|&;<>()$`\\\"' \t\n*?[#~=%") | 945 shell = any(c in command for c in "|&;<>()$`\\\"' \t\n*?[#~=%") |