Difference between revisions of "VCS Configuration"

From SEGGER Wiki
Jump to: navigation, search
(Set up source control system)
Line 9: Line 9:
   
 
Once you have installed the command line client, you must configure Embedded Studio to use it.
 
Once you have installed the command line client, you must configure Embedded Studio to use it.
  +
  +
=== Configuration ===
   
 
'''To configure Subversion:'''
 
'''To configure Subversion:'''
Line 28: Line 30:
 
[[File:SVN_Example.PNG|thumb|Example with SVN|none]]
 
[[File:SVN_Example.PNG|thumb|Example with SVN|none]]
   
'''Troubleshooting'''
+
=== Troubleshooting ===
*Please note that the Embedded Studio SVN integration only works in already opened SVN projects.
+
* Please note that the VCS options may only show up on projects that have been pulled/fetched from the corresponding repository.
   
 
== Source control capabilities ==
 
== Source control capabilities ==

Revision as of 12:01, 29 November 2022

Version Control System (VCS) is an essential tool for individuals or development teams. SEGGER Embedded Studio integrates with several popular source-control systems to provide this feature for files in your Embedded Studio projects.

The source-control capability is implemented by a number of third-party providers, but the set of functions provided by Embedded Studio aims to be provider independent. This article will explain how to set up such a system and how to use it.

Set up source control system

Embedded Studio supports Subversion, Git, and Mercurial as source-control systems. To enable Embedded Studio to utilize source-control features, you need to install the appropriate command line client on your operating system for the source-control systems that you will use.

Once you have installed the command line client, you must configure Embedded Studio to use it.

Configuration

To configure Subversion:

  1. Choose Tools > Options.
  2. Select the Source Control category in the options dialog.
  3. Set the Executable environment option of the Subversion Options group to point to Subversion svn command.
    1. On Windows operating systems, the Subversion command is svn.exe.
    2. On MacOS operating systems, the Subversion command is /usr/local/bin/svn.

To configure Git:

  1. Choose Tools > Options.
  2. Select the Source Control category in the options dialog.
  3. Set the Executable environment option of the Git Options group to point to Git git command. On Windows operating systems, the Git command is git.exe.

To configure Mercurial:

  1. Choose Tools > Options.
  2. Select the Source Control category in the options dialog.
  3. Set the Executable environment option of the Mercurial Options group to point to Mercurial hg command. On Windows operating systems, the Git command is hg.exe.
Example with SVN

Troubleshooting

  • Please note that the VCS options may only show up on projects that have been pulled/fetched from the corresponding repository.

Source control capabilities

The source-control integration capability provides:

  • Connecting to the source-control repository and mapping files in the Embedded Studio project to those in source control.
  • Showing the source-control status of files in the project.
  • Adding files in the project to source control.
  • Fetching files in the project from source control.
  • Optionally locking and unlocking files in the project for editing.
  • Comparing a file in the project with the latest version in source control.
  • Updating a file in the project by merging changes from the latest version in source control.
  • Committing changes made to project files into source control.

When Embedded Studio loads a project, it examines the file system folder that contains the project to determine the source-control system the project uses. If Embedded Studio cannot determine, from the file system, the source-control system in use, it disables source-control integration.

That is, if you have not set up the paths to the source-control command line clients, even if a working copy exists and the appropriate command line client is installed, Embedded Studio cannot establish source-control integration for the project.

User credentials

You can set the credentials that the source-control system uses, for commands that require credentials, using VCS > Options > Configure. From here you can set the user name and password. These details are saved to the session file (the password is encrypted) so you won't need to specify this information each time the project is loaded.

Note

Embedded Studio has no facility to create repositories from scratch, nor to clone, pull, or checkout repositories to a working copy: it is your responsibility to create a working copy outside of Embedded Studio using your selected command-line client or Windows Explorer extension.

The "Tortoise" products are a popular set of tools to provide source-control facilities in the Windows shell. Use Google to find TortoiseSVN, TortoiseGit, and TortoiseHG and see if you like them.

Source-control operations

Source-control operations can be performed on single files or recursively on multiple files in the Project Explorer hierarchy. Single-file operations are available on the Source Control toolbar and on the text editor's shortcut menu. All operations are available using the Project > VCS menu. The operations are described in terms of the Project Explorer shortcut menu.

More information can be found in the Embedded Studio user manual: SEGGER Embedded Studio > SEGGER Embedded Studio User guide > Using source control

Set up external diff tool

To show the differences between the file in the project and the version checked into source control you can use the build in diff tool:

  1. In the Project Explorer, right-click the file.
  2. From the shortcut menu, choose Source Control > Compare.
ES internal diff tool

You can also use an external diff tool in preference to the built-in Embedded Studio diff tool. To define the diff command line Embedded Studio generates, choose Tools > Options > Source Control > Diff Command Line. The command line is defined as a list of strings to avoid problems with spaces in arguments. The diff command line can contain the following macros:

  • $(localfile): The filename of the file in the project.
  • $(remotefile): The filename of the latest version of the file in source control.
  • $(localname): A display name for $(localfile).
  • $(remotename): A display name for $(remotefile).
Cmd line example with WinMerge