[p4] Is there a way to check out a file but not get a local copy?

Ivey, William william_ivey at bmc.com
Tue Feb 27 08:10:47 PST 2007


> -----Original Message-----
> From: perforce-user-bounces at perforce.com
> [mailto:perforce-user-bounces at perforce.com]On Behalf Of Eramo, Mark
> Sent: Monday, February 26, 2007 4:17 PM
> To: perforce-user at perforce.com
> Subject: [p4] Is there a way to check out a file but not get a local
> copy?
> 
> I have a question in regards to p4add
> 
> Is there a way to Check a File out from the Perforce 
> repository but not
> actually get a local copy? I see there is a -n option but that looks
> like a preview option and might not actually do anything.
> 
> The reason I need to do this is our build process builds a new jar and
> drops it into the release folder. We will then call Perforce 
> to checkout
> what is in that folder in the repository without getting a local copy
> then submitting the new copy in the release folder to the repository.

I think something like this may do what you want:

rm -f yourfile        # Remove the existing file, if any
cp somefile yourfile  # Copy (or create) the new version of it
chmod a-w             # Make it read-only
p4 flush //yourfile   # Make Perforce think you have the latest version
p4 edit //yourfile    # Open for editing
p4 submit //yourfile  # Submit it

-Wm



More information about the perforce-user mailing list