##// END OF EJS Templates
i18n, record: improve use of translated docstring in prompts...
Martin Geisler -
r7015:6651de71 default
parent child Browse files
Show More
@@ -7,7 +7,7 b''
7
7
8 '''interactive change selection during commit or qrefresh'''
8 '''interactive change selection during commit or qrefresh'''
9
9
10 from mercurial.i18n import _
10 from mercurial.i18n import gettext, _
11 from mercurial import cmdutil, commands, extensions, hg, mdiff, patch
11 from mercurial import cmdutil, commands, extensions, hg, mdiff, patch
12 from mercurial import util
12 from mercurial import util
13 import copy, cStringIO, errno, operator, os, re, tempfile
13 import copy, cStringIO, errno, operator, os, re, tempfile
@@ -282,22 +282,24 b' def filterpatch(ui, chunks):'
282 if resp_file[0] is not None:
282 if resp_file[0] is not None:
283 return resp_file[0]
283 return resp_file[0]
284 while True:
284 while True:
285 r = (ui.prompt(query + _(' [Ynsfdaq?] '), '(?i)[Ynsfdaq?]?$')
285 choices = _('[Ynsfdaq?]')
286 or 'y').lower()
286 r = (ui.prompt("%s %s " % (query, choices), '(?i)%s?$' % choices)
287 if r == '?':
287 or _('y')).lower()
288 c = record.__doc__.find('y - record this change')
288 if r == _('?'):
289 for l in record.__doc__[c:].splitlines():
289 doc = gettext(record.__doc__)
290 if l: ui.write(_(l.strip()), '\n')
290 c = doc.find(_('y - record this change'))
291 for l in doc[c:].splitlines():
292 if l: ui.write(l.strip(), '\n')
291 continue
293 continue
292 elif r == 's':
294 elif r == _('s'):
293 r = resp_file[0] = 'n'
295 r = resp_file[0] = 'n'
294 elif r == 'f':
296 elif r == _('f'):
295 r = resp_file[0] = 'y'
297 r = resp_file[0] = 'y'
296 elif r == 'd':
298 elif r == _('d'):
297 r = resp_all[0] = 'n'
299 r = resp_all[0] = 'n'
298 elif r == 'a':
300 elif r == _('a'):
299 r = resp_all[0] = 'y'
301 r = resp_all[0] = 'y'
300 elif r == 'q':
302 elif r == _('q'):
301 raise util.Abort(_('user quit'))
303 raise util.Abort(_('user quit'))
302 return r
304 return r
303 while chunks:
305 while chunks:
@@ -315,7 +317,7 b' def filterpatch(ui, chunks):'
315 chunk.pretty(ui)
317 chunk.pretty(ui)
316 r = prompt(_('examine changes to %s?') %
318 r = prompt(_('examine changes to %s?') %
317 _(' and ').join(map(repr, chunk.files())))
319 _(' and ').join(map(repr, chunk.files())))
318 if r == 'y':
320 if r == _('y'):
319 applied[chunk.filename()] = [chunk]
321 applied[chunk.filename()] = [chunk]
320 if chunk.allhunks():
322 if chunk.allhunks():
321 applied[chunk.filename()] += consumefile()
323 applied[chunk.filename()] += consumefile()
@@ -327,7 +329,7 b' def filterpatch(ui, chunks):'
327 chunk.pretty(ui)
329 chunk.pretty(ui)
328 r = prompt(_('record this change to %r?') %
330 r = prompt(_('record this change to %r?') %
329 chunk.filename())
331 chunk.filename())
330 if r == 'y':
332 if r == _('y'):
331 if fixoffset:
333 if fixoffset:
332 chunk = copy.copy(chunk)
334 chunk = copy.copy(chunk)
333 chunk.toline += fixoffset
335 chunk.toline += fixoffset
General Comments 0
You need to be logged in to leave comments. Login now