class FileHead; class FileRev; class FileLogCache; class ClientLogUser; class QTreeRevBall; // A FileRevArrow is a single pointer from one rev to another. It also // serves as a singly-linked-list node. enum ArrowType //how should this pointer be rendered? { edit, branch, copy, ignore, impure, merge, a_broken }; typedef ArrowType FLCArrowType; //to avoid conflict with Qt::ArrowType enum Contrib //how much content contribution does this represent? { none, some, all, c_broken }; enum RevType //what was the action that created this rev? { UNKNOWN_TYPE, EDIT, BRANCH, ADD, INTEG, DEL }; // A pointer from a revision to its parent. struct FileRevArrow { FileRev* ptr; ArrowType type; Contrib contrib; FileRevArrow* next; }; // A textual integ record, to be translated into an FRA. struct FileTextArrow { StrBuf file; StrBuf rev; ArrowType type; FileTextArrow* next; FileHead* fhead; StrBuf record; }; // For storing data about which leg of the FLC an FH is in. enum CacheLocation { cl_unset, cl_from, cl_into, cl_main }; // A FileHead object represents a file and all its revision history. // Its name comes from the fact that it's the head of a linked list // of FileRev objects. The FileHead is a part of a FileLogCache. class FileHead { public: FileHead( StrBuf, FileLogCache* ); virtual ~FileHead(); bool LoadCached( char* ); //load this FileHead from a local text file //containing filelog output FileHead* next; //This is the next FileHead in a "from" or "into" chain. //See FileLogCache for more info about its structure. // These FileHeads are a more "absolute" line of links across the // FileLogCache - you can start at one end, follow one of these pointers, // and make it all the way to the other end. FileHead* next_from; FileHead* next_into; FileRev* head; // The head revision. FileRev* tail; // The last created FileRev - #1 in a complete FH. FileLogCache* flc; // The FileLogCache that this FileHead is a part of StrBuf name; // The Perforce path to this file, eg "//depot/foo/file". // addRev adds a new revision to this FileHead, at the tail position. As // arguments it takes the revision number, the change number, the file // type, ane whether it's text. addRev is called once by ClientLogUser // for each revision record in a filelog. It is assumed that the // revisions will be added in order from head to first. void addRev( StrBuf newrev, StrBuf newchange, RevType rt, StrBuf da ); // scanInto is used to follow "into" integration records - it's a command // for this FileHead to locate the revision indicated by the 'startrev' // argument, and set a FRA to the 'caller' argument. This is its primary // function. Once this is done, it checks that revision and its successors // to see if they were integrated into other files, and calls scanInto on // those files where necessary. In this way, all of the children of // children are found. The startrev argument is of the form "14", and the // caller argument is a pointer to the revision that was the source of the // integration that created revision "14". void scanInto( StrBuf startrev, FileRev* caller, ArrowType atype ); // scanFrom is similar to scanInto, but it does roughly the opposite. It // returns the FileRev object corresponding to the 'endrev' argument - // this pointer is used to establish a 'from' pointer from the caller file // to this one. scanFrom also checks all of the revisions before the // endrev for "from" integration records, and calls scanFrom on the // referenced files. FileRev* scanFrom( StrBuf endrev ); // scanMain should only be called on the "main" FileHead. It performs // sort of an interleaved scanFrom and scanInto. void scanMain(); // It's handy to know where in the FLC structure a given FileHead is. CacheLocation loc; int size; // number of revs in this FileHead. private: // ClientLogUser object for parsing server output ClientLogUser* ui; }; // A FileRev object represents a single file revision. class FileRev { public: FileRev( StrBuf rev, FileHead* file, StrBuf change, RevType, StrBuf da ); // Add a new FileRevArrow to this FileRev. void AddFromArrow( FileRev* rev, ArrowType atype ); // Add new FileTextArrows, to later be translated into FileRevArrows. void AddFromText ( StrBuf& infile, StrBuf& inrev, ArrowType atype, char* data ); void AddIntoText ( StrBuf& infile, StrBuf& inrev, ArrowType atype, char* data ); virtual ~FileRev(); FileRev* prev; // the next higher revision FileRev* next; // the next lower revision FileHead* fh; // the FileHead that joins them StrBuf rev; // the rev number, eg "14" StrBuf change; // the change number, eg "123" RevType type; // the rev type, eg ADD StrBuf user; // the submitting user, eg "samwise" StrBuf date; // the date of submit, eg "2002/06/14" StrBuf ftype; // the filetype, eg "text+k" StrBuf action; // the action performed, eg "edit" FileRevArrow* fromarrows; // List of FileRev pointers to be rendered FileTextArrow* fromtexts; // Textual descriptions to be turned into FileTextArrow* intotexts; // pointers bool hasarrow; // Unset until after FLC::SetArrows() QTreeRevBall* revball; // The QTreeRevBall I'm attached to. bool fromcheck; // Has this rev been touched by scanFrom()? bool intocheck; // Has this rev been touched by scanInto()? };
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 2946 | Sam Stafford |
Pull in read-filelogs-from-file capabilities. No functional change yet. |
||
#2 | 2945 | Sam Stafford | These changes are all already reflected in P4QTree. | ||
#1 | 2377 | Sam Stafford | P4QTree. |