Delete Version VS. Remove Item

book

Article ID: 48775

calendar_today

Updated On:

Products

CA Harvest Software Change Manager - OpenMake Meister

Issue/Introduction

Description:

The distinction between these two CA SCM processes has generated some confusion. This page tries to clarify why these processes differ.

Solution:

First, let's answer the question of what these two processes actually do when you run them.

  • Remove Item creates a new 'D' version of the file in the package of your choice, which will then delete the file from each view as it is promoted through the lifecycle. This is a logical deletion process that later can be undone.

  • Delete Versions removes entries from your package. If your package contains a version 0 of a file, then executing Delete Versions on that version removes the file from Harvest. This is the physical deletion process that later cannot be undone. Doing the Delete Versions process is considered better than executing Remove Item. The reason is that Remove Item will create a 'D' version 1 of that file and therefore creating extra and unnecessary history as the package is promoted through the lifecycle.

It is also worth noting that Delete Versions will not work on any version that has been included in a snapshot, but Remove Item will.

Using the processes

Now, let's analyze when we should use these processes.

One of the more confusing aspects of CA SCM is the adding of files. It is altogether too easy to add a file to the wrong view path, and even when you add a file in the correct path, you may nevertheless realize later that the file should not have been added. If you decide that you want to undo the adding of a file, how you accomplish that depends on factors that this page has been drawn up to help you choose the best strategy for deleting your file.

Files that have recently been loaded into a repository by mistake

Although this case rarely occurs, it is worth mentioning that if your pool administrator loads a repository, and you determine that a file or folder should not have been placed in source control, and if no snapshots have been taken of the repository yet, then the administrator can delete that file or folder from the repository administration UI, thereby erasing all record of the file or folder's existence. This is recommended for uploaded items that had occurred by mistake.

Files that were created in your currently-under-development package and never promoted

If you have created a file in a package, and before that package is promoted you realize that the file should not have been added, remove it by using the Delete Versions process. If you branched the file after creating it to check in additional changes, you will also need to delete the branch versions along with the trunk version. If that file was added to new path (i.e. it was the first file to be added under a folder or folder chain), then you can also run Delete Versions on the folders that were created to contain the file, which will also appear in your package. If you forget to do this, your empty folder(s) will become visible to all developers in the Development data view after your package is promoted, potentially causing confusion.

In addition, if you add files to a directory that already has files in it, and then decide to remove the whole directory (or any parent on the path of the added file(s), you must first run Delete Versions on the added files before you run Remove Folder (path). If you fail to do this, you will not be able to merge your package to the trunk, and an administrator will have to help you undo the mistakes inside the package.

Files that were created in a package that was promoted but not built by the nightly build (i.e. the file does not appear in a snapshot)

As long as a package has not been built, you can demote it to the Development state and use Delete Versions as described above. Once a package has been built by the nightly build, it should not be demoted. Packages that were built by the smoke build but have not yet been built by the nightly build should only be demoted in extreme circumstances. So if your package was built by the smoke build, it is suggested that you follow the procedures outlined below.

Files that have been built by the nightly build

Regardless of whether a file was added or loaded into the repository, once it has been built by the nightly build (and thereby incorporated into a snapshot), that version (and hence that file) cannot be removed from source control. At that point, to remove the file from view, run the Remove File (item) process on the file, which will add a 'D' version of the file to the package you select. Promoting that package will remove the file from view. If by removing a file you make one or more folders empty, you can run Remove Folder (path) on those folders to remove them as well. Remove Folder (path) will actually delete all the files and folders under the folder(s) you delete, so that can be a quick and easy way to delete a large number of files that are no longer needed.

Environment

Release: SCMNCR99000-12.1-Harvest-Software Change Manager-Named User-Competitive Replacem
Component: