comparison mercurial/filemerge.py @ 9048:86b4a9b0ddda

ui: extract choice from prompt avoid translating single characters (as l for _local or sym_link)
author Simon Heimberg <simohe@besonet.ch>
date Sun, 21 Jun 2009 01:13:19 +0200
parents 90f74b31ed4f
children 38b5d5e0efab
comparison
equal deleted inserted replaced
9047:8263d98ffb1c 9048:86b4a9b0ddda
143 ui.debug(_("picked tool '%s' for %s (binary %s symlink %s)\n") % 143 ui.debug(_("picked tool '%s' for %s (binary %s symlink %s)\n") %
144 (tool, fd, binary, symlink)) 144 (tool, fd, binary, symlink))
145 145
146 if not tool or tool == 'internal:prompt': 146 if not tool or tool == 'internal:prompt':
147 tool = "internal:local" 147 tool = "internal:local"
148 if ui.prompt(_(" no tool found to merge %s\n" 148 if ui.promptchoice(_(" no tool found to merge %s\n"
149 "keep (l)ocal or take (o)ther?") % fd, 149 "keep (l)ocal or take (o)ther?") % fd,
150 (_("&Local"), _("&Other")), _("l")) != _("l"): 150 (_("&Local"), _("&Other")), 0):
151 tool = "internal:other" 151 tool = "internal:other"
152 if tool == "internal:local": 152 if tool == "internal:local":
153 return 0 153 return 0
154 if tool == "internal:other": 154 if tool == "internal:other":
155 repo.wwrite(fd, fco.data(), fco.flags()) 155 repo.wwrite(fd, fco.data(), fco.flags())
211 if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data()): 211 if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data()):
212 r = 1 212 r = 1
213 213
214 if not r and _toolbool(ui, tool, "checkchanged"): 214 if not r and _toolbool(ui, tool, "checkchanged"):
215 if filecmp.cmp(repo.wjoin(fd), back): 215 if filecmp.cmp(repo.wjoin(fd), back):
216 if ui.prompt(_(" output file %s appears unchanged\n" 216 if ui.promptchoice(_(" output file %s appears unchanged\n"
217 "was merge successful (yn)?") % fd, 217 "was merge successful (yn)?") % fd,
218 (_("&Yes"), _("&No")), _("n")) != _("y"): 218 (_("&Yes"), _("&No")), 1):
219 r = 1 219 r = 1
220 220
221 if _toolbool(ui, tool, "fixeol"): 221 if _toolbool(ui, tool, "fixeol"):
222 _matcheol(repo.wjoin(fd), back) 222 _matcheol(repo.wjoin(fd), back)
223 223