0

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.

Novaterata
  • 4,356
  • 3
  • 29
  • 51

1 Answers1

1

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

Johnbo
  • 498
  • 6
  • 16
  • So `accurev promote -k` would only include modified files? `accurev promote -p` would include `modified` and `external` files? In my case, files would either be modifed or external; all kept file having already been promoted. – Novaterata May 05 '17 at 12:42
  • I'm afraid `accurev promote -k` did nothing. `accurev promote -p -K` worked. I'm afraid I don't quite understand. Do I have to "select" things first? What am I missing? – Novaterata May 05 '17 at 14:44
  • What I mean is, what are the steps, in order. I'm used to doing things with a single command. I find this style very confusing. – Novaterata May 05 '17 at 14:45
  • I'm going to mark this as the Answer as I was able to promote eventually, but if you could explain the full order of commands needed to do this – Novaterata May 05 '17 at 19:31
  • 1
    I edited the answer to include a diagram. `accurev promote -p -K` can work for you, but I think it is important to understand the conceptual difference between promoting all pending changes or deciding which ones you want to promote. – Johnbo May 08 '17 at 08:47
  • 1
    Thanks, I don't need to worry about unintentional pending files as I have my .acignore well tuned. The intent of this question was very specific. How to do I select all + Promote just like I do in acgui multiple times a day. If I need to do something else, I'll do something else, but I'm glad you explained all of that for other users that come across this. – Novaterata May 08 '17 at 12:49