Managing version controlled objects
Managing version controlled objects under the lock method
These procedures apply to objects that are version controlled under the lock method.
If the lock method is being used, the following objects are version controlled: GeoExplorers, networks, alternative demand objects, controls, live data configurations, digitisation templates, and baselines.
Important: The lock method will apply to version controlled objects whenever the alternative method (the merge method) is not selected.
In the lock method:
- Before you can change a version controlled object, it must be checked out (newly created objects are checked out automatically).
- For as long as you have the object checked out, no one else can change the object.
- When you have finished working on the object, you must check it in (or undo the checkout).
When you want to change an existing version controlled object, you must check it out.
Tip: You do not need to check out a version controlled object to view it.
To check out a version controlled object:
- In the Explorer window or Model Group window, right-click the object.
- Select Check
out from the menu.
A name is suggested for the new object, which you can change if you want to.
- To check out the object, click OK.
A new version of the object is created, nested beneath the object that you checked out.
The checked out object is shown with a thick red border around its icon.
You can now open and make changes to the checked out object. When you have finished making changes, you must check the new version back in, so that other people can work on it.
When you want to create an alternative version of a version controlled object, you must generate a branch.
To branch a version controlled object:
- In the Explorer window or Model Group window, right-click the object that you want to branch.
- Select Check out and branch from the menu.
A name is suggested for the new object, which you can change if you want to.
- To check out and branch the object, click OK.
You can now edit the version controlled object to create the new branch. When you have finished making changes, check the new branch back in.
The default name for a new branch consists of the name of the version from which it was branched followed by an underscore and the branch number. For example, the first branch from an object called Wallingford#4 is given the default name Wallingford#4_1.
Two version controlled objects can be compared to identify those parts of the objects that are different. Results can be output to screen, or saved to a CSV file or a text file.
If using an Oracle database, a report of differences between checked in network versions of a single asset can also be produced. See Viewing the history of an asset for more information.
Comparing two objects
- Display the Network Compare Selection dialog:
- Right-click a version controlled object in the Explorer window or Model Group window and choose Compare from the pop-up menu. This displays the Network Compare Selection dialog with the Compare this field populated with the network object that was clicked on.
- Alternatively, select the two objects to be compared in the Model Group window or the Explorer window and select Compare from the pop up menu. The Network Compare Selection dialog will be displayed with the Compare this and With fields populated with the selected objects.
- If the With box is not already populated, select the version controlled object to compare with, or check the Source box to automatically populate the With box with the parent of the object to be compared.
- Optionally include a selection list to limit the comparison to a selection of objects in the object to be compared. This option does not apply to baselines.
- Select options as required:
- Ignore changes in flags - Omit differences in flags from comparison report.
- Select changed objects - If the network to be compared is open, all objects that have been changed will be highlighted in the GeoPlan window.
- Ignore changes due to defaults - Omit differences between fields flagged #D in the comparison report.
- Compare based on Asset ID - Compare networks by comparing objects, or sets of objects with the same Asset ID. This option is available only when comparing networks.
- Select the destination for the comparison report:
- Screen - The report is displayed in a General Text File view. The report can then be printed, saved to file, or the data can be copied to the clipboard.
- File - The report is saved to a file. Give the name and location of the file in the adjacent input box.
- CSV file - A CSV file is created containing all the data from the first object that is different from that in the second object. Give the name and location of the CSV file in the adjacent input box.
- To complete the operation, click the Compare button. The dialog remains visible to allow another comparison to be set up if required.
Comparing an open network with multiple other networks
A currently open network may be compared with multiple networks. If there are other version controlled objects currently associated with the network, these objects may also be included for comparison.
To compare with multiple objects, the Network Compare Selection dialog must be invoked via the Network menu:
- Select Compare from the Network menu. This displays the Network Compare Selection dialog.
- Drag one or more networks into the With box in the Network Compare Selection dialog.
- Drag associated version controlled objects into the With box. Only valid object types may be included.
Each comparison will generate a separate report. (Reports cannot be output to a CSV file when comparing objects via the Network menu.)
Using a CSV file to apply changes to other objects
Because a CSV file generated by a compare is in the correct format, it can be used to apply the same changes to other version controlled objects.
- Right-click a checked out version controlled object in the Model Group window and choose Update | From CSV. This displays the Import / Update CSV Data dialog.
- Follow the procedure described in Updating from CSV data, remembering to set the following options:
- The Type of update should be Mixed (based on data field). This option makes use of the Action field, needed if you want to delete objects.
- Make sure that Allow blank fields in CSV to overwrite existing data remains unchecked. Any fields that have not changed between versions are left blank in the CSV file.
- To complete the process, click OK.
The data from the CSV file will overwrite data in the network. All objects marked for deletion will be deleted.
A duplicate of a version controlled object can be created in a selected model group in the database.
Duplicates can be used to create a starting point for various analysis options.
To duplicate a version controlled object:
- In the Explorer window or Model Group window, right-click the checked in object that you want to duplicate.
- Select Duplicate from the menu.
- Select which model group the duplicate is to be created in and click OK. In the New Name dialog, a name is suggested for the new object. You can change the name here if you want to.
- To create the duplicate object, click OK.
The duplicate object is created in the selected model group. Like the original object, the duplicate is under the lock method of version control.
The default name for the duplicate object is the name of the original object followed by ' - Copy'. If the original object is duplicated again, the name of the duplicate will be followed by ' - Copy (2)', etc.
The icon of the new object is coloured blue.
Two version controlled objects can be combined to form a new version controlled object containing all the data from the two original objects. The new version controlled object will be either a new version of the first selected object, or a branch from that object.
Warning: The combining process makes no attempt to rename objects whose names clash. For example, if two nodes in a network have the same ID, the data from the second network selected will overwrite the data from the first in the combined network. If you want to combine two networks where name clashes exist, open both in their own GeoView, select all the objects in the first network, and use Copy objects and Paste append objects from the Edit menu. This will adjust names to prevent clashes, and maintain connectivity information. This method works only for networks and is not available for other version controlled objects.
Note: When combining control objects, the control time interval and global UPC script for the combined control are set from the second object selected for combining.
To combine two version controlled objects:
- From the Explorer window or Model Group window, right-click the version controlled object from which the new version or branch is to be created. The object must be checked in.
- If you want the combined object to be a new version of the first object, select Combine from the pop-up menu, or, if you want the combined object to be a new branch, select Combine and branch.
- Locate and select the object you want to combine with the first
object and click OK. You will only be able
to choose a version controlled object of the correct type.
A name is suggested for the object, which you can change.
- To create the combined object, click OK.
While a version controlled object is checked out, no one else can make changes to it. Therefore, when you have finished changing an object or creating a new branch, it should be checked back in as soon as possible.
To check in a version controlled object:
- In the Explorer window or Model Group window, right-click the object that you want to check in.
- Select Check
in from the menu.
If the object is of a type that can be validated and you have not done so, InfoWorks WS Pro will prompt you.
- To validate the object, click Yes or, to check in the object without validation, click No.
After validation, you will be warned if any errors were encountered.
- To check in the object, click Yesor, to investigate or correct the errors, click No.
The Check In Comment dialog will be displayed, containing any comments that have been added to the Description page of the object's Properties dialog.
- In the Check In Comment dialog, edit
the comments if required, then, to check in the object, click OK (or, to stop the check in and continue
editing, click Cancel).
If interim versions of the checked out object have been used in simulations, the Retain Interim Versions dialog will be displayed.
- Select the runs for which interim versions are to be checked in and click OK.
When the new version or branch has been checked in, it will be available to other users for editing.
You can undo a checkout if you have made no changes to the version controlled object or do not wish to save the changes.
To undo a checkout:
- If the checked out object is open in the workspace, close it.
- In the Explorer window or Model Group window, right-click the checked out object.
- Select Undo check out
from the menu.
A warning message is displayed.
- To confirm that you want to undo the checkout, click Yes.
The version or branch that you were creating will not be saved in the master database.
A check-in of a version controlled object can be undone, which will revert the object to checked out status.
The Undo check in option will be available for a previously checked in object, if it is the last object in a branch and is not referred to by another object (e.g. a run).
To undo a check-in:
- If the checked in object is open in the workspace, close it.
- In the Explorer window or Model Group window, right-click the checked in object.
- Select Undo check in from the menu.
If the undo check-in cannot be performed, a warning message will be displayed.
Managing version controlled objects under the merge method
These procedures apply to objects that are version controlled under the merge method.
If the merge method is being used, the following objects are version controlled: GeoExplorers, networks, alternative demand objects, controls, live data configurations, and digitisation templates.
Important: The merge method will apply to version controlled objects whenever the alternative method (the lock method) is not in operation.
Note: The merge method is not applicable for branch owners. Use the lock method when you have the branch owner user permission.
In the merge method:
- It is important to get other user's changes before making any of your own.
- You commit your changes to the master database so that other users can see them.
- You resolve any conflicts between what you have committed and what other users have committed.
It is important to get other users' changes regularly to minimise the possibility of conflicting changes being made to the same data. When getting other users' changes, conflicts may arise that will require resolving. Changes cannot be committed until conflicts have been resolved.
To update a version controlled item with other users' changes:
- Right-click the database item in the Model Group window and choose Update (get changes made by others).
If changes have been made that conflict with changes made by another user, these conflicts must be resolved. If there are conflicts, the Resolve Update Conflicts dialog is displayed. See Resolving conflicts for more information.
Note: If you open a local copy of a network which has uncommitted changes made by you but there are committed changes made by others, a message will be displayed asking if you would like to get the most recent version of the network.
When you make changes to a version controlled database item, these changes are stored in your own local copy of the network (in your local working folder). To make these changes available to other users, they must be committed to the master database.
To commit your changes:
- Right-click the database item in the
Model Group window and choose Commit changes to master database.
The Commit Change To Server dialog is displayed. On this dialog you can:
- See a summary of the changes, additions and deletions made.
- Add a comment that will be available to other users when they look at the history of the version controlled item.
- Compare your current version of the database item with the latest version in the database, or with a completely separate item of the same type. (To do this, click the Diff button.)
- To commit your
changes, click OK (or, to abort the commit operation and close the Commit Change To Server dialog, click Cancel).
Your local copy of the database item will be updated with other users' changes, and your changes will be copied to the master database unless there are conflicts with changes made by another user. If there are conflicts, the Resolve Update Conflicts dialog is displayed. See Resolving conflicts for more information.
It is possible to discard all the changes that you have made to a version controlled item since the last time you committed changes to the master database.
(To undo the most recent single change, use the Undo option from the Edit menu.)
To discard all the changes you have made since the last time you committed changes:
- Right-click the database item in the Model
Group window and choose Undo changes.
A warning dialog is displayed.
- To revert all changes since the last commit, click Yes.
If conflicts occur when you get other users' changes, your local database will be updated and you will see a message showing you how many objects have conflicts.
- Click OK and you will
see the Resolve Conflicts dialog.
This dialog displays the conflicts for one object. You can scroll through the list of objects with conflicts and resolve conflicts for each object in turn. The object you are currently resolving is highlighted on the grid windows and on the GeoPlan.
The buttons along the top of the dialog allow you to work with all the conflicting objects.
All the information below the line represents the conflicts in the current object.
- When you are happy with the selections you have made to resolve all the conflicts for the current object, click the Resolve conflict button. This will apply the chosen values, mark the object as resolved, and move on automatically to the next object with conflicts.
- Once you have resolved all outstanding conflicts,
click the Commit button.
This will display the Commit Changes dialog for you to commit your changes.
Every time you commit changes to the master database, the changes you made are recorded permanently. They are not overwritten when the next batch of changes are made, so the entire history of a version controlled item is available for review.
To view the commit history of a version controlled item:
- Right-click the database object in the Model Group window and choose Show commit history.
The Commit History dialog is displayed. There may be some delay before the dialog is displayed as InfoWorks WS Pro downloads the history from the master database.
On the dialog you can:
- View details of any previous commit, such as user id, number of changed objects, and any comments made at the time.
- View the differences between two versions, using the Diff button. See Comparing two versions of the same object.
- Open a previous version of the database item (as a read-only copy).
- Create a branch. See Creating a branch.
- Copy history to the clipboard, using the Copy selected items to clipboard option on the context menu.
- Make a copy of the object in another location within the master database, using the Copy button.
- When you have finished with the dialog, click Close.
You can list your uncommitted changes by comparing your local copy of the version controlled item with the latest version in the database.
- In the Model Group window, right-click the version controlled object and choose Compare.
This displays the Compare Object dialog.
- Select the My not yet committed changes option.
- Optionally, set ignore conditions in the Options section.
- In the Output section, choose the destination for the report.
- Click the Show differences button.
You can compare two versions to identify those parts of the versions that are different.
- In the Model Group window, right-click the version controlled object and choose Show commit history.
This displays the Commit History dialog.
- Select two versions of the item, then click the Diff button.
This displays the Compare Object dialog. The Differences from another network option is automatically checked.
- Set the options on the dialog as required, then click the Show differences button.
You can compare two separate version controlled objects to identify those parts of the objects that are different.
- In the Model Group window, right-click the version controlled object and choose Compare.
This displays the Compare Object dialog.
- Select the Differences from another network option.
- Select the version controlled object you want to compare with: Either drag it from the tree into the box, or use the browse function to select the comparison object.
- Set the options on the dialog as required, then click the Show differences button.
In most cases, updates and changes will be made to the main version of a version controlled object. However, there may be occasions when you need to branch the object and maintain two separate copies of it. For example, you may want to:
- carry out some form of "what if" analysis without affecting your asset data
- return to a previous version because subsequent errors have come to light and discarding them is the easiest way to correct things
To create a branch:
- Right-click the version controlled object in the Model
Group window and choose Show commit history.
The Commit History dialog is displayed.
- Select the row on the grid for the version of the
database object where you want to create the branch.
Your new branch will share the history of the original database object up to and including the version you have highlighted.
- Click the Branch button.
You are asked to confirm the name for the new branch. The suggested name is based on the name of the original database object. You can change this name if you want.
- When ready, click OK.
InfoWorks WS Pro creates a branch on the database tree below the parent database item.
- When you have
finished with the Commit History dialog, click Close.
The new database object will now be available in the database tree one step below the network object from which it was created. The two database objects will have an identical history up to the point of the branch.
You can reserve a version controlled object to prevent other users committing changes to it. This allows you to make complex changes to the database item while ensuring that there can be no conflicts when committing the changes. You can remove the reserve on a version controlled object at any time.
To reserve or unreserve a version controlled object:
- In the Model Group window, right-click the version controlled object and select Advanced.
- Select one of the following options:
Reserve object - The local database object will be updated with the latest version from the server if it is out of date, and the object will be reserved. When a version controlled object is reserved, other users will not be able to commit changes to it. If the version controlled database object is already reserved, a message will be displayed containing details of the user that has the item reserved.
Unreserve object - The reserve will be removed from the database object. Other users will now be able to commit changes to the object. In this case, only the user who originally applied the reserve will be able to remove it. Unreserving will fail if another user attempts to remove the reserve using this option.
Force unreserve object - The reserve will be removed from the database object regardless of which user has reserved it. All users will now be able to commit changes to the database item.
Note: The reserve will also be removed when the object is committed.