Script to load AutoMap with documents from specified Perforce depot name
Specify the Perforce depot and path to retrieve documents from with <DEPOT-NAME> and <PATH>.
The Perforce "sync" command is used to make sure that the client workspace is up-to-date with the latest depot files. Then all the filenames located in the client workspace directory that have the proper extension (*.fm) are listed to be published with AutoMap.
p4 -p <SERVER>:<PORT> -u <USERNAME> -P <PASSWORD> -c <CLIENT-WORKSPACE-NAME> sync //<DEPOT-NAME>/<PATH> dir C:\<CLIENT-WORKSPACE-DIRECTORY>\*.fm,*.doc /S /B > "${FileListPath}"
Script steps explained:
- Perforce "sync" command is used to retrieve the latest depot files to the previously established client workspace.
- The "dir" command is used to create a list of all the files in the client workspace directory that have the ".fm" extension.
Note:
Unlike other version control systems, Perforce is based around specifying a specific client side directory using a named client workspace. Directories on the server are mapped to the client using the client workspace specification. This means that in addition to creating the AutoMap script, a client workspace will have to be created. See Perfoce docs for more information.