Defunct: Removing Elements from the Workspace
The Defunct command removes elements from active use in your workspace. That is, for each element you specify, it:
- removes the file, directory, or link from your workspace tree
- marks the element as (defunct) in the workspace stream
- makes the element active in the workspace, by adding it to the workspace's default group
Defunct Overview
Operating system commands won't find a defunct element (because it really is gone from the workspace tree), but the File Browser can see the element in your workspace stream, where it is both (defunct) and a (member).
Defunct does not remove an element from the depot altogether (no operation removes an element altogether — that would violate AccuRev's TimeSafe property). And it does not make an element disappear for all users. Defunct just removes an element from a particular workspace. The element remains visible in other streams and workspaces — at least until you Promote it.
Invoking the Defunct Command
In the Details pane of a File Browser that is open on a workspace, select one or more file elements. Then right-click the selection and choose Defunct from the context menu.
The Defunct dialog appears, prompting you to confirm your intention to remove the element(s).
Defuncting a Directory
If any of the elements you specify is a directory, Defunct works recursively: it removes the directory itself and elements under that directory. Only the specified directory itself becomes (defunct); the objects below it are simply removed from the workspace tree, but do not become (defunct) in the workspace stream.
The precise result depends on whether any elements located below the defuncted directory are active:
- If no element below the defuncted directory is active, the entire directory tree is removed from your workspace tree.
- If one or more elements below the defuncted directory is active, those elements become stranded. A stranded element is not removed from your workspace tree, but its status becomes (external), since the workspace stream no longer has a valid pathname to the object.
Promoting a Defunct Element
After defuncting an element, you use Promote to propagate its removal to your workspace's backing stream. The element won't appear in a File Browser that is open on your workspace, but it will appear, with (defunct) status, in a File Browser that is open on the backing stream.
Bringing Back a Defunct Element
You can usually recover the backed version of the (defunct) element by invoking the Revert to Basis command on it. However, if either of the following conditions apply, the correct way to recover the version is to invoke the accurev undefunct command from the CLI.
- If you have kept changes in your workspace before defuncting. Remember that if you Revert to Basis an element which has not been promoted, you eliminate the version of that element in your workspace.
- If you have promoted the (defunct) element, so that it no longer appears in the File Browser.
The Past and Future of a Defunct Element
When a user in a sibling workspace performs an Update, the element will disappear from that workspace.
With each successive promotion up the stream hierarchy, a defunct element disappears from the source ("promote from") stream, and becomes active, with (defunct) status, in the destination ("promote to") stream.
AccuRev's TimeSafe property means that you cannot change the past. This means that a defunct element remains in old snapshots of streams. You can always get information about the element (if you know which stream it still exists in) using the History Browser.