Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 Server Administration Documentation | 2025.1

# Sync using an automatic label

P4 Server’s automatic label feature enables you to specify which repos you want to sync with which branches, tags, or commits. This enables you to sync to multiple repos, not all of which are at the same branch, tag, or commit.

This might be useful when you are building a Git project that is dependent on other projects that are at a particular release version, tag, or commit (SHA-1). In non-P4 Server Git solutions, the manifest file traditionally performs this function.

To sync more narrowly than at the repo level, use the `View` field in the client (workspace) specification. See the topic p4 client in P4 CLI Reference.

To use automatic labels with Git repos, you edit the label specification (spec) by issuing the `p4 label` command. In particular, you edit two fields: `Revision` and `View`:

- The `Revision` field must always be set to `"#head"` when using automatic labels with Git repo data.
- The `View` field contents vary according to what you want to sync to.

With the following label spec settings, P4 Server syncs:

- the collection of repos under depot `//android` to tag `android-7.1.1_r23`.
- the collection of repos under `//android/platform/build` to the default branch.
- the repo `//android/platform/build/kati` to commit SHA-1 `341a2ceccb836ab23f92c0ba96d0a0e73142576`.

Copy

    # A Perforce Label Specification.
    #
    #  Label:       release1_build
    #  Update:      The date this specification was last modified.
    #  Access:      The date of the last 'labelsync' on this label.
    #  Owner:       bruno
    #  Options:     Label update options: [un]locked, [no]autoreload.
    #  Revision:    "#head"
    #  View:        Lines to select depot files for the label.
    #
    # Use 'p4 help label' to see more about label views.

    Label:  release1_build

    Owner:  bruno

    Description:
            Created by bruno.

    Options:        unlocked noautoreload

    Revision:    "#head"

    #  View:        Lines to select depot files for the label.
    View:
            //android/…@refs/tags/android-7.1.1_r23
            //android/platform/build/…@default-branch
            //android/platform/build/kati/…@341a2ceccb836ab23f92c0ba96d0a0e73142576

For more information on automatic labels, see the chapter Labels in P4 CLI Documentation.

Your search for returned results