//------------------------------------------------------------------------ // Copyright 2006 Kyle Turner. // // License is hereby granted to use this software and distribute it // freely, as long as this copyright notice is retained and modifications // are clearly marked. // // ALL WARRANTIES ARE HEREBY DISCLAIMED. // // $Id: //guest/kyle_turner/perforce/resolve/resolve.h#1 $ //------------------------------------------------------------------------ #ifndef RESOLVE_H #define RESOLVE_H #include "p4api.h" //------------------------------------------------------------------------ // Class: Special Resolve //------------------------------------------------------------------------ class NewResolve : public ClientUser { bool ignoreP4Conflicts; // -fx bool keepTempFiles; // -k bool noCommit; // -n StrBuf baseName; // names saved by Message StrBuf yourName; StrBuf theirName; public: NewResolve (); virtual ~NewResolve (); inline void SetKeepTemp (bool val) { keepTempFiles = val; } inline void SetIgnoreP4Conflicts (bool val) { ignoreP4Conflicts = val; } inline void SetNoCommit (bool val) { noCommit = val; } //--------- Callbacks From P4 API ----------------------------------- virtual void Message (Error *err); virtual void Merge (FileSys *base, FileSys *theirs, FileSys *yours, FileSys *result, Error *err); virtual int Resolve (ClientMerge *m, Error *err); //--------- Utilities ----------------------------------------------- bool ParseString (const char *src, const char *format, ...); void ParseFileName (const char *name, StrBuf *rtnPath, StrBuf *rtnTail); void BackupFile (FileSys *file, StrBuf &newName); void MoveFile (FileSys *file, StrBuf &newName); void TempName (StrBuf *path, StrBuf *file, const char *fileType, StrBuf *result); virtual void PrintStart (const char *name, const char *value = 0); virtual void PrintValue (const char *name, const char *value); virtual void PrintValue (const char *name, int value); virtual void PrintDone (); }; #endif
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 5435 | Kyle Turner |
Initial version of "p4 resolve" extensions using C++ P4API. Extensions allow users to give more weight to the external merge program specified by the environment variable $P4MERGE. See README.txt for more information. |