Edit Real Content Conflicts
The conflicts of a file in the conflicted state (a file with the red double arrow icon) can be edited visually with the Compare view (the built-in file comparison tool) or with an external diff application. Resolving the conflict means deciding for each conflict if the local version of the change will remain or the remote one instead of the special conflict markers inserted in the file by the SVN server.
The Compare view (or the external diff application set in Preferences) is opened with the Edit Conflict action, which is available on the contextual menus of the Working Copy view for files in the conflicted state (an update operation was executed but the differences could not be merged without conflicts). The external diff application is called with 3 parameters because it is a 3-way diff operation between the local version of the file from the working copy and the HEAD version from the SVN repository with the BASE version from the working copy as common ancestor.
If theShow warning dialog when edit conflicts option is selected, you will be warned at the beginning of the operation that the operation will overwrite the conflict version of the file received from the SVN server (the version that contains the conflict markers <<<<<<<, =======, >>>>>>>) with the original local version of the file that preceded the update operation. If you click the OK button the visual conflict editing will proceed and a backup file of the conflict version received from the SVN server is created in the same working copy folder as the file with the edited conflicts. The name of the backup file is obtained by appending the extension .sync.bak to the file as stored on the SVN server. If you click the Cancel button the visual editing will be aborted.
The usual actions on the differences between two versions of a file are available on the toolbar of this view:
- Save
- Saves the modifications of the local version of the file displayed in the left side of the view.
- Perform Files Differencing
- Looks for differences between the two files displayed in the left and right side panels.
- Ignore Whitespaces
- Enables or disables the whitespace ignoring feature. Ignoring whitespace means that before performing the comparison, the application normalizes the content and trims its leading and trailing whitespaces.
- Synchronized scrolling
- Toggles synchronized scrolling. When toggled on, a selected difference can be seen in both panels.
- Format and Indent Both Files (Ctrl + Shift + P (Command + Shift + P on macOS))
- Formats and indents both files before comparing them.
Use this option for comparisons that contain long lines that make it difficult to spot
differences.Note: When comparing two JSON files, the Format and Indent Both Files action will automatically sort the keys in both files the same to make it easier to compare.
- Copy Change from Right to Left
- Copies the selected difference from the file in the right panel to the file in the left panel.
- Copy All Changes from Right to Left
- Copies all changes from the file in the right panel to the file in the left panel.
- Next Block of Changes (Ctrl + Period (Command + Period on macOS))
- Jumps to the next block of changes. This action is not available when the cursor is
positioned on the last change block or when there are no changes.Note: A change block groups one or more consecutive lines that contain at least one change.
- Previous Block of Changes (Ctrl + Comma (Command + Comma on macOS))
- Jumps to the previous block of changes. This action is not available when the cursor is positioned on the first change block or when there are no changes.
- Next Change (Ctrl + Shift + Period (Command + Shift + Period on macOS))
- Jumps to the next change from the current block of changes. When the last change from the current block of changes is reached, it highlights the next block of changes. This action is not available when the cursor is positioned on the last change or when there are no changes.
- Previous Change (Ctrl + Shift + Comma (Command + Shift + M on macOS))
- Jumps to the previous change from the current block of changes. When the first change from the current block of changes is reached, it highlights the previous block of changes. This action is not available when the cursor is positioned on the first change or when there are no changes.
- First Change (Ctrl + B (Command + B on macOS))
- Jumps to the first change.
The operation begins by overwriting the conflict version of the file received from the SVN server (the version that contains the conflict markers <<<<<<<, =======, >>>>>>>) with the original local version of the file before running the update action that created the conflict. After that the differences between this original local version and the repository version are displayed in the Compare view.
If you want to edit the conflict version of the file directly in a text editor instead of the visual editing offered by the Compare view you should work on the local working copy file after the update operation without running the action Edit Conflict. If you decide that you want to edit the conflict version directly after running the action Edit Conflict you have to work on the .sync.bak file.
If you did not finish editing the conflicts in a file at the first run of the action Edit Conflict you can run the action again and you will be prompted to choose between resuming the editing where the previous run left it and starting again from the conflict file received from the SVN server.
After the conflicts are edited and saved in the local version of the file you should run one of the following:
- The Mark Resolved action on the file so that the result of the conflict editing process can be committed to the SVN repository.
- The Revert action so that the repository version overwrites all the local modifications.
Both actions remove the backup file and other temporary files created with the conflict version of the local file.