Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
| hg-reviewers |
| Automatic diff as part of commit; lint not applicable. |
| Automatic diff as part of commit; unit tests not applicable. |
| labels.append('base') | labels.append('base') | ||||
| r = simplemerge.simplemerge(ui, fcd, fca, fco, | r = simplemerge.simplemerge(ui, fcd, fca, fco, | ||||
| quiet=True, label=labels, repo=repo) | quiet=True, label=labels, repo=repo) | ||||
| if not r: | if not r: | ||||
| ui.debug(" premerge successful\n") | ui.debug(" premerge successful\n") | ||||
| return 0 | return 0 | ||||
| if premerge not in validkeep: | if premerge not in validkeep: | ||||
| # restore from backup and try again | # restore from backup and try again | ||||
| # TODO: Add a workingfilectx.write(otherfilectx) path so we can use | _restorebackup(fcd, back) | ||||
| # util.copy here instead. | |||||
| fcd.write(util.readfile(back), fcd.flags()) | |||||
| return 1 # continue merging | return 1 # continue merging | ||||
| def _mergecheck(repo, mynode, orig, fcd, fco, fca, toolconf): | def _mergecheck(repo, mynode, orig, fcd, fco, fca, toolconf): | ||||
| tool, toolpath, binary, symlink = toolconf | tool, toolpath, binary, symlink = toolconf | ||||
| if symlink: | if symlink: | ||||
| repo.ui.warn(_('warning: internal %s cannot merge symlinks ' | repo.ui.warn(_('warning: internal %s cannot merge symlinks ' | ||||
| 'for %s\n') % (tool, fcd.path())) | 'for %s\n') % (tool, fcd.path())) | ||||
| return False | return False | ||||
| "o": "", | "o": "", | ||||
| } | } | ||||
| return { | return { | ||||
| "l": " [%s]" % labels[0], | "l": " [%s]" % labels[0], | ||||
| "o": " [%s]" % labels[1], | "o": " [%s]" % labels[1], | ||||
| } | } | ||||
| def _restorebackup(fcd, back): | |||||
| # TODO: Add a workingfilectx.write(otherfilectx) path so we can use | |||||
| # util.copy here instead. | |||||
| fcd.write(util.readfile(back), fcd.flags()) | |||||
| def _makebackup(repo, ui, fcd, premerge): | def _makebackup(repo, ui, fcd, premerge): | ||||
| """Makes a backup of the local `fcd` file prior to merging. | """Makes a backup of the local `fcd` file prior to merging. | ||||
| In addition to preserving the user's pre-existing modifications to `fcd` | In addition to preserving the user's pre-existing modifications to `fcd` | ||||
| (if any), the backup is used to undo certain premerges, confirm whether a | (if any), the backup is used to undo certain premerges, confirm whether a | ||||
| merge changed anything, and determine what line endings the new file should | merge changed anything, and determine what line endings the new file should | ||||
| have. | have. | ||||
| """ | """ | ||||