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

后端 未结 5 1339
南方客
南方客 2021-02-07 10:17

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 anothe

相关标签:
5条回答
  • 2021-02-07 10:37

    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.

    0 讨论(0)
  • 2021-02-07 10:41

    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.

    0 讨论(0)
  • 2021-02-07 10:42
    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.

    0 讨论(0)
  • 2021-02-07 10:47

    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

    0 讨论(0)
  • 2021-02-07 10:47

    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
    
    0 讨论(0)
提交回复
热议问题