Resolving Text Conflicts
If a conflict occurs in a file under Subversion, the conflict markers are added to the conflicting file, and three auxiliary unversioned files are created in your working copy:
- filename.mine: the copy of your local file without conflict markers.
- filename.rOld: the base revision you have last synchronized to.
- filename.rNew: the latest version on the server.
Conflicting files are displayed in red in the Local tab of the Changes tool window. In the Update Info Tab of the Version Control tool window, they are grouped in a Merged with conflicts list and also displayed in red.
With PyCharm, you can resolve conflicts in two ways:
- Semi-automatically, using a merge tool.
- Manually in the editor. After that, you need to manually mark the processed files as conflict-free.
In this section:
- Resolving text conflicts using the merge tool
- Resolving text conflicts manually
- Marking a file as resolved
To resolve a text conflict using the merge tool
- In the Local tab of the Changes tool window, select the conflicting file:
- On the main VCS menu, or on the context menu of the selection, choose Subversion | Resolve Text Conflict . Files Merged with Conflicts dialog box appears.
- If you want to accept the server version and overwrite your local changes, click Accept Theirs. If you want to force your changes to the repository, click Accept Yours. Clicking Merge opens the merge tool, where you can accept or discard each change individually. So doing, the file is automatically marked as resolved, and auxiliary files are deleted.
- Once the conflicts are successfully resolved, commit your local version to the repository.
To resolve a text conflict manually
Open the conflicting file in the editor, and do one of the following:
- Edit the contents within the conflict markers as required.
- Copy one of the auxiliary files on top of your working file.
To mark a file as resolved
Do one of the following:
- Select the file in the Project tree or in the Local tab of the Changes tool window, and choose Subversion, and then choose Mark Resolved on the context menu of the selection.
- With the conflicting file opened in the editor, right-click the mouse anywhere in the editor tab. On the context menu choose Subversion, and then choose Mark Resolved.
- On the main menu, choose VCS | Subversion | Mark Resolved. .
- In the Mark Resolved dialog box, that opens, select the check box next to the name of the file in question.
- Click the Mark Resolved button.