public int Count(ILogQuery query) { using (Logger.IndentLog($"Get commit count from log by query: {query}")) { return(_repository.Count(query)); } }
public IEnumerable <ICommit> Log(ILogQuery query) { using (Logger.IndentLog($"Get log by query: {query}")) { return(_repository.Log(query) .ToList()); } }
/// <inheritdoc /> public int Count(ILogQuery query) { var hgQuery = CastTo <HgLogQuery>(query); var command = new CountCommand() .WithRevision(hgQuery.Revision); return(_repository.Execute(command)); }
/// <inheritdoc /> public IEnumerable <ICommit> Log(ILogQuery query) { var hgQuery = CastTo <HgLogQuery>(query); return(_repository .Log(new LogCommand() .WithRevision(hgQuery.Revision)) .Select(changeset => (HgCommit)changeset)); }
public void Initialize() { _dbContextFactory = new DbContextTestFactory("PupaDbContextTest"); _dbContextCache = new DbContextCache(_dbContextFactory); _unitOfWorkFactory = new UnitOfWorkFactory(_dbContextCache); _logQuery = new LogQuery(_dbContextFactory); _logCommand = new LogCommand(_dbContextCache); }
public CacheHintMaker (LogFileStatsCache statsCache, ILogQuery query, LogAccumulator accumulator) { Debug.Assert(statsCache != null, "PrecacheScheduler.ctor: statsCache is null."); Debug.Assert(query != null, "PrecacheScheduler.ctor: query is null."); Debug.Assert(accumulator != null, "PrecacheScheduler.ctor: accumulator is null."); statsCache_ = statsCache; filter_ = query.CreateFilter(); accumulator_ = accumulator; }
public LogAccumulator(LogFileStatsCache statsCache, ILogQuery query) { Debug.Assert(statsCache != null, "LogAccumulator.ctor: statsCache is null."); Debug.Assert(query != null, "LogAccumulator.ctor: query is null."); statsCache_ = statsCache; query_ = query; var filter = query_.CreateFilter(); groupFilter_ = EventGroupFilter.Convert(filter); events_ = new List <EventModel> (query_.Quantity); skipRemaining_ = query_.Offset; }
/// <inheritdoc /> public IEnumerable <ICommit> Log(ILogQuery query) { if (query == null) { throw new ArgumentNullException(nameof(query)); } if (!(query is HgLogQuery hgQuery)) { throw new InvalidOperationException($"{query.GetType()} is not supported."); } return(_repository .Log(hgQuery.Revision) .Select(changeset => (HgCommit)changeset)); }
public EventsCollection GetEvents(ILogQuery query) { Debug.Assert(query != null, "LogSource.GetEvents: query is null."); var files = GetFiles(true); var encoding = config_.Encoding; var logFiles = new LogFilesCollection(files, encoding, query.Snapshot); var size = logFiles.GetSnapshot(); var accumulator = new LogAccumulator(statsCache_, query); var hintMaker = new CacheHintMaker(statsCache_, query, accumulator); var events = logFiles .Aggregate(hintMaker, (a, f) => a.Consume(f)) .Events .ToList(); events.Reverse(); return(new EventsCollection(events, Name, size)); }
public void InitializeStats(ILogQuery query, LogFileStatsCache statsCache) => InitializeStats(query.CreateFilter(), statsCache);
/// <inheritdoc /> ILogQuery ILogQueryBuilder.Intersect(ILogQuery left, ILogQuery right) => Intersect((HgLogQuery)left, (HgLogQuery)right);