// // Copyright 2007 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wResolveIAProcessorPane: // Runs the real p4 resolve command #include <p4wp4.h> #include "p4wStrBuf.h" #include "p4wHtml.h" #include "p4wPane.h" #include "p4wResolveIAProcessorPane.h" p4wResolveIAProcessorPane::p4wResolveIAProcessorPane( p4wView & ParentView, p4wRequest & Request, char **pErrMsg, StrBuf *pmd5in, p4wStrBuf *peditbuf, int rc ) : p4wPane( ParentView, Request ), fSeenData(0) { fErrMsg = pErrMsg; md5in = pmd5in; editbuf = peditbuf; fRC = rc; } p4wResolveIAProcessorPane::~p4wResolveIAProcessorPane() { } // ------------------------------------- // Render functions. // void p4wResolveIAProcessorPane::Begin() { } int p4wResolveIAProcessorPane::Resolve( ClientMerge *m, Error *e ) { fSeenData = 1; if (fRC) return fRC; FileSys *f = m->GetResultFile(); if (!fRequest.isLocalRequest() && (f->Stat() & FSF_SYMLINK) && !SEC_ALLOW_CR8CHG_SYMLINKS) { *fErrMsg = "A Symlink may not be written by a remote browser."; return fRC = CMS_SKIP; } *fErrMsg = WriteMergedFile(f, e); if (*fErrMsg) return fRC = CMS_SKIP; StrBuf md5; f->Digest(&md5, e); if (!e->Test() && md5 == *md5in) return fRC = CMS_MERGED; e->Clear(); return fRC = CMS_EDIT; } char * p4wResolveIAProcessorPane::WriteMergedFile(FileSys *f, Error *e) { StrBuf buf; StrBuf md5; f->Digest(&md5, e); if(e->Test() || md5 != *md5in) return "Bad security key"; f->WriteFile( editbuf, e ); if (e->Test()) return "Unable to write new merge file."; return 0; } void p4wResolveIAProcessorPane::End() { } void p4wResolveIAProcessorPane::RenderInfo( char *data, char level ) { } void p4wResolveIAProcessorPane::RenderError( char *data, int escapeHTML ) { fErrBuf << data; *fErrMsg = fErrBuf.Text(); }
# | 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/p4wResolveIAProcessorPane.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |