Under the hood: What happens when you check out a file or directory

Because a snapshot view contains copies of files and directories, and a dynamic view provides access to data in VOBs, different procedures are followed for checking out from the different view types.

Checking out from a snapshot view

When you check out a file or directory from a snapshot view, the request is handled as follows:

  1. The following information is gathered:
    • The version currently loaded in the view
    • The version selected by the config spec
    • The latest version in the VOB
  2. One of the following occurs.
    • On Linux and the UNIX® system, if the version of a file in your view is not the latest in the VOB, you are notified. If you use the -query option when checking out a file, you are asked to specify which version to check out. If you use the -query option when checking out a directory, you are notified, but you are required to check out the version of the directory currently loaded in your view.
    • On the Windows® system, for directory elements, you are required to check out the version of the directory currently loaded in your view.

    The version in your view will not be the latest in the VOB if either of these conditions exist:

    • Someone else has checked in a new version since you last updated your view.
    • The config spec of your view selects versions based on a label or a time rule, and the latest version in the VOB falls outside those parameters (see the figure).

      The version tree of prog.c main branch has versions 0 through 3, which is the latest version in the VOB. Label BL3 is attached to version 2, which is the version that the view selects.

      The label BL3 selects the nonlatest version of the element.

  3. If you check out a version other than the one currently loaded in your view, the checked-out version is loaded into your view.
  4. The VOB is notified which version of the element you checked out.

    On Linux and the UNIX® system, files are made writable. For directories, you are allowed to use the mkelem command to add new elements to source control.

    On the Windows® system, for files, the Read-Only attribute is removed. For directories, you are allowed to add new elements to source control.

Special actions are performed when you check out VOB links in a snapshot view.

Checking out from a dynamic view

When you check out a file from a dynamic view, the request is handled as follows:

  1. If the version-selection rules for your view do not select the latest version in the VOB and you use the -query option with the checkout command, you are prompted to choose a version to check out.

    Your view may not select the latest version in the VOB if, for example, your config spec selects versions based on labels or time rules (see the figure).

    The version tree of prog.c main branch has versions 0 through 3, which is the latest version in the VOB. Label BL3 is attached to version 2, which is the version that the view selects.

    If you do not use the -query option, the latest version is checked out without any notification. Use the -ver option of the checkout command to check out the version that your view selects, even if it is not the latest in the VOB.

    You can check in a version that is not the latest on the branch.

  2. The VOB is notified which version of the element you checked out.
  3. For files, an editable view-private file, which is a copy of the checked-out version, is created in the view. For directories, you are allowed to use the mkelem command to add new elements to source control.