/****************************************************************************** Copyright (c) 2004, Perforce Software, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PERFORCE SOFTWARE, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ /****************************************************************************** * TMIntegUser.cpp - description * ------------------- * begin : 2005/05/26 * copyright : (C) 2005 by Harald K. Strack * copyright : (C) 2005 by Trymedia Inc. * email : hstrack@trymedia.com, strack@fhm.edu ****************************************************************************** * changes name date comment */ /* TMIntegUser: Trymedia Client User. * * The code for Message() has been taken and adapted from Tony Smith's project: * * http://public.perforce.com:8080/guest/tony_smith/perforce/p4u/main/?ac=83 * * Thanks to him, I did not need to fiddle around with this stuff. * * * This user hooks the Message() call to get the versioned paths of all reverted * files. * * */ #include "TMIntegUser.h" static StrRef msgBranchSync (" - branch/sync from "); TMIntegUser::TMIntegUser ():TMClientUser () { } /* Set the appropriate handler */ TMIntegUser::TMIntegUser (ClientApi * a):TMClientUser (a) { skippedLast = 1; SetTMBO (INTEG_HANDLER); } /* Delete the handler and start operations */ TMIntegUser::~TMIntegUser () { delete tmbo; } // // Only called when we run the integrate. For each output message, find the local // path in the message (if possible), and append it to the worklist. If the // message is an error message, pop the last item off the worklist. // void TMIntegUser::Message (Error * err) { // Ensure default behaviour happens if (!err->IsInfo ()) { skippedLast = 1; TMClientUser::Message (err); return; } else { TMClientUser::Message (err); } StrBuf m; err->Fmt (&m, EF_PLAIN); StrBuf file; StrBuf fileN; StrBuf tmp, empty; const char *pos = 0; if ((pos = m.Contains (msgBranchSync))) { fileN.Set (m.Text (), pos - m.Text ()); tmp.Set (m.Text (), fileN.Length () + msgBranchSync.Length ()); StrOps::Replace (file, m, tmp, empty); } else { skippedLast = 1; return; } skippedLast = 0; /* FIXME: Possible bug ... When the output (Massage()) * and The access to the files is not like 1:1 (synchronized * This will fuck up everyting! But you only will have wrong * permissions on wrong files. So you may not recognize the error.*/ tmbo->SetVPath (tmbo->GetHeadNode (), &file); tmbo->SetVNPath (tmbo->GetHeadNode (), &fileN); } // // Handle errors during syncs // void TMIntegUser::HandleError (Error * e) { TMClientUser::HandleError (e); if (!e->IsInfo ()) { if (!skippedLast) tmbo->PopNode (); return; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 5056 | harald_strack |
Directory support. Serious bug concerned to not unzipped binaries removed. Some other small bugfixes. |
||
#3 | 4980 | harald_strack |
Since I am maintaining the stuff in a local repository, I did some copy errors in the last revisions. Fixed. |
||
#2 | 4979 | harald_strack | Help output hooked. | ||
#1 | 4978 | harald_strack |
ap4 integrate implemented. Octal format is now used to save permissions. NOT backwards compatible anymore!!! |