mercurial/ui.py
changeset 35957 b62c4154bb28
parent 35956 fd54846e1f8e
child 35961 0ff41ced4c12
equal deleted inserted replaced
35956:fd54846e1f8e 35957:b62c4154bb28
   884 
   884 
   885         When labeling output for a specific command, a label of
   885         When labeling output for a specific command, a label of
   886         "cmdname.type" is recommended. For example, status issues
   886         "cmdname.type" is recommended. For example, status issues
   887         a label of "status.modified" for modified files.
   887         a label of "status.modified" for modified files.
   888         '''
   888         '''
   889         if self._buffers and not opts.get(r'prompt', False):
   889         if self._buffers:
   890             if self._bufferapplylabels:
   890             if self._bufferapplylabels:
   891                 label = opts.get(r'label', '')
   891                 label = opts.get(r'label', '')
   892                 self._buffers[-1].extend(self.label(a, label) for a in args)
   892                 self._buffers[-1].extend(self.label(a, label) for a in args)
   893             else:
   893             else:
   894                 self._buffers[-1].extend(args)
   894                 self._buffers[-1].extend(args)
   895         elif self._colormode == 'win32':
   895         else:
       
   896             self._writenobuf(*args, **opts)
       
   897 
       
   898     def _writenobuf(self, *args, **opts):
       
   899         if self._colormode == 'win32':
   896             # windows color printing is its own can of crab, defer to
   900             # windows color printing is its own can of crab, defer to
   897             # the color module and that is it.
   901             # the color module and that is it.
   898             color.win32print(self, self._write, *args, **opts)
   902             color.win32print(self, self._write, *args, **opts)
   899         else:
   903         else:
   900             msgs = args
   904             msgs = args
  1274         If ui is not interactive, the default is returned.
  1278         If ui is not interactive, the default is returned.
  1275         """
  1279         """
  1276         if not self.interactive():
  1280         if not self.interactive():
  1277             self.write(msg, ' ', default or '', "\n")
  1281             self.write(msg, ' ', default or '', "\n")
  1278             return default
  1282             return default
  1279         self.write(msg, label='ui.prompt', prompt=True)
  1283         self._writenobuf(msg, label='ui.prompt')
  1280         self.flush()
  1284         self.flush()
  1281         try:
  1285         try:
  1282             r = self._readline()
  1286             r = self._readline()
  1283             if not r:
  1287             if not r:
  1284                 r = default
  1288                 r = default