Renaming files in Perforce?

前端 未结 5 917
后悔当初
后悔当初 2021-02-14 22:39

Every time I rename a file in Perforce it actually deletes an old file and adds a new one. As a result the new file doesn\'t share the old\'s file history. Is there an easy way

相关标签:
5条回答
  • 2021-02-14 23:11

    If you are using a recent enough version of Perforce (server and client), you can use the move command to rename a file while maintaining the history more like what you expect. However, as EboMike said, as long as the integration was done, the history is there... it is just slightly less accessible.

    0 讨论(0)
  • 2021-02-14 23:17

    Are you using P4V? It doesn't really delete and add it, it will branch it and then delete the old file (you will see that the new file shows up with the #branch action). That way, the new file will retain the history. It's sometimes not immediately visible, but if you choose to "show branching history", you will see the full history of the file, including everything that happened prior to its renaming.

    0 讨论(0)
  • 2021-02-14 23:23

    If viewing the history in p4v, there should be an icon at the tab of the History tab that gives you the option to "Follow Branch Actions" or "Follow Both Branch and Copy Actions".

    On the command line type

    p4 filelog -i file
    

    The '-i' flag will display the integration history as well.

    0 讨论(0)
  • 2021-02-14 23:26

    Try using the Revision Graph option for a file, it looks a bit scary to start with but switch off the branches your not interested in and it can be really useful for tracking changes to files across integrations / branches

    0 讨论(0)
  • 2021-02-14 23:36

    Use p4 move

    According to Perforce, this command will "Move (rename) a file from one location to another."

    http://www.perforce.com/perforce/doc.current/manuals/cmdref/move.html

    0 讨论(0)
提交回复
热议问题