FileLogCache.h #2

  • //
  • guest/
  • sam_stafford/
  • p4hl/
  • src/
  • dlls/
  • FileLogCache.h
  • View
  • Commits
  • Open Download .zip Download (2 KB)
// FileLogCache.h: interface for the FileLogCache class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FILELOGCACHE_H__C1B6848D_424B_41E8_99B7_EBA5F66CB529__INCLUDED_)
#define AFX_FILELOGCACHE_H__C1B6848D_424B_41E8_99B7_EBA5F66CB529__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "FileHead.h"
#include "ChangeSorter.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); //The constructor takes the path of the file to examine.
	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.

	ChangeSorter* changes; //A sorted list of change numbers.
};

#endif // !defined(AFX_FILELOGCACHE_H__C1B6848D_424B_41E8_99B7_EBA5F66CB529__INCLUDED_)
# Change User Description Committed
#8 1689 Sam Stafford Integrate 02.1 API and code cleanup to P4HL.
 Lots of work.  Phew.
#7 1600 Sam Stafford Integrate case-insensitivity fix to P4HL.

Integration only change.
#6 1586 Sam Stafford Migrate outstanding changes into P4HL - no functional change.
#5 1548 Sam Stafford Integrate RevType change to make sure it works.
 It does.
#4 1450 Sam Stafford Major performance improvement - use one ClientApi connection for all
filelogs.
Improves querying time about tenfold on large requests!

Had to move client->Final() to the constructor to ensure that
connection is cleaned up promptly and doesn't hang things up.
#3 1433 Sam Stafford Integ display: if you see one of a file's revisions, you see them all.
Previously, your view was limited to those revisions which were
directly
related to the file you asked about.  However, if you asked about a
file branched from the mainline, this meant that you couldn't see
mainline changes that weren't yet integrated into your branch, and
that's
not terribly useful.
#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.