directoryversion-controlperforcedirectory-structureperforce-stream

Does P4 preserve file history of a copied/integrated file whose integration source is deleted?


For example, there is a file in my Perforce depot at //my_depot/my_stream/my_folder/file.txt, which has a long revision history. Due to a refactor, the file is then copied (integrated) to //my_depot/different_stream/another_folder/file.txt. This keeps the revision history by keeping a reference to the original file as its "branch from" integration source.

What happens if the original location of the file (in this case, the entire my_stream stream) is deleted? Does the file's revision history remain accessible from the P4 server?


Solution

  • When a file is "deleted" in Perforce, a new revision with the action delete is submitted on top of the existing revisions. Old revisions remain exactly where they are, old integration history referencing those revisions remains valid, et cetera.

    When a stream is deleted, the stream spec is gone, but the depot files that were part of the stream aren't affected in any way, so again, history remains accessible. You can still reference the files by their depot path, and old integration history still points to them.

    When a file is obliterated, its history is gone forever. Only an admin can obliterate files, and this is something that should only be done when history is no longer important (or never at all).