[p4] A script or command to mirror a local directory in Perforce?
Jeff Grills
jgrills at junctionpoint.com
Mon Feb 27 14:47:29 PST 2006
"p4 diff -sd | p4 delete" should do you what you want.
j
-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Taylor Brown
Sent: Monday, February 27, 2006 3:59 PM
To: perforce-user at perforce.com
Subject: [p4] A script or command to mirror a local directory in Perforce?
We are checking in the results of our product builds to Perforce. We
would like to check the full product into the same location in Perforce
each time, and simply label it with the version number. That way, we'll
only need to sync to a label to get the proper build of the version.
In order to do this, we will need to delete files that were in the
previous build but not in the new build. Likewise, we need to add files
that are in the new build, but that were not in the old, and we need to
edit and submit files that have changed. In short, we want to mirror
our local build directory in Perforce. Adding and editing files will be
easy:
To add, we could just ask Perforce to add all files in the directory,
and it will happily ignore all the files it already knows about. We can
also open every file for edit and then revert all files that are
unchanged to make sure we've edited all changed files.
Deleting files that are no longer there however, presents a bit more of
a challenge. I am about to write a script that lists the files in the
depot and compares them to the files on disk to look for files that are
in the depot but that are not on the disk. Has someone already made
such a mirror utility? Is there something in Perforce that already does
this? It seems like something people would commonly want to do.
Many thanks,
Taylor Brown
_______________________________________________
perforce-user mailing list - perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user
More information about the perforce-user
mailing list