command-line-interfaceaccurev

How do you use AccuRev CLI to promote everything in the current workspace


So, in acgui, I often have a workspace open and select all modified, external, defunct, etc. files and Promote to the parent stream. All I've found is stream to stream which would be my 2nd step, but I gotta do the first. acgui is painfully slow, so I'd prefer CLI.

(have you googled anything AccuRev related? It's like trying to find your birth parents; everything's a PDF)

How do I do this with the accurev CLI command? I need all the commands, in order, to do this. It's a single step in the GUI, I need to know how to translate that single step of selecting all in workspace and pressing Promote button.


Solution

  • The recommended way to work within a workspace implies using the keep command after editing your files. This creates a new version stored in your private workspace stream, not only in your hard drive. After that, promoting all your changes is feasible with one simple command:

    accurev promote -k
    

    Anyway, if you are not using keep, you can select all pending changes (i.e. kept + modified) with a different argument:

    accurev promote -p
    

    There is a caveat regarding this option: it can promote changes that maybe you are not aware of. On the contrary, promoting only kept changes ensures that all transactions are under your control.

    Answer edited to include an explanation on AccuRev statuses:

    Your existing files in your workspace are usually in backed status. Any new file created or moved to that folder will be in external status, and, of course, any backed file that you modify will become modified. There is a pseudo-status called pending that will include both modified and external files. These are the files that will be promoted if you use accurev promote -p -K.

    The problem with this approach is that there could be pending files that were not created by you (configuration files from your IDE, core dumps, etc.) and the command will promote them to the parent stream.

    How can you avoid that? Marking the specific files that you want to promote. The accurev keepcommand will transition those files from external or modified to kept status, which is the only one affected by accurev promote -k.

    From a conceptual perspective, keeping a file creates a copy of your local file into your logical workspace in the server, meaning that you want to conserve that version of the file and making it available from distant locations.

    I recommend reading the AccuRev Quick Reference guide provided with your installation, but I also attach a status transition diagram. Sorry about the low quality of the image:

    AccuRev statuses and transitions