#ifndef FILELOGCACHE_H #define FILELOGCACHE_H /* The FileLogCache is the object that constructs branching history for a file - it * consists of a number of FileHead objects arranged in two rows, "from" and "into", * which each fork off a central "main" FileHead. */ class FileLogCache { public: FileLogCache(StrBuf, ClientApi*, Error*, char* c=NULL); /* Constructor takes the path to the file, and ClientApi and Error pointers. * The invoking function can therefore set up connection parameters in the * ClientApi, and be informed of connection errors in the Error. */ virtual ~FileLogCache(); /* AddFrom creates a new FileHead at the end of the "from" row. */ FileHead* AddFrom(StrBuf); /* AddInto does the same for the "into" row. */ FileHead* AddInto(StrBuf); /* AddAfter adds the new FileHead "after" the given one, ie, away from "main". */ FileHead* AddAfter(StrBuf, FileHead*); /* Get returns a pointer to the FileHead whose name is given as a StrBuf. If * it can't find such a FileHead, it creates a new one and returns a pointer to * that. The "from" bool arg indicates whether the new FileHead (if one has to be * created) should be made "from" or "into". */ FileHead* Get(StrBuf& filepath, bool from, FileHead* caller); FileHead* from; //The pointer to the first "from" FileHead. FileHead* into; //The first "into" FileHead. FileHead* main; //The "main" FileHead. /* "head" is the most "fromwards" of the files, and "tail" is the most "intowards". */ FileHead* head; FileHead* tail; ChangeSorter* changes; //A sorted list of change numbers. ClientApi* client; //Connection to Perforce server. Error* errors; int size; //Number of FileHeads in this FileLogCache. int numarrows; //Number of FileRevArrows in this FLC. char* cachefile; //Text file of filelogs, if any. private: FileHead* GetI(StrBuf& filepath, bool exfrom, FileHead* caller); //case insensitive }; #endif // FILELOGCACHE_H
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#10 | 2944 | Sam Stafford |
Add the ability to read filelog output from a text file. This functionality (if used; it's off by default) causes FLC to try to find required filelog output from a specified file before it queries the server. This can be used to fill in gaps (eg obliterated files), or more importantly, to draw graphs based on filelog output from a server you don't have access to, such as when trying to diagnose an integration problem for a customer. The filelog-parsing code hasn't been changed much, and isn't very fault-tolerant, so it might crash if fed mangled filelogs. Let the user beware. |
||
#9 | 1685 | Sam Stafford |
Changes to p4hltest that didn't get submitted properly... boggle? |
||
#8 | 1684 | Sam Stafford |
Imported new 02.1 p4api headers and libs. MAJOR code cleanup to make it fit without resorting to re-hacking of the API headers. The hacked headers were not L33T. They deserved D34TH. |
||
#7 | 1599 | Sam Stafford |
Make filename comparisons case-insensitive when running against a case-insensitive server. |
||
#6 | 1584 | Sam Stafford | New "numarrows" member of FLC to keep track of FileRevArrows. | ||
#5 | 1538 | Sam Stafford |
Add a "size" var to FileLogCache to figure out how much space will be needed to draw it. |
||
#4 | 1449 | Sam Stafford |
Removed single-argument constructor and associated behavior from FileLogCache. Clients will now need to construct and pass in ClientApi and Error objects - the benefit is that connection settings can be set in the ClientApi, and connection errors will be returned in the Error. |
||
#3 | 1441 | Sam Stafford |
A FileLogCache now maintains a single ClientApi and Error object to be used for all filelog requests. Should be faster. A new constructor is available which takes a ClientApi* and Error* - this is to allow you to handle connection errors yourself rather than having FileLogCache call Error::Abort(). |
||
#2 | 1432 | Sam Stafford |
Visible change: ALL revisions are now kept in the ChangeSorter, not just those that are "relevant". I've decided that the mechanism of filtering for revisions with direct relationships isn't all that useful, even if it's sort of interesting - it prevents you from seeing work in ancestor branches that you haven't yet integrated, for example. Infrastructure change: New set of FileHead* links to help in navigation of the FileLogCache: pointers in the FileLogCache to "head" and "tail" FileHeads, and "next_from" and "next_into" pointers on each FileHead. The idea is you can start at the "head" and then follow "next_into" pointers all the way to the "tail". |
||
#1 | 1417 | Sam Stafford |
Branching backend stuff off for rigorous testing. Grahr. |
||
//guest/sam_stafford/p4hl/src/dlls/FileLogCache.h | |||||
#2 | 975 | Sam Stafford |
Nigh-complete fix for job 4 - the "scan" methods all go from tail to head now, and Get uses the improved "addAfter" method where appropriate. An unforeseen problem was the fact that a complex integ history can get followed through more than one possible path, causing later versions of a given file to get scanned before earlier versions, and messing up the graph. This is fixed (albeit in a kludgey fashion) in scanMain here by making two passes through the FileHead, caching the files on the first pass and actually running scans on the second pass. A slightly more efficient way of handling it might be to keep a list of FileRevs that need to be scanned - perhaps by declaring a temporary FileHead to serve as a list? Once it's been hammered out in scanMain() satisfactorily that method can be employed in the other scan methods. |
||
#1 | 937 | Sam Stafford |
Renaming my guest directory to the more conventional sam_stafford. |
||
//guest/samwise/p4hl/src/dlls/FileLogCache.h | |||||
#1 | 936 | Sam Stafford |
Adding P4HL to the public depot. See relnotes.txt for installation instructions; all relevant files are under p4hl/dist. Source code is under p4hl/src in the form of a VC++ project. |