mercurial/ui.py
changeset 9312 c5f0825c1dbb
parent 9153 6adc899c98d0
child 9398 3fb8c6dbeeec
equal deleted inserted replaced
9311:e37e9904bf10 9312:c5f0825c1dbb
   286 
   286 
   287     def promptchoice(self, msg, choices, default=0):
   287     def promptchoice(self, msg, choices, default=0):
   288         """Prompt user with msg, read response, and ensure it matches
   288         """Prompt user with msg, read response, and ensure it matches
   289         one of the provided choices. The index of the choice is returned.
   289         one of the provided choices. The index of the choice is returned.
   290         choices is a sequence of acceptable responses with the format:
   290         choices is a sequence of acceptable responses with the format:
   291         ('&None', 'E&xec', 'Sym&link') Responses are case insensitive. 
   291         ('&None', 'E&xec', 'Sym&link') Responses are case insensitive.
   292         If ui is not interactive, the default is returned.
   292         If ui is not interactive, the default is returned.
   293         """
   293         """
   294         resps = [s[s.index('&')+1].lower() for s in choices]
   294         resps = [s[s.index('&')+1].lower() for s in choices]
   295         while True:
   295         while True:
   296             r = self.prompt(msg, resps[default])
   296             r = self.prompt(msg, resps[default])