mercurial/ui.py
changeset 49793 8147abc05794
parent 49306 2e726c934fcd
child 49794 25fe689a4a64
equal deleted inserted replaced
49783:e1953a34c110 49793:8147abc05794
  1793         # containing "$$" so let's try to find the first valid-looking
  1793         # containing "$$" so let's try to find the first valid-looking
  1794         # prompt to start parsing. Sadly, we also can't rely on
  1794         # prompt to start parsing. Sadly, we also can't rely on
  1795         # choices containing spaces, ASCII, or basically anything
  1795         # choices containing spaces, ASCII, or basically anything
  1796         # except an ampersand followed by a character.
  1796         # except an ampersand followed by a character.
  1797         m = re.match(br'(?s)(.+?)\$\$([^$]*&[^ $].*)', prompt)
  1797         m = re.match(br'(?s)(.+?)\$\$([^$]*&[^ $].*)', prompt)
       
  1798 
       
  1799         assert m is not None  # help pytype
       
  1800 
  1798         msg = m.group(1)
  1801         msg = m.group(1)
  1799         choices = [p.strip(b' ') for p in m.group(2).split(b'$$')]
  1802         choices = [p.strip(b' ') for p in m.group(2).split(b'$$')]
  1800 
  1803 
  1801         def choicetuple(s):
  1804         def choicetuple(s):
  1802             ampidx = s.index(b'&')
  1805             ampidx = s.index(b'&')