Purge, Revert, and Demote

0 Likes

The purge command removes elements from the Default Group. Since they are no longer active, the versions from the parent stream are immediately inherited in dynamic streams and downloaded to workspaces using the update command, provided they are not active there (update ignores elements in the Default Group). In the GUI, purge is a Revert to Backed in 5.x (a misnomer) and Revert to Basis in 6.x (the correct term).


The revert command removes changes made to a stream by a promote operation. Content changes are removed from promoted versions using the merge tool, where the lower-left pane contains the version currently in the stream (like a regular merge), and the lower-right pane contains the version that was in the stream just before the version being reverted was promoted there (unlike a regular merge).

The resultant new versions are kept, along with a revert of namespace changes made by former move, add, defunct, etc. operations, to a workspace off the stream. Then all are promoted back to the stream resulting in the effective removal of the changes made by the original promotion. These new versions are then inherited in dynamic streams and downloaded during the update command for workspaces, provided they are not active there (update ignores elements in the Default Group). To revert a promote operation by-transaction:

  1. Create or drag-n-drop a workspace with no active elements off the stream where the promotion took place and update the workspace.
  2. From the Stream Browser right-click on the stream and select Show History.
  3. Locate the transaction to be reverted and make a note of the transaction number.
  4. Right-click on the transaction and select Revert or use the Revert toolbar button. Note that only transactions whose Action is promote can be reverted.
  5. In the Select Destination for Revert dialog, select the workspace from step #1. Select Yes for "Do you want to auto-keep trivial reverts?".
  6. Perform the merge, usually just a Keep and Exit in most cases. Often the merge tool will show no changes between the versions. This is normal and can be ignored.
  7. Contributors can now review and validate the kept files in the workspace and send the elements to their workspace for testing.
  8. When finished, promote the active elements to complete the revert operation.

Both purge and revert remove changes made to a stream, also resulting in their removal throughout the stream hierarchy by means of inheritance and by the update command for workspaces. However sometimes what is needed is to undo changes made to the parent stream by an inadvertent promote operation and retain them in the child stream. Although there is no "demote" command in AccuRev, the following procedure can be used as a workaround:

  1. Follow the steps above to revert the faulty promotion.
  2. Create or drag-n-drop a workspace with no active elements off the child stream where the changes should be and update the workspace.
  3. From the Stream Browser, right-click on the parent stream where the faulty promotion occurred and select Show History.
  4. Right-click on the promote transaction from step #8 above, the promotion that finalized the revert operation. Select Revert or use the Revert toolbar button.
  5. In the Select Destination for Revert dialog, select the workspace off the parent stream; the one used in the revert operation above. Select Yes for "Do you want to auto-keep trivial reverts?".
  6. Perform the merge, usually just a Keep and Exit in most cases. Often the merge tool will show no changes between the versions. This is normal and can be ignored. When finished, the elements that made up the changes from the original faulty promotion will be active in the workspace.
  7. Follow the steps in Send workspace default group to another workspace to send the default group from this workspace to the workspace off the child stream from step 2.
  8. The changes can now be promoted back to the child stream to complete the "demote" operation.
Update: AccuRev now has a Demote command. However, it was poorly designed and I would still recommend the above technique over it.

Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended