Working with Suites Under SCM
Before you can work with suites under SCM, you need to check out the repository where you have your eggPlant Functional suites. For directions on how to perform the checkout, see Step by Step: Connect to a Repository. After the repository is checked out, you can open and work from the local copy of any suite you have stored there.
Note: Each user should check out the repository on their local machine. When you work with source control, you will always work on a local copy and commit changes to the repository.
Remember, 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 shows the message Suite under source control. It also displays the name of the branch of the repository you have open, which can be the master.
The status bar also shows buttons for Settings and Snippets. The Settings button shows you if you have any uncommitted changes on the Settings tab of the Suite window as well as changes to Schedules and certain other suite information. The Snippets button indicates any changes to your Suite Snippets.
If you have outstanding changes in these areas, the button will include a character to the right of the title to show the status. Right-click the button to open the action menu, which lets you Commit, Discard Changes, and Update. These actions are described in detail below.
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.
Note: The Results and Schedules sections do not display inline statuses. Schedule status shows on the Settings button below the suite window. ePF does not track SCM changes for Results.
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 to the local copy but is not recognized by source control until you commit it. 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 is not committed.
- D: In rare cases, you might see this indicator on the Settings or Snippets button if the underlying file has been deleted.
These status icons are a visual clue to you as you work. They do not otherwise affect the file. If you do not see a status that you expect to see, choose Refresh Status from the File menu to update the statuses being shown.
Committing 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 can commit your changes from eggPlant to the repository in a couple of ways.
-
To commit all outstanding changes across your suite, select File > Commit All from the main menu.
-
To commit changes to a single file, right-click the file name in the Suite window sidebar, then select Commit.
-
To commit changes to schedules or snippets, click the Settings or Snippets button below the suite window, then select Commit.
Both methods bring up the Commit dialog box:
The Commit screen for a Git repository in eggPlant Functional
You are required to add a message every time you commit changes to a repository. Use this field to explain what changes you are committing to the repository. This information can be helpful for tracking progress but also for troubleshooting if errors make their way into resources.
Note: Although you cannot view the commit message in eggPlant Functional, the information is saved as part of the file history in the repository.
To commit your changes on Git:
- Click Commit and Push to commit your changes to the repository.
- Click Commit to commit changes only within the local copy of the repository. This option lets you save version history but not push the changes to the repository. You can select File > Push to send committed local changes to the repository.
To commit your changes with SVN:
-
Click Commit to commit your changes to the repository.
Note: SVN always commits and pushes changes to the repository at the same time.
Note: Be sure to save any outstanding changes before you select the Commit or Commit All option. This operation can commit only what is saved, so any unsaved changes will not be committed.
If you are using a Git repository, the Commit dialog box lets you Add a new branch or switch to an existing branch to commit your changes.
Additional SCM Functions
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.
Update
Updating refreshes your local copy of the repository with any recent changes in the repository. If another user commits changes to the repository, you can pull those changes into your local copy of the suite using the Update command.
- To update all changes from the repository into your local copy, select File > Update from the main menu.
- 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.
Discard Changes
You can choose the Discard Changes command 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 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 by using the Save option. Discard Changes pulls the last committed version from the repository and replaces your local copy.
Push (Git Only)
If you are using Git, you can commit changes locally without pushing them to the repository. The Push option available on the File menu lets you send all locally committed changes to the repository.
Refresh Status
As you make updates to files in the Suite window, eggPlant Functional tracks changes and displays an indicator for changed or added files, as discussed above. Typically, the indicator appears as soon as you save or add a file. You can use the Refresh Status option (File > Refresh Status) to force an update for all files so that you can see the most current status icons displayed.
Note: Refresh Status checks for differences between the open suite and the local copy. This option does not query the repository.
Conflicts
Because SCM lets you have multiple users work on the same suites, your files can have conflicts when you attempt SCM functions, such as Commit or Update. A conflict might occur when you and another user have made 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. In most cases, you will need to resolve the conflict outside of eggPlant Functional by using a tool such as the command line or a repository file browser.