Is there a difference between terms "Get Latest" and "Check-out" in PerForce terminology?
I am trying to get used to Perforce after using SVN where I was mostly using Commit and Get Latest.
But in perforce I am kind of confused.
What is the difference开发者_如何学编程 between terms Get Latest
and Check-out
in PerForce terminology?
From "Perforce Basic Concepts":
- Get Latest (
p4 sync
) is about transferring files from the depot to your workspace. - Check-out (
p4 edit
) is about getting the latest version from the depot for editing.
When files are checked out for edit, their permissions are set to read-write. When files are not checked out, Perforce sets them to read-only.
As mentioned in "Perforce not syncing files correctly", a refresh (p4 sync
) will update only files that are not opened (checked out) even when "Force Operation" is enabled. (p4 sync -f
).
So the true difference is that a "check out" marks a file as being modified, and protect it from any refresh (any "get latest" operation).
Mark comments (and amend the "difference" I just mentioned above):
If you run a "
get latest
" (orsync
) on a file that is newer than the version that you have open for edit, that will set up a resolve conflict that needs to be dealt with.
So while the file won't be updated by a sync directly, Perforce will set up the conflict so that it can be updated by doing a resolve (and in fact, the resolve must be done before a file open for edit can be submitted).
精彩评论