Working with Suites Under Source Control Management
Before you can work with suites under SCM, you need to check out the repository where you have your Eggplant Functional suites. After the repository is checked out, you can open and work from the local copy of any suite you have stored there.
You can store multiple Eggplant Functional suites in a single repository, or you can connect to multiple repositories for different suites. To open a suite from the local copy, go to File > Open Suite on the Eggplant Functional main menu, then navigate to the suite you want to open.
The Suite Window with SCM
When you are working in Eggplant Functional with suites and suite resources that are under SCM, you have all the same functionality as with suites that are not under SCM. However, you will see some differences in the Suite window interface that show you are connected to the repository.
The status bar at the bottom of the Suite window displays messages that indicate if there are changes in your local copy.
The status for individual files or resources is shown in the sidebar to the right of the file name. Statuses are shown for Scripts, Images, Tables, Features, and Resources.
The statuses you can encounter include:
- M: The local file has been modified and has uncommitted changes. Typically, you need to save the file before this status appears.
- ?: The file has been added locally, but is not recognized by source control until you commit/push it to the remote repository. This status corresponds to Untracked in the Commit dialog box.Note: If you rename an existing file, it receives this indicator.
- A: The resource has been added to the local repository by means of an external tool, such as the command line or a repository browser, but has not been committed.
- C: You might see this status after an SVN update or Git pull. This status indicates that your local file is in conflict with the version that you just got from the remote repository.
- !: The file is missing (SVN only).
These status icons are visual cues to you as you work. They do not otherwise affect the file.
Saving Changes to the Repository
When you are ready to save the changes to the files you have been working on in your local copy back to the repository, you commit or push your changes from Eggplant Functional to the repository, depending on whether you're using Git or SVN.
Both methods bring up the Commit dialog box:
It's a best practice to add a Commit Message every time you commit or push changes to a repository. Information you add here can be helpful for tracking progress or for troubleshooting if errors make their way into the repository. Although you cannot view the commit message in Eggplant Functional, the information is saved as part of the file history in the repository.
Push Changes in Git
- Go to File > Commit All to commit your changes to the local version of the repository. You can select the Push to origin/master checkbox in the Commit Changes window to push those changes to the remote repository, as well.
- If you've already your committed changes locally, you can select File > Push to send those changes to the repository.
Commit Changes in SVN
- Go to File > Commit All to commit your changes to the repository. SVN saves changes locally and also pushes those changes to the remote repository.Note: Be sure to save any outstanding changes before you select Commit All. This operation can commit only what is saved, so any unsaved changes will not be committed.
Updating and Reverting
In addition to committing changes, there are several other SCM tasks that you can select from either the main menu or the right-click menu on items in the sidebar.
Updating refreshes your local copy of the repository with any recent changes in the repository. If another user commits changes to the repository, pull those changes into your local copy of the suite using Pull/Update.
- To update all changes from the repository into your local copy, select File > Pull/Update.
- To update an individual file, right-click the file in the Suite window sidebar, then select Update.
Your local copy is updated and replaced with a fresh copy from the repository.
You can Discard All Changes to revert changes back to the last version that has been committed to the repository.
- To revert all local changes in the suite back to the repository version, select File > Discard All Changes from the main menu.
- To revert changes to an individual file, right-click the file in the Suite window sidebar, then select Discard Changes.
You can use this option even if you have saved the file or files in your local working copy. Discard All Changes pulls the last committed version from the repository and replaces your local copy.
Other SCM Actions
Certain SCM actions can't be managed using Eggplant Functional.
In Eggplant Functional 18.2 and later, you cannot create or switch branches from the Eggplant Functional UI. If you need to work with branches, you'll need to use a separate program. You also can manage branches from the command line.
Because SCM allows multiple users to work on the same suites, you might encounter conflicts when you attempt to Commit or Pull/Update files. Conflicts can occur when you and another user make changes to the same file.
When a conflict occurs, the operation you are attempting aborts, and you will see a status message that explains the condition. Resolve the conflict outside of Eggplant Functional by using a tool such as the command line or a repository file browser.