Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/filemerge.py @ 26898:33eb8a56d0c9
filemerge: treat EOF at prompt as fail, not abort
Previously we'd abort the merge entirely if there was an EOF at the prompt.
This is unnecessary -- it's much better to simply fail and treat the file as
unresolved instead.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 10 Nov 2015 17:13:16 -0800 |
parents | 19c4b93cb7d6 |
children | 454deda24315 |
comparison
equal
deleted
inserted
replaced
26897:da1c706c9a35 | 26898:33eb8a56d0c9 |
---|---|
173 """Asks the user which of the local or the other version to keep as | 173 """Asks the user which of the local or the other version to keep as |
174 the merged version.""" | 174 the merged version.""" |
175 ui = repo.ui | 175 ui = repo.ui |
176 fd = fcd.path() | 176 fd = fcd.path() |
177 | 177 |
178 index = ui.promptchoice(_(" no tool found to merge %s\n" | 178 try: |
179 "keep (l)ocal or take (o)ther?" | 179 index = ui.promptchoice(_(" no tool found to merge %s\n" |
180 "$$ &Local $$ &Other") % fd, 0) | 180 "keep (l)ocal or take (o)ther?" |
181 choice = ['local', 'other'][index] | 181 "$$ &Local $$ &Other") % fd, 0) |
182 | 182 choice = ['local', 'other'][index] |
183 if choice == 'other': | 183 |
184 return _iother(repo, mynode, orig, fcd, fco, fca, toolconf) | 184 if choice == 'other': |
185 else: | 185 return _iother(repo, mynode, orig, fcd, fco, fca, toolconf) |
186 return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf) | 186 else: |
187 return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf) | |
188 except error.ResponseExpected: | |
189 ui.write("\n") | |
190 return 1 | |
187 | 191 |
188 @internaltool('local', nomerge) | 192 @internaltool('local', nomerge) |
189 def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf): | 193 def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf): |
190 """Uses the local version of files as the merged version.""" | 194 """Uses the local version of files as the merged version.""" |
191 return 0 | 195 return 0 |