Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 450
pencilCake Avatar asked Aug 24 '11 12:08

pencilCake


People also ask

What does check out mean in Perforce?

Perforce allows you to check out the head revision or any previous revision of a file. To enforce the IDEs' check-in and check-out procedures, Perforce controls the read-write permissions of files. When files are checked out for edit, their permissions are set to read-write.

What is depot in Perforce?

Depots, where Perforce keeps master file content, and workspaces, where users work on files, are hierarchical structures of directories and files. A filespec uses "//" to indicate the root of the hierarchy, and "/" as a directory path and file name separator. For example: //depot/projectA/doc/index.html.

What is a Perforce Changelist?

When you check out a file, Perforce adds information about the file to a changelist and changes the writable attribute of the file in your local workspace from read-only to read/write. A changelist defines a logical grouping of work across a set of files and folders.

What is tree in Perforce?

The Tree view is the page P4Web shows you when you first connect. It's where you'll spend most of your time in P4Web. You can use it to navigate through path hierarchies and run commands that affect all the files in the current path at once.


1 Answers

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" (or sync) 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).

like image 77
VonC Avatar answered Oct 13 '22 22:10

VonC