I am trying to download/sync locally into my Perforce workspace a file from another stream of my P4V, I've tried p4.run_sync("-f", "//depot-of-file") in my python script but it doesn't work. Any idea?
Asked
Active
Viewed 785 times
1 Answers
1
The sync
command will download files according to your current client view. If your client is viewing a stream that doesn't include the file, you can't sync it. There are three different solutions depending on what exactly you're trying to do:
- Switch your client to a stream/view that does include that file.
- Modify your current stream to import that file, e.g.:
Paths:
share ...
import path/some_file //depot/path/some_file
- Use
p4 print
to download a copy of that file that's disconnected from the depot (you won't be able to make changes to it, and you will need to delete it manually later):
p4 print -o some_file //depot/path/some_file

Samwise
- 68,105
- 3
- 30
- 44
-
Thanks, one more question which path exaclty do I need to write in share and import, only the path of where my file in perforce is founded? – user14635293 Nov 16 '20 at 10:04
-
The `import` statement first specifies the path in the current stream/client where you want the file to go (i.e. relative to the client root of all clients of that stream), and second the depot path where the file is located. This can also be a directory instead of a single file, e.g. `import path/... //depot/path/...`. You should already have at least one `share` line in the stream spec that says which files live in the stream's own depot namespace (the default is `...`) and don't need to change that line. – Samwise Nov 16 '20 at 15:00