// Copyright 2001 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wBranchDiffPane: // Displays output of the diff2 -q -b branch command #include <p4wp4.h> #include "p4wStrBuf.h" #include "p4wHtml.h" #include "p4wPane.h" #include "p4wBranchDiffPane.h" p4wBranchDiffPane::p4wBranchDiffPane( p4wView & ParentView, p4wRequest & Request ) : p4wPane( ParentView, Request ), fDiffsFound(0) { } p4wBranchDiffPane::~p4wBranchDiffPane() { } void p4wBranchDiffPane::Begin() { // // Begin the pane. p4wHtml htm; StrBuf title; p4wURL urlMaker; StrBuf grayIcon; StrBuf clearIcon; // // Used to generate a line underneath the title and some // vertical whitespace urlMaker.ConstructURL( grayIcon, "/grayPixelIcon", AC_ICON, NULL ); urlMaker.ConstructURL( clearIcon, "/clearpixelIcon", AC_ICON, NULL ); htm.comment( "BEGIN BRANCHDIFF PANE" ); title << "Compare Branched Files "; title << p4wStrBuf().EscapeHTML( fRequest.GetURL(), Unicode() ).Text(); title << ":"; htm.beginTRow(); htm.beginCol(); htm.beginSpan( "title" ); htm << title; htm.endSpan(); htm.endCol(); htm.endTRow(); htm.beginTRow(); htm.beginCol( "top" ); htm.icon( grayIcon.Text(), "1", "100%", "", 1, "0", "0" ); htm.endCol(); htm.endTRow(); htm.beginTRow(); htm.beginCol(); htm.icon( clearIcon.Text(), "20", "0", "", 1 ); htm.endCol(); htm.endTRow(); htm.beginTRow(); htm.beginCol(); htm.beginDList(); htm.dListTag(); fRequest << htm; } void p4wBranchDiffPane::RenderInfo( char *data, char level ) { // // Output the list of files that differ in branch // (diff2 -q -b branch) if( strstr( data, "<none>" ) || strstr( data, "< none >" ) ) return; fDiffsFound = 1; if( !PageLimitExceeded() ) { p4wHtml htm; htm.dListVal(); // // Remove the diff markers from final output char *s = strstr( data, "//" ); if( !s ) s = data; char *e = strstr( s, "====" ); if( e ) *e = '\0'; htm.text( p4wStrBuf().EscapeHTML( StrRef ( s ), Unicode() ).Text() ); fRequest << htm; } } void p4wBranchDiffPane::End() { // // End the pane p4wHtml htm; if( !fDiffsFound ) { htm.dListVal(); RenderError( "No files differ.", 1 ); } htm.endDList(); htm.endCol(); htm.endTRow(); htm.comment( "END BRANCHDIFF PANE" ); fRequest << htm; } void p4wBranchDiffPane::RenderError( char *data, int escapeHTML ) { RenderErrorList( data, escapeHTML ); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 12234 | Matt Attaway |
Rejigger P4Web project in preparation for official sunsetting The bin directory contains the last official builds of P4Web from the Perforce download site. P4Web is soon to be completely sunsetted; these builds are here for folks who don't want to build their own. To better handle the archived builds the source code has been moved into a separate src directory. |
||
//guest/perforce_software/p4web/Panes/p4wBranchDiffPane.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |