6 messages in com.perforce.perforce-userMoving to perforce
FromSent OnAttachments
Koht...@ntc.nokia.com09 Dec 1997 12:12 
Gerd...@bitart.com09 Dec 1997 12:58 
Jere...@softway.com.au09 Dec 1997 17:25 
Laur...@perforce.com10 Dec 1997 12:07 
Brad...@email.mot.com10 Dec 1997 13:11 
Laur...@perforce.com10 Dec 1997 13:32 
Subject:Moving to perforce
From:Gerd...@bitart.com (Gerd@bitart.com)
Date:12/09/1997 12:58:20 PM
List:com.perforce.perforce-user

Kohtala Marko wrote:

Greetings all. I am a new Perforce user and have some problems.

I have a few branches of a program. One branch of the program is maintained elsewhere and I receive patches to update the tree. The other branches have their own source trees on my disk. For history, I just keep some old diffs to the main source tree for my branches.

Now, since this seems so similar to the Perforce idea of SCM, I thought I could try it out. I am hoping to get some help from Perforce in merging the changes made in different branches.

Moving the original source tree to Perforce was no problem. Just set up the client and move to the directory that contains the root of the original source tree and do

find . -type f -print | p4 -x - add p4 submit

Great!

However, now I get a patch file and need to apply it to the source tree. How do I do that? The patch creates files, removed files and changes files. I do not want to do the p4 add, p4 delete, and p4 edit by hand.

Are there any tools to help with the use of patch?

p4sync might help. It is a perl script I wrote a while back. It compares the contents of a directory and all its subdirectories with what perforce thinks should be there, and emits 'p4 add' and 'p4 delete' lines to STDOUT. It does not check if a file has changed, but for that 'p4 diff -se | p4 -x- edit' does a good job. It has not been tested on any other platform but mine (NEXTSTEP), so YMMV. But since it does only print some lines and does not actualy execute the commands it can't harm to try it and check what it produces.

You can find p4sync at http://camelot.bitart.com/perforce .

Of course it comes without any warranties.

Hope it helps!

Another problem is with moving my branches to Perforce. I do not want to add all the files to Perforce and then integrate any common files. This seems to copies of all files to the depot even if they are not different in my branch. It seems like great labor to go through the files and see which files are new and which must be removed.

I may be wrong, but if I understand perforces branching mechanism correctly, it does not actually copy any files in the depot for a branch with the exception of files you actually change in the branch. So branching in perforce is a fairly lightweight process.

Gerd