Jump to content


Depot is taking too much space

Depot Space Delete Revision Change depot directory

  • Please log in to reply
2 replies to this topic

#1 AsifNaeem

AsifNaeem

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 26 November 2018 - 05:48 AM

I am using Perforce for revision system for my Unity 3D project. I have submitted bout 90 revisions and now my hard drive is out of memory. I checked the Perforce depot it is taking about 25 GB space. The project I am working is only 2 GB of total size.
How to remove old revisions?
I just want to keep few revisions. How to reduce from 25 GB of depot space?
Is there a simple way to change the depot from C Drive to D drive in my hard disk?
I am using P4V for all operations.

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 665 posts

Posted 26 November 2018 - 03:52 PM

I know you say you're using P4V for everything, but I'm going to refer to the command line anyway because it's easier.  :)

To remove old revisions you can use the "p4 obliterate" command.  You can obliterate all revisions prior to a certain date by using a date specifier, e.g:

p4 obliterate "...@<2018/03/01"

If there are some files that were last modified before that date, though, this will obliterate all of their revisions, which you probably don't want.  More typically you want something like "obliterate all revisions of .PAK files prior to the last 3" -- you can't express this with normal revision specifiers, but you can do clever things with labels to construct a set of revisions matching those conditions:

p4 tag -l to_purge ...PAK#head
p4 tag -l to_purge "@<to_purge"
p4 tag -l to_purge "@<to_purge"
p4 obliterate "@<to_purge"

You can specify that particular files should automatically purge revisions prior to the last n by using the "+Sn" filetype modifier:

echo asdf > temp
p4 add -t +S2 temp
p4 submit -d "only 2 revisions of this file get kept"
p4 edit temp
echo asdf >> temp
p4 submit -d "both revisions of those file are still fine"
p4 edit temp
echo asdf >> temp
p4 submit -d "the first revision of this file has now been purged"

To change the depot location:
1) Run "p4 depot DEPOTNAME" and change the Map: field to refer to D:\whatever
2) Move the current depot location from C:\whatever to D:\whatever

#3 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 665 posts

Posted 26 November 2018 - 10:43 PM

Expanding on this a little:

p4 tag -l head_minus_two ...PAK#head
p4 tag -l head_minus_two "@<to_purge"
p4 tag -l head_minus_two "@<to_purge"

Once you have your label of all the .PAK files with revision #head-2 you could construct an expression to say that you want to get rid of revisions older than a given date but still keep at least three revisions of everything, like:

p4 obliterate -y "@<head_minus_two,@<2018/03/01"

i.e. "obliterate every revision that is smaller than the one in my head_minus_two label AND was submitted prior to 2018/03/01"




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users