[p4] [***SPAM***] Re: Diffing renamed files before submitting

Greg Leach gregleach at kromestudios.com
Thu Oct 11 22:47:09 PDT 2007


P4Win does have the option - it just depends on which context menu 
you're in.  The context menu for files in the depot pane has a "Diff 2 
Files/Revisions" which brings up a dialog with options similar to what 
Richard said. 

To use it, you should:

1)  right click on the old (being deleted) file in the depot
2) Choose "Diff 2 Files/Revisions"
3) set the first file as the old one, using the head revision.
4) Second file becomes the new one, using the file in client workspace.
5) Click OK.

The odd thing is that this option does not appear in the context menu 
for files in changelists - only files in the depot/client tree view.

Cheers,
-Greg

Alen Ladavac wrote:
> Thanks for this hint, Richard!
>
> Seems that p4win doesn't have that option though. But we've found
> another workaround - we show history on the deleted file, then
> right-click on the last (non-deleted revision) and choose "View
> using/other viewer..." then choose BeyondCompare, which effectively
> does "p4 print" and puts it in the left pane, then we drag-and-drop the new
> file from p4win into the right pane.
>
> Thanks!
>
> Alen
>
> Richard wrote:
>
>   
>> Using P4V:
>>     
>
>   
>> 1) Right-click on the renamed and edited file.  Choose "Diff against..."
>> 2) Make sure the depot path to the new name of the file is the "1st
>> Path".  (ie: //depot/NewFile.cpp)
>> 3) Choose "Workspace version on local disk" under 1st Path.
>> 4) Enter the depot path to the old name of the file as the "2nd Path".
>> (ie: //depot/OldFile.cpp)
>> 5) Choose "Latest Revision" under 2nd Path.
>> 6) Click "Diff"
>>     
>
>   
>> Using P4V and P4D 2007.2.  I haven't tried it in older versions.
>>     
>
>   
>> I can't seem to find a way to do it via the command-line either.  P4V
>> appears to use the "p4 print" command to retrieve the contents of the
>> deleted file into a temporary local file before passing both files to
>> P4Merge to do the diff.  (Basically automating what you are already
>> doing by manually comparing the files on another client).
>>     
>
>   
>> - Richard
>>     
>
>   
>> -----Original Message-----
>> From: perforce-user-bounces at perforce.com
>> [mailto:perforce-user-bounces at perforce.com] On Behalf Of Alen Ladavac
>> Sent: Wednesday, October 10, 2007 5:50 am
>> To: perforce-user at perforce.com
>> Subject: [p4] Diffing renamed files before submitting
>>     
>
>   
>> A curious problem came up by one of my colleagues and I was certain
>> that p4 could handle that nicely even in p4win, but even resolving to
>> manual command line option wizardry didn't help.
>>     
>
>   
>> The scenario is:
>>     
>
>   
>> 1) open a file for rename, which turns out as a delete and an add
>> (branch)
>> 2) reopen it for edit (because you need to change the #include
>> filenames in it, if you are to submit e.g. .h and .cpp both renamed in
>> one go.)
>> 3) now try to check the diffs you did in this edit.
>>     
>
>   
>> It is weird that once you submit this, the history is very easy to
>> access and the diffs work normally, but we'd like to see the diffs
>> before submition - to be sure what was done. Somehow seems that there
>> is no way to force p4 to compare one file in depot with another file
>> on client. The only way around it we've found was to use another
>> client to sync the deleted file and manually compare two files on the
>> disk using BeyondCompare.
>>     
>
>   
>> Is there something we are missing here? Is there some reason why this
>> should be so complicated?
>>     
>
>   
>> Thanks,
>> Alen
>>     
>
>   
>> _______________________________________________
>> perforce-user mailing list  -  perforce-user at perforce.com
>> http://maillist.perforce.com/mailman/listinfo/perforce-user
>>     
>
>   
>> _______________________________________________
>> perforce-user mailing list  -  perforce-user at perforce.com
>> http://maillist.perforce.com/mailman/listinfo/perforce-user
>>     
>
>
>
>
>   




This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect.


More information about the perforce-user mailing list