How can I grab my local changelist and send it to someone else in Perforce?

三世轮回 提交于 2019-12-20 18:12:06

问题


How can I grab my local changelist and send it to someone else in Perforce? More specifically, I would like to send unsubmitted changes from a local pending changelist to another user's pending changelist.


回答1:


set P4DIFF=C:\cygwin\bin\diff.exe
p4 diff -du -c 12345 > patch-to-head.diff

# On Other machine
patch -p1 < patch-to-head.diff

I may be wrong on the env var there, and you might have to do some fixups on the diff file, but the general idea is that you generate a GNU Unified Diff, that you can send to people that can use GNU patch to apply it.




回答2:


P4 now has native support for the shelve operation in 2009.2. Both the client and server need to be at least 2009.2 to use this.

http://blog.perforce.com/blog/?p=1872




回答3:


Not sure exactly what you are trying to do, but you may also want to consider P4_Shelve. It allows you to put a load of pending changes away on a virtual shelf, and then grab them back again later. Depending on what exactly you want to achieve by sending a changelist to someone else, this could provide a part of the answer.

Linked from the P4Shelve site is P4Tar which may also be useful - this does all the packing on the client side so you just get left with a file you can send to someone else.




回答4:


To shelve your pending changelist YOURCHANGE:

p4 shelve [-c YOURCHANGE]

The other user then does:

p4 unshelve -s YOURCHANGE [-c THEIRCHANGE]

In either case the "-c" arg can be omitted to use the default changelist instead. In the p4 shelve case it means a new changelist will be created and the files in your default changelist will be shelved into it; in the p4 unshelve case it means the shelved files from your changelist will be unshelved into the other user's default changelist.




回答5:


Perforce 2016, osx. Diff for pending changelist:

mac:src user$ cl=123456 && p4 diff -du $( p4 files @=$cl | sed s/#.*// ) > $cl.diff

output: 123456.diff

Applying patch:

mac:src user$ patch -p0 < 123456.diff


来源:https://stackoverflow.com/questions/373234/how-can-i-grab-my-local-changelist-and-send-it-to-someone-else-in-perforce

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!