In the AccuRev GUI, stranded elements are listed in the File Browser’s Stranded filter. In the CLI, the command stat –i lists stranded elements. A stranded element is listed by its element-ID, along with a pathname that was once (but is not currently) valid in that stream.Note: through repeated add-promote-defunct-promote cycles, it’s possible to have multiple elements with defunct status in the parent stream, all of which were created at the same pathname.To get the defuncted element out of the way, promote it by element-ID to the grandparent stream: promote –e <eid> –s <parent_stream>.To recover the defuncted element in workspace #1, use undefunct –e <eid> on the defuncted element. This has the side effect of making the new element inaccessible in workspace #1. Depending on your needs, use defunct –e or move –e on the new element.To propagate the file element’s change to the grandparent stream, promote it by element-ID: promote –e <eid> –s <parent_stream>.To access the file’s contents, use its element-ID: cat –e <eid> –v <version-ID>.The only way to work with the file element in workspace #1 is to first undefunct the directory, which makes the file visible again.
• The user in workspace #2 sets a rule that excludes a directory element from the parent stream (excl –s <parent-stream> <directory-name>).To propagate the file element’s change to the grandparent stream, promote it by element-ID: promote –e <eid> –s <parent_stream>.To access the file’s contents, use its element-ID: cat –e <eid> –v <version-ID>.The only way to work with the file element in either workspace is to first remove the exclude rule (clear command) from the parent stream, and then update the workspace. This makes the file visible again.The only way to untangle this knot of inconsistency is to checkout (co command) a previous version of each directory that has the “correct” (that is, consistent with the other directory) pathname, then promote these old versions to the parent stream.The simplest way to do this is to specify the transaction that created the directory at its correct pathname: co –t <add-transaction-number>. But this method can be “messy” if the add transaction also created other elements, such as the files within the directory.Another method is to use a workspace under a time-based stream to see the relevant directories with their correct pathnames. Checkout the “old” directory versions, promote these versions from the workspace to the time-based stream, then use promote –s <time-based-stream> –S <parent-stream> to promote to the parent stream.Note: with either method, you’ll probably need to use the –O option to the promote command, in order to avoid the need to merge the “old” directory versions.
• The user purges (GUI: Revert to Basis) the new directory from the parent stream.To access the file’s contents, use its element-ID: cat –e <eid> –v <version-ID>.The only way to work with the file element is to first checkout (co command) the version of the directory that was originally created in the workspace. The simplest way to do this is to specify the transaction that created the directory: co –t <add-transaction-number>. But this method can be “messy” if the add transaction also created other elements.Another method is to use a workspace under a time-based stream to see the directory before it was purged from the parent stream. Checkout the directory, promote it from the workspace to the time-based stream, then use promote –s <time-based-stream> –S <parent-stream> to promote to the parent stream.Note: with either method, you’ll probably need to use the –O option to the promote command, in order to avoid the need to merge the “old” directory version.
Micro Focus |