Jump to content


Adding/Removing large amounts of files

add delete

  • Please log in to reply
5 replies to this topic

#1 TomYeti

TomYeti

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 30 August 2016 - 08:02 PM

I'm having a hard time wrapping my head around Perforce. I come from a land of git, and with most git clients and I freely add and remove large amounts of files to projects without much hiccup, provided of course I'm using branches and other tools to mitigate risks of other users editing stuff I'm just going to delete.

With perforce, it seems like I need to tell perforce exactly what I'm working on or it won't let me (correctly) work on stuff. To me this seems weird, but I need to understand Perforce rather than write it off.

We've got a project from another team using perforce. We need to update an old SDK (google cardboard) with a new SDK (google VR), which means we need to remove whole folders and trace amounts of things related to cardboard and import the new SDK under an entirely different name. Perforce has a specific way it wants me to interact with my workspace. Perforce making lots of things read-only really F**ks with Unity's ability to update and compile new packages.

So what is the best way to delete and add large numbers of files? Should I checkout the entire depo? Or try and duplicate the depo and reintegrate it after I'm confident it's working with the new SDK?

#2 P4Sam

P4Sam

    Advanced Member

  • Members
  • PipPipPip
  • 484 posts
  • LocationSan Francisco, CA

Posted 30 August 2016 - 10:43 PM

View PostTomYeti, on 30 August 2016 - 08:02 PM, said:

Perforce has a specific way it wants me to interact with my workspace. Perforce making lots of things read-only really F**ks with Unity's ability to update and compile new packages.

It sounds like you might want to use the "allwrite" workspace option to make everything writable and use the "p4 reconcile" command to open files after you've modified (or added or deleted them).  This will make the workflow closer to what you're used to.

The benefits of doing it the standard Perforce way with "p4 edit" etc are first that it makes everything faster (reconcile needs to do digest verification across your entire workspace to figure out what you've changed, whereas if you just say what file(s) you're editing it's instantaneous), and second that your teammates know immediately that you're working on the file, which can sometimes head off the need to resolve conflicts later.  In cases where it's not possible to explicitly check files out before working on them, though, allwrite/reconcile might be the better option.

#3 TomYeti

TomYeti

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 31 August 2016 - 04:58 PM

View PostP4Sam, on 30 August 2016 - 10:43 PM, said:

It sounds like you might want to use the "allwrite" workspace option to make everything writable and use the "p4 reconcile" command to open files after you've modified (or added or deleted them).  

Ahh, thank you, I did not know about the allwrite option. Previously I was checking out about 15 gigs of files to make sure everything was able to compile and that takes a long time

#4 TomYeti

TomYeti

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 31 August 2016 - 09:44 PM

Okay so I've tried this out. I made it allwrite. I added the new SDK without removing the old one, found that it was not writable, so I assumed that obviously it was not technically part of the project to perforce, so i reconciled the changes. It takes awhile, but I guess the time it takes is more front loaded when you're adding a bunch of stuff. Does that sound like the right way to go about things? Add folders, reconcile, work on stuff? Delete folders, reconcile, work on stuff?

#5 P4Sam

P4Sam

    Advanced Member

  • Members
  • PipPipPip
  • 484 posts
  • LocationSan Francisco, CA

Posted 01 September 2016 - 02:12 AM

If the new SDK is going into a completely different folder from the old one, and you want to add the new SDK and delete the old SDK, you can do it a lot faster by dropping the new SDK into the new folder, and then doing "p4 add" on the new one and "p4 delete" on the old one -- again, if you can just tell Perforce what you're doing, it's much quicker than scanning the whole workspace for differences relative to the depot.  Reconcile is going to be easier if you're copying the new one on top of the old one and just want to detect the differences and submit them.

#6 TomYeti

TomYeti

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 01 September 2016 - 04:51 PM

That makes sense. I initially wasn't going to do it that way because each SDK package has bits and pieces strewn about that I thought I would have to clean up, but turns out they work fine as long as the base folder is gone. Obviously that leaves the bits and pieces lying around, but that's never stopped whoever made this project before :P (there are PDFs in the unity project ahhhh)

So, it works, so far.

Thanks for your help. Perforce is like a hard candy with a creamy center. It's difficult to break into, but starts getting easier as you make progress.





Also tagged with one or more of these keywords: add, delete

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users