Perforce add's 'depot' folder when creating a workspace - perforce

I have a depot structure as following:
-> depot
---> artSource
---> Game
Until I was changed to an admin account, When connecting a workspace I would only the ArtSoruce, Game in my workspace, but since the change, I'm getting the depot as well.
All other user's don't have the depot folder, doing the same steps. Thoughts?

Your client view is different from theirs.
A client view of:
//depot/... //your-client/...
will map //depot/... directly to your client root.
A client view of:
//depot/... //your-client/depot/...
will map //depot/... to a folder called depot under your client root (as you're describing).
To remove the extra client folder from your workspace, remove it from the view and then p4 sync to sync the workspace using the new view.
Note that the former (without the extra folder on the client side) is the default when there is only one depot, but when there are multiple depots, the default view maps each depot to a folder of the same name. My guess is that your workspace has the extra folder level because there's a second depot that was created since your previous workspace was, or perhaps because there's a second depot that only you (as an admin) have access to.

Related

Find out the client workspace specification of a workspace which was synced by a different perforce client (different user)

I'm confused about what exactly does perforce client mean and how does it maintain the information of the synced files (for eg: mapping of local files to perforce depot).
Lets say a person A synced some files from perforce depot to his client workspace. Those files exists on his local system which are then transferred to me over a network into my local system.
If I run p4 client on the workspace that I just got, what will be the output? Does it give me the client specification of person A's workspace?.
Does perforce client maintain the client specification as a file in the workspace itself?
A Perforce "client spec" (usually "client" for short) is an entity in the server database that tracks the state of a specific client workspace. Each client host should have its own client spec (or possibly many client specs, with each mapping a different folder on that host's local filesystem). Other than the form that describes the client spec (what you see when you run p4 client -o, which is derived from information in the db.domain and db.views tables), the client spec also comprises database entries that describe each individual file that is synced to the workspace (db.have), each file that is currently open in a pending changelist (db.working and db.locks), and any pending or completed "resolve" operations for those files (db.resolve and db.resolved).
If person A sends you files from his workspace, no Perforce-specific information is encoded within those files, because that information is maintained on the server and is stored relative to person A's client spec. Once the workspace files are removed from the context of a Perforce workspace, they no longer have any connection to Perforce or their version history in the depot; they're just files. (If you use tools like Dropbox or Google Drive, think about it like a file you remove from your Dropbox folder and then email to someone as an attachment which they save to their own desktop -- they have the file, but it's not synced with your Dropbox any more.)
If you run p4 client after receiving those files, it is in no way associated with the files themselves. Instead you will view (or create) your own client spec for the server that you're connected to per your local P4PORT and P4CLIENT values. If these values are unset, you will be attempting to connect to a server at perforce:1666 with a client spec name that matches your local hostname.

How can I get revision from other workspace in perforce by command line?

I have a workspace "template" that get some file in local.
I can use gui to create a new workspace, right-click, get revision..., select "template".
Then, the new workspace's local file = template's local file. The file's version is also equal.
How can i use command line do the same thing?
The equivalent of the "get revision" operation you're talking about is to use the client spec template as the revision specifier on a p4 sync:
p4 sync FILE#template
This is commonly used to recreate the state of another client for purposes of recreating a build. The client essentially acts like a label for whatever revisions it has synced. To sync the entire workspace instead of that one specific FILE, simply use p4 sync #template.
Note that this is completely separate from the concept of using the client spec as a "template" for the View of a new client:
p4 client -t template
This will create a new client spec that copies its View from the template client, but the specific set of revisions it's synced to (commonly called the "have list", i.e. the set of revisions referenced by #have within that client and by #client from any other context) is not in any way bound to the template client (unless a ChangeView is used, but that's a whole other thing).
Since these are separate operations it is not necessary to do one in order to do the other.

How to "unsync" files from perforce client?

I have files in my perforce client which I no longer need.
Is there a way to remove the files from my client to free up the space?
I don't want to delete the client and create a new one.
Thanks in advance.
You can sync to any revision, including #none. To temporarily remove a directory (e.g. the current directory, ...) from your client just do:
p4 sync ...#none
If you want to more permanently remove the directory from your client (so it won't come back even if you re-sync your entire workspace), remove it from your client's View:
View:
//depot/... //my-client/...
-//depot/some_directory/... //my-client/some_directory/...

perforce depot converted to streams; can't delete old files from non-stream client

I have a depot that was initially set up as a non-stream depot. We added some files while sorting out folder structure. The depot was subsequently converted to a streams depot, and I want to remove the old files.
Unfortunately those original files do not appear under any stream, so I can't delete them from a stream-based client.
I do have a non-stream client left from initial testing, and I can open the offending files for delete, but I can't submit them:
//depot/myworkspace/main/foo.txt - warning: cannot submit from non-stream client
Is there any client-side way to delete the files? (Note that I am not an administrator on the server -- contacting the admin will be my next step.)

perforce client spec - making different depot paths map to the same client workspace path

I want to create a client with the following view:
//depot/location1/main/... //myclient/main/...
//depot/location2/main/... //myclient/main/...
No files and directories are common between //depot/location1/main/..., and //depot/location2/main/...
But when I do p4 sync, it only syncs from //depot/location2/main/...
How can I make it sync from both locations?
Use this
//depot/location1/main/... //myclient/main/...
+//depot/location2/main/... //myclient/main/...
The plus does what you are looking for, it tells perforce to add the files from that depot location to an already defined workspace location.

Resources