A file can be opened for edit if:
- The file is synced in your workspace
- You have permission to open the file
- The file is not already opened in your workspace
When Perforce puts files in your workspace, it normally gives them read-only
permission to start with. (See the sync command to find
out how to get files into your workspace.) The open for edit command
makes files writable so you can edit them, and puts them in a pending changelist
so you can submit them later. The icon indicates that
you have files open for edit.
You can open files for edit by:
- Choosing Open for edit... from the pulldown menu on the Files tab.
This menu option displays the Open for Edit Options page, described
in more detail below.
- Selecting the file and clicking the Open for edit button, which opens
the selected file for edit in the default changelist without changing its
filetype.
The Open for Edit Options page
Selecting Open for edit... from the pulldown menu displays the Open
for Edit page, where you can select the following file options.
- Put opened files in changelist: If your client workspace has more
than one pending changelist, this option enables you to select the changelist
into which opened files appear.
- Specify filetype: Use this option to change the filetype
of Perforce-managed files. Click the checkbox and select the filetype and
filetype modifier(s). When you submit files opened this way, the new revisions
in the depot will have the new filetype.
- Restricting files: If you came to this page by clicking a directory
and then choosing Open for edit... you can restrict
the files to be opened.
After you have selected your options, click Open for edit.
Editing files when P4Web is running on a remote machine
P4Web mediates between a Web browser and a Perforce server.
P4Web can run on a machine that is separate (remote) from both the browswer
and server machines. The important thing to understand is that your client
workspace resides on the machine where P4Web is running. To edit files,
remote users (users who are browsing from a machine other than the one where
P4Web is running) must download the files to their local machine after checkout.
To check the edited files in, remote users must upload them to the P4Web machine
before. To edit files when working remotely, perform the following steps:
- Sync the file.
- Open the file for edit as described above.
- Download the file from the workspace on the P4Web
machine to your local machine: choose Download file from Workspace from the Action menu.
Because you're
working locally on a copy of the file from the workspace, it doesn't matter
where you save it on your local machine. When you upload it in step 5 below,
you replace the workspace version with your edited version.
- Edit the file.
- Upload the file: Choose Upload File to Workspace
from the Action menu, specify the file to be uploaded, and click Upload.
- Submit the file.
If you're editing text files, you can edit them directly in
the browser, instead of downloading them and opening them with a text editor.
To edit a text file in the browser, choose Edit Workspace File in P4Web
from the Action menu. Edit the file and choose Save to save your
changes.