[p4] diff2 + added files?

Sohail Somani sohail at taggedtype.net
Tue Dec 4 09:01:07 PST 2007


On Tue, 04 Dec 2007 09:01:18 -0700, Looney, James B wrote:

> I usually do that using labels.  I'll create a label in one workspace
> (usually our mainline) and the second in a branch.  Then use p4 diff2 -q
> //... at mainline_label //... at branch_label
> 
> If you're scripting it, I'd recommend adding the -G (marshaling) as it
> makes the file organizing a LOT easier since it'll tell you which files
> were added/deleted/modified without you having to parse each line
> yourself.  The -q just suppresses the actual diff output and the header
> info for identical files.

Thanks for your reply.

Unfortunately, I don't think I was clear enough! What I want to do is 
take a diff of the two branches for the purposes of code review. So I 
want all the added and removed content, including *added* and *deleted* 
files. So say hello.txt was added with text "Hello, World", I'd want to 
see:

==== <none> - //.../hello.txt
+ Hello, World

Similarly, if the file was deleted, I'd want to see:

==== //.../hello.txt - <none>
- Hello, World

For all the text files. Right now, I can only see:

==== <none> - //.../hello.txt
==== //.../hello.txt - <none>

i.e., no content.

-- 
Sohail Somani
http://uint32t.blogspot.com


More information about the perforce-user mailing list