#include <clientapi.h> #include "filehead.h" #include "changesorter.h" #include "filelogcache.h" int main (int argc, char** argv) { StrBuf path; if (argc == 2) path.Set(argv[1]); else return 1; ClientApi client; Error e; FileLogCache* cache = new FileLogCache(path, &client, &e); FileHead* fhead = cache->head; FileRev* frev; FileRevArrow* farrow; while ( fhead ) { frev = fhead->head; while (frev) { printf( " AddRev( \"%s\", %s, %s, ", fhead->name.Text(), frev->rev.Text(), frev->change.Text() ); switch( frev->type ) { case ADD: printf( "RRadd" ); break; case BRANCH: printf( "RRbranch" ); break; case DEL: printf( "RRdelete" ); break; case EDIT: default: printf( "RRedit" ); break; case INTEG: printf( "RRinteg" ); break; } printf( " );\n" ); frev = frev->next; } fhead = fhead->next_into; } fhead = cache->head; while ( fhead ) { frev = fhead->head; while (frev) { char* ritype; farrow = frev->fromarrows; while (farrow) { switch ( farrow->type ) { case branch: ritype = "RIbranch"; break; case copy: ritype = "RIcopy"; break; case edit: ritype = 0x0; break; case ignore: ritype = "RIignore"; break; case impure: ritype = "RIedit"; break; case merge: default: ritype = "RImerge"; break; } if ( !ritype ) { farrow = farrow->next; continue; } printf( " AddInteg( \"%s\", %s, \"%s\", %s, %s );\n", farrow->ptr->fh->name.Text(), farrow->ptr->rev.Text(), fhead->name.Text(), frev->rev.Text(), ritype ); farrow=farrow->next; } frev = frev->next; } fhead = fhead->next_into; } StrBuf msg; if( e.Test() ) { e.Fmt( &msg ); fprintf( stderr, "%s\n", msg.Text() ); return 1; } return 0; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#9 | 4053 | Sam Stafford | A different format for dumping test data. | ||
#8 | 1704 | Sam Stafford |
Change API includes to <*.h> rather than "*.h". No functional change. |
||
#7 | 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. |
||
#6 | 1520 | Sam Stafford |
Make variable names slightly more sensical - expressions like "foo->file->file.Text()" look really bad. Now it's more like "fr->fh->name.Text()", which makes quite a bit more sense, at least if you're familiar with the structure. Infrastructure change. |
||
#5 | 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. |
||
#4 | 1434 | Sam Stafford | Nice little test program. | ||
#3 | 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". |
||
#2 | 1430 | Sam Stafford |
Fixing "edit" type FileRevArrows. They were being put in backwards - oopsie. |
||
#1 | 1421 | Sam Stafford |
...and a main function. Now we can begin the fun. |