Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 42566:f802a75da585
patch: use a short, fixed-size message for last line of prompt (issue6158)
See issue6158 and the previous commit for examples of what might go wrong if we
have some combinations of readline version and terminal and need to wrap the
line.
Briefly: readline may not display the beginning of the last line of the prompt,
or it may print over it with the end of the prompt, making it difficult for
users to know what's going on.
Differential Revision: https://phab.mercurial-scm.org/D6563
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Thu, 20 Jun 2019 14:45:52 -0700 |
parents | db72f9f6580e |
children | 1fd530b1e1cf |
comparison
equal
deleted
inserted
replaced
42565:4764e8436b2a | 42566:f802a75da585 |
---|---|
1087 return skipall, skipfile, skipall, newpatches | 1087 return skipall, skipfile, skipall, newpatches |
1088 if skipfile is not None: | 1088 if skipfile is not None: |
1089 return skipfile, skipfile, skipall, newpatches | 1089 return skipfile, skipfile, skipall, newpatches |
1090 while True: | 1090 while True: |
1091 resps = messages['help'][operation] | 1091 resps = messages['help'][operation] |
1092 r = ui.promptchoice("%s %s" % (query, resps)) | 1092 # IMPORTANT: keep the last line of this prompt short (<40 english |
1093 # chars is a good target) because of issue6158. | |
1094 r = ui.promptchoice("%s\n(enter ? for help) %s" % (query, resps)) | |
1093 ui.write("\n") | 1095 ui.write("\n") |
1094 if r == 8: # ? | 1096 if r == 8: # ? |
1095 for c, t in ui.extractchoices(resps)[1]: | 1097 for c, t in ui.extractchoices(resps)[1]: |
1096 ui.write('%s - %s\n' % (c, encoding.lower(t))) | 1098 ui.write('%s - %s\n' % (c, encoding.lower(t))) |
1097 continue | 1099 continue |