Automate the Obliteration of Deleted Files in Depot in Perforce

I don’t know if this is a very common use case, but I had a lot of fairly hefty asset churn in my p4 repo for my project and fairly limited server disk space in which to operate. So, upon ensuring that everything I needed to check in to perforce was done, I went about figuring out how to automate the obliteration of all deleted files (at #head) in the server depot.

I don’t know if I was just overtired and stupid, but I spent a non-trivial amount of time trying to figure out how to do this without combing through the file structure in p4admin and obliterating any deleted files I happened to come across. Please: if there is a better way to do this, I would adore knowing what it is.

Anyway, I wrote a thing about what I ended up with: http://joywando.com/blog/perforce-is-great-definitely-not-the-devil

I wouldn’t be surprised if there was a command built in to do what your describe.
One thing to make sure of when obliterating files is that you’re not obliterating and trying to delete a file that has been lazy-copied.
Found this out the hard way recently :frowning:

Yeah, but that’s a practice I pretty strongly outlawed on our team.

And I talked to a perforce rep after the article was posted: they said obliterate can be dangerous, so they make it very hard to use.

In our teams case, I was the one who did it :slight_smile:

Wasn’t deliberate - just didn’t know about it.
Converted a non-stream based depot to a stream based one.
When it came time to populate, I copied the files over using the appropriate commands.
Followed some tutorial on the subject.
After it was clear that we no longer needed the original depots, I removed them.
And then the lazy copy issue appeared :frowning:

Live and learn.