/****************************************************************************** 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. *******************************************************************************/ /****************************************************************************** * TMRevertUser.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 */ /* TMRevertUser: 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 "TMRevertUser.h" static StrRef msgEditReverted (" - was edit, reverted"); static StrRef msgDeleteReverted (" - was delete, reverted"); static StrRef msgEditReverted2 (" - was edit, unlocked and reverted"); static StrRef msgDeleteReverted2 (" - was delete, unlocked and reverted"); TMRevertUser::TMRevertUser ():TMClientUser () { } /* Set the appropriate handler */ TMRevertUser::TMRevertUser (ClientApi * a):TMClientUser (a) { skippedLast = 1; SetTMBO (REVERT_HANDLER); } /* Delete the handler and start operations */ TMRevertUser::~TMRevertUser () { delete tmbo; } // // Only called when we run the revert. 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 TMRevertUser::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; const char *pos = 0; if ((pos = m.Contains (msgEditReverted))) { file.Set (m.Text (), pos - m.Text ()); } else if ((pos = m.Contains (msgDeleteReverted))) { file.Set (m.Text (), pos - m.Text ()); } else if ((pos = m.Contains (msgEditReverted2))) { file.Set (m.Text (), pos - m.Text ()); } else if ((pos = m.Contains (msgDeleteReverted2))) { file.Set (m.Text (), pos - m.Text ()); } else { skippedLast = 1; return; } skippedLast = 0; tmbo->PushNode (); tmbo->SetVPath (tmbo->GetHeadNode (), &file); } // // Handle errors during syncs // void TMRevertUser::HandleError (Error * e) { TMClientUser::HandleError (e); if (!e->IsInfo ()) { if (!skippedLast) tmbo->PopNode (); return; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#5 | 5056 | harald_strack |
Directory support. Serious bug concerned to not unzipped binaries removed. Some other small bugfixes. |
||
#4 | 4980 | harald_strack |
Since I am maintaining the stuff in a local repository, I did some copy errors in the last revisions. Fixed. |
||
#3 | 4979 | harald_strack | Help output hooked. | ||
#2 | 4978 | harald_strack |
ap4 integrate implemented. Octal format is now used to save permissions. NOT backwards compatible anymore!!! |
||
#1 | 4975 | harald_strack |
Permissions are now masked to 555, so no write is possible. If you edit the Makefile and give the parameter -DFULL_PERMS, you have the old behaviour. Bugfix in ap4 revert: Edited and changed files were not reverted correctly. |