Elle Fie
Elle Fie

Reputation: 691

p4 submit files not in client view

Is there a way to submit a file that is not part of the client view?

My client looks like:

//dir1/...
-//dir1/dir2/...

I am trying to create a new file that is a few megabytes at //dir1/dir2/file1 and submit it without syncing //dir1/dir2/ (which can be multi-gigabyte).

Is there any way to force-submit a file that doesn't exist in the client view if I can guarantee the base directory (//dir1/dir2) exists in the Perforce depot?

Edit: Yes, I understand that I can add this file to the client view, but my question, specifically, as above, is: "Is there any way to force-submit a file that doesn't exist in the client view"?

Upvotes: 3

Views: 5157

Answers (1)

Bryan Pendleton
Bryan Pendleton

Reputation: 16339

(Edit: Clarifying my answer, to try to more directly answer the (clarified) question)

No, there is no way to submit a file that doesn't exist in the client view. Without the information in the client view, the server doesn't know how to ask the client for the content of the file to be submitted, as the client view is what specifies which physical file on the client machine contains the content to be submitted.

As a workaround, you can refine your client view still further:

//dir1/...          //my-ws/location/dir1/...
-//dir1/dir2/...    //my-ws/location/dir1/dir2-files-I-don't-care-about/...
//dir1/dir2/file1   //my-ws/location/dir1/dir2/file1

You can read this as: "include everything in dir1, excluding everything in dir1/dir2, except for dir1/dir2/file1, which is specifically to be included."

After adjusting your view, you can use p4 add //dir1/dir2/file1 as you expect.

The order of the mapping lines is critical here, as described by this sentence from p4 help views:

If more than one mapping line refers to the same files, the later
mapping line overrides the earlier one.

If you wish, once you have submitted the file, you can remove that line from your view spec (and re-sync your client), to simplify your client back to its prior definition.

Upvotes: 3

Related Questions