Subversion Features in the MPLAB® X IDE

Last modified by Microchip on 2024/06/24 06:35

Setting Up Subversion

  1. Download and install the Subversion client software onto your computer. MPLAB® X IDE interacts with the Subversion client to carry out versioning commands.
  2. Specify the path to the Subversion executable. It may be necessary to specify explicitly.
    • Go to Tools > Options from main menu.
    • In the Options dialog, select the Team icon , and then click on the OptionsIn the Versioning tab. In the left pane, select Subversion.
    • Provide the path to the Subversion executable file.
    • Click OK. Then restart the IDE.
      Tools Options window
  3. Before calling Subversion actions from the IDE, make sure you have access to a Subversion repository.

Back to top 

Subversion Synchronization

The following section describes how to synchronize local files with a Subversion repository.

Opening a Subversion Project in MPLAB X IDE

  1. Open a Subversion project in MPLAB X IDE.
  2. MPLAB X IDE scans open projects and if they contain .svn directories, file status, and context-sensitive support automatically becomes active for Subversion versioned projects.

Back to top

Checking Out Files from a Repository

  1. From the main menu choose Team > Subversion > Checkout.
  2. Enter a URL that contains the connection protocol and location of the repository you want to connect to.
    Depending on the protocol you use, you may need to enter other information, such as username and password.
  3. Click Next.
  4. Specify the folder that you want to check out or use the Browse button to select among folders maintained on the repository.
  5. Enter a revision number in the 'Repository Revision' field (HEAD is the default).
  6. Enter a location on the computer to where the files are to be checked out.
  7. Click Next.

team subversion window
checkout window
checkout window

  1. In the Projects window, right-click the file(s) you want to commit.
  2. In the context menu, choose Versioning > Import into Subversion Repository.
  3. In the Subversion Repository panel of the Import wizard, specify the protocol and location of the Subversion repository. Depending on your selection, you may need to specify further settings, such as repository username and password.
  4. Specify the repository folder in which you want to place the project in the repository. A folder with the name of the project is the default.
  5. Enter a description of the project being imported into the repository.
    Click Finish or click Next to preview files prepared for import.
  6. View files that will be imported. Right-click on row for file or folder specific options (e.g., exclude from commit).
  7. Click Finish. The IDE uploads the project files to the repository and the Output window opens to display the progress.

Versioning import widow

import dialog box

import selections check boxes

Back to top

Editing Sources for Subversion Control Commands

MPLAB X IDE provides various UI components to aid in viewing and operating Subversion control commands.

  • Viewing Changes in the Source Editor
    • View real-time changes occurring to your file as you modify it against your previously checked-out base version from the repository
    • IDE uses color encoding
  • Viewing File Status Information
    • Badges and Color-coding; File Status Labels help keep track of versioning information on files
    • Versioning window provides a real-time list of all of the changes made to files within a selected folder of your local working copy
  • Comparing File Revisions
    • Compare revisions by using the Diff command, which is available from the right-click menu of a selected item
    • Graphical Diff Viewer available
  • Merging File Revisions
    • Merge changes between repository revisions and your local working copy
    • Specify a range of revisions to merge
    • Merge a range of revisions from two separate repository folders

Back to top

Subversion Versioning Window

Select a versioned file or folder (e.g., from the Projects, Files, or Favorites window). Choose Subversion > Show Changes from the right-click menu.

  1. Shows both locally and remotely modified files.
  2. By default, shows all locally modified files.
  3. Shows all remotely modified files.
  4. Refreshed status.
  5. Diff opens Diff Viewer.
  6. Updates selected files from repository.
  7. Commits local changes to the repository.
  8. File specific actions are available on right-click:
    • Show Annotations – display author and revision number
    • Search History – search for and compare multiple revisions
    • Exclude from Commit – exclude a file when performing a commit
    • Revert Modifications – specify parameters for reverting any local changes to revisions maintained in the repository

diff viewer

Back to top

Committing Sources to a Subversion Repository

Updating Local Copies

Ways to update local files are:

  • Right-click a versioned item in the Projects window and choose Subversion > Update.
  • Right-click a listed file in the Versioning window and choose Update.
  • To update all source files, click the 'Update All' icon in the toolbar located on top of both the Versioning window and Diff Viewer.
    Back to top

Resolving Conflicts

MPLAB X IDE's Subversion support compares your files with repository sources. When your previous checkout (or update) no longer matches the repository HEAD, and the changes that you applied to your local working copy coincide with areas in the HEAD that have also changed, your update or commit results in a conflict. Conflicts are displayed in the IDE with red text and are accompanied by a red badge. In the Versioning window, conflicts are also indicated by a file's status:

file status in versioning window

MPLAB X IDE provides an intuitive Merge Conflicts Resolver to resolve conflicts. Right-click on the file that has the conflict and choose 'Resolve Conflicts' or Subversion > Resolve Conflicts.

  1. For every conflict, click the Accept button of the revision you want to accept.
  2. Once all conflicts are resolved, click OK to exit the Merge Conflicts Resolver and save the modified file.

merge conflict resolver

Back to top

Performing the Commit

Commit as follows:

  • From the Projects, Files or Favorites window, right-click new or modified items and choose Subversion>Commit.
  • From the Versioning window or Diff Viewer, click the Commit All button located in the toolbar.

In the Commit dialog box:

  1. Type in a commit message, describing the change being committed, in the Commit Message text area.
  2. The Commit dialog lists:
    • all locally modified files
    • all files that have been deleted locally
    • all new files (i.e., files that do not yet exist in the repository)
    • all files that you have renamed
  3. After specifying actions for individual files, click Commit.

commit window

Back to top