p4 changes -m1 ...#have -> This command shows the current changelist number to which I have synced
p4 sync ...@549683 -> To sync to specific changelist number
p4 integrate //depot/branch1/...@=523456 //depot/main/branch2/... -> Integrate changes
Execute p4 client command and in the UI, replace hostname. You can get hostname detail of current machine by running p4 info command.
Useful link:http://answers.perforce.com/articles/KB/3412
This command will list all the shelved changes per user.
p4 changes -u <USERNAME> -s shelved
Useful link: https://stackoverflow.com/questions/9578881/how-to-list-my-shelved-changes-in-perforce
you can pass --pin to docker run so that you can't docker rm that container without also using --force
docker run -d -v /myData --pin --name my_data tianon/true docker stop my_data # This isn't running, but for showcasing this, stop it docker rm my_data # this will fail even though it's not running docker rm --force my_data # this will work
Useful link: https://github.com/moby/moby/pull/7523
To know latest changelist number
root@8935a9c39976:/ws1/rs_120/usr.src# p4 changes -m1 "./...#have"
Change 685564 on 2018/06/06 by build@sjcpbld84-125 'Label oban_58_8 Not-Reviewed: B'
root@8935a9c39976:/ws1/rs_120/usr.src#
Useful link: https://stackoverflow.com/questions/47007/determining-the-last-changelist-synced-to-in-perforce
Use bash options grep,awk,sed and run the change numbers in for loop
Remove multiple changes at one shot
root@ubuntu:~/ws1# p4 changes | grep deepakk_ubuntu_102_141 | awk '{print $2}' | xargs | sed 's/ /,/g'
647168,632626,632037,627000,626115,622484,620424,618712
root@ubuntu:~/ws1# for i in {647168,632626,632037,627000,626115,622484,620424,618712}; do p4 change -d $i; done
Change 647168 is already committed.
Change 632626 is already committed.
Change 632037 has shelved files associated with it and can't be deleted.
Change 627000 deleted.
Change 626115 has shelved files associated with it and can't be deleted.
Change 622484 has shelved files associated with it and can't be deleted.
Change 620424 deleted.
Change 618712 deleted.
root@ubuntu:~/ws1#
Useful link: https://www.cyberciti.biz/faq/bash-for-loop/
Use bash options grep,awk,sed and run the change numbers in for loop
Delete multiple shelve entries
root@ubuntu:~/ws1# p4 changes -u deepakk -s shelved | grep deepakk_ubuntu_102_141 | awk '{print $2}' | xargs | sed 's/ /,/g'
632037,626115,622484
root@ubuntu:~/ws1# for i in {632037,626115,622484}
> do
> p4 shelve -d -c $i
> done
Shelved change 632037 deleted.
Shelved change 626115 deleted.
Shelved change 622484 deleted.
Example: root@6f46e0830594:~/ws1/rs_121_48_triton/usr.src#p4 revert -c 706017 ...
Reference: https://stackoverflow.com/questions/23550041/how-can-i-revert-all-open-files-in-perforce
When you try to sync a file, perforce expects your files in workspace will have read-only permissions. But if a file is not checkout,(by p4 edit)but has write permission then it will throw the above error. Changing the file to read-only and syncing again will solve the issue. or try removing the workspace and get the latest revision again.
Reference: https://stackoverflow.com/questions/48315647/how-to-fix-perforce-error-cant-clobber-writable-file-or-perforce-error-messag
Steps:
Create a branch spec from the source branch to destination branch
Use 'p4 unshelve -s <change number> -b <branchspec>'
Example:
p4 branch deepakk_test_kamet_49_8_triton will create a branch with below example spec
Then use 'p4 unshelve -s 675541 -b deepakk_test_kamet_49_8_triton' for merging the change
Useful link: http://p4kb.force.com/articles/KB/3372
Create label (Refer below example)
use p4 label <label_name>
Tag codebase with the label
p4 tag -l CIC_LABEL_2_703989 //depot/main/rs_121_48_triton/...@703989
Verify label is correctly put
p4 sync ...@CIC_LABEL_2_703989
Useful link: https://www.perforce.com/perforce/r15.1/manuals/p4guide/chapter.labels.html
Use 'p4 undo @<CL# for undoing>'
For example, p4 undo @12345
Useful link: https://serverfault.com/questions/424242/how-do-i-unsubmit-a-previously-committed-perforce-change-list