Perforce : My system is such that at compile time few files are created in a temp directory .
Requirement is that ; If the created file is different from the file present in workspace then we copy file from temp directory onto workspace after doing a check out of the file present on the workspace.
How can I do a diff between 2 files in my workspace and get an output if the files are same or different .
I'd do this:
Copy the file(s) into the workspace.
Run "p4 reconcile".
If the files are identical, this will be a no-op. If the files are different, you will get the end result you want (modified files in workspace, opened for edit).
Related
I have files in directory: 1500.txt, 1501.txt, 1502.txt etc.
I have to sync only last N files from remote directory to local directory via SSH, last files - files ordered by name DESC (1502.txt, 1501.txt etc).
Old files from local directory (which not copying in this iteration) must be deleted
LFTP has option order by name but it doesn't has file limit option, may be RSYNC has this option?
I have a workspace with set of files.But i observed that when i delete a file from perforce and do "p4 sync".The file is getting not deleted from the workspace.
But p4 sync -f deletes the file.
p4 sync will only delete a file from the workspace if:
the head revision of the depot file is deleted (check p4 files FILE)
you are currently synced to a different (not deleted) revision of the file (check p4 have FILE)
you do not currently have the file open (check p4 opened FILE)
The only one of these conditions that is affected by the -f flag is #2, so I suspect you had the file in your workspace but weren't on record as having synced it from the server (e.g. the file was put there outside of Perforce, or there was a sync -k, or something like that).
If I copy files from one directory to another directory:
Will their inode numbers also change?
Changes in file of one directory, will it reflect in same file of another directory also?
When I use command like:
cp -r dir1/ dir2/
With a simple copy the file system handle the copied files as newly created ones, therefore assining new inodes to them.
Any change made in the origin wouldn't change the copys. This only happens when you create symbolic or hard links between files.
You can check the inodes of your files with "ls -i filename".
I have folders like this in my perforce workspace view.
//depot/... //rajesh_ws/...
where //depot/... has all the source code and the compiled code will be copied to bin sub directory. I am syncing //depot/... & Building it and copying the binary file in bin sub directoryr.
Now I want to submit the bin folder (//rajesh_ws/bin/...) in Perforce instead of all (//rajesh_ws/...) which has many other files generated during the build.
When i use "p4 status -A" & "p4 submit", it submit all the files which includes //rajesh_ws/... but i want to only submit the files from bin folder. Any idea on this?
I am using p4python api for the same
Script snippet
p4.run("status", "-A")
p4.run_submit( "-d", "Modifying bin folders")
Please suggest
Provide the path as an argument to at least one of the commands:
p4 status -A //rajesh_ws/bin/...
p4 submit -d "Modifying bin folders" //rajesh_ws/bin/...
"p4 status" will only open files matching the file argument (leaving other unopen files in an unopen state); "p4 submit" will only submit open files matching the file argument (leaving other open files in an open state).
I created a new Stream in Perforce and populated it from my local folder.
Inadvertently - I added all object files as well.
Now I want to delete all object files - .o from the depot for a stream
i.e. something like P4 delete //myDepot/myStream/.o (recursively)
Looked at the the P4 commands but can't seem to locate a command that will do that
Try this:
p4 delete //myDepot/myStream/....o