@@ -25,8 +25,10 @@ sealed class Repository : IEquatable<Repository>, IRepository
2525 private HashSet < CacheType > cacheInvalidationRequests = new HashSet < CacheType > ( ) ;
2626 private Dictionary < CacheType , Action < CacheUpdateEvent > > cacheUpdateEvents ;
2727 private ProgressReporter progressReporter = new ProgressReporter ( ) ;
28+ private string lastFileLog ;
2829
2930 public event Action < CacheUpdateEvent > LogChanged ;
31+ public event Action < CacheUpdateEvent > FileLogChanged ;
3032 public event Action < CacheUpdateEvent > TrackingStatusChanged ;
3133 public event Action < CacheUpdateEvent > StatusEntriesChanged ;
3234 public event Action < CacheUpdateEvent > CurrentBranchChanged ;
@@ -63,6 +65,7 @@ public Repository(NPath localPath, ICacheContainer container)
6365 { CacheType . GitAheadBehind , c => TrackingStatusChanged ? . Invoke ( c ) } ,
6466 { CacheType . GitLocks , c => LocksChanged ? . Invoke ( c ) } ,
6567 { CacheType . GitLog , c => LogChanged ? . Invoke ( c ) } ,
68+ { CacheType . GitFileLog , c => FileLogChanged ? . Invoke ( c ) } ,
6669 { CacheType . GitStatus , c => StatusEntriesChanged ? . Invoke ( c ) } ,
6770 { CacheType . GitUser , cacheUpdateEvent => { } } ,
6871 { CacheType . RepositoryInfo , cacheUpdateEvent => {
@@ -91,6 +94,7 @@ public void Initialize(IRepositoryManager theRepositoryManager, ITaskManager the
9194 this . repositoryManager . GitStatusUpdated += RepositoryManagerOnGitStatusUpdated ;
9295 this . repositoryManager . GitAheadBehindStatusUpdated += RepositoryManagerOnGitAheadBehindStatusUpdated ;
9396 this . repositoryManager . GitLogUpdated += RepositoryManagerOnGitLogUpdated ;
97+ this . repositoryManager . GitFileLogUpdated += RepositoryManagerOnGitFileLogUpdated ;
9498 this . repositoryManager . GitLocksUpdated += RepositoryManagerOnGitLocksUpdated ;
9599 this . repositoryManager . LocalBranchesUpdated += RepositoryManagerOnLocalBranchesUpdated ;
96100 this . repositoryManager . RemoteBranchesUpdated += RepositoryManagerOnRemoteBranchesUpdated ;
@@ -138,11 +142,17 @@ public ITask SetupRemote(string remote, string remoteUrl)
138142 public ITask RequestLock ( NPath file ) => repositoryManager . LockFile ( file ) ;
139143 public ITask ReleaseLock ( NPath file , bool force ) => repositoryManager . UnlockFile ( file , force ) ;
140144 public ITask DiscardChanges ( GitStatusEntry [ ] gitStatusEntry ) => repositoryManager . DiscardChanges ( gitStatusEntry ) ;
145+ public ITask CheckoutVersion ( string changeset , IList < string > files ) => repositoryManager . CheckoutVersion ( changeset , files ) ;
141146 public ITask RemoteAdd ( string remote , string url ) => repositoryManager . RemoteAdd ( remote , url ) ;
142147 public ITask RemoteRemove ( string remote ) => repositoryManager . RemoteRemove ( remote ) ;
143148 public ITask DeleteBranch ( string branch , bool force ) => repositoryManager . DeleteBranch ( branch , force ) ;
144149 public ITask CreateBranch ( string branch , string baseBranch ) => repositoryManager . CreateBranch ( branch , baseBranch ) ;
145150 public ITask SwitchBranch ( string branch ) => repositoryManager . SwitchBranch ( branch ) ;
151+ public ITask UpdateFileLog ( string path )
152+ {
153+ lastFileLog = path ;
154+ return repositoryManager . UpdateFileLog ( path ) ;
155+ }
146156
147157 public void CheckAndRaiseEventsIfCacheNewer ( CacheType cacheType , CacheUpdateEvent cacheUpdateEvent ) => cacheContainer . CheckAndRaiseEventsIfCacheNewer ( cacheType , cacheUpdateEvent ) ;
148158
@@ -215,6 +225,10 @@ private void CacheHasBeenInvalidated(CacheType cacheType)
215225 repositoryManager ? . UpdateGitLog ( ) . Catch ( ex => InvalidationFailed ( ex , cacheType ) ) . Start ( ) ;
216226 break ;
217227
228+ case CacheType . GitFileLog :
229+ repositoryManager ? . UpdateFileLog ( lastFileLog ) . Catch ( ex => InvalidationFailed ( ex , cacheType ) ) . Start ( ) ;
230+ break ;
231+
218232 case CacheType . GitAheadBehind :
219233 repositoryManager ? . UpdateGitAheadBehindStatus ( ) . Catch ( ex => InvalidationFailed ( ex , cacheType ) ) . Start ( ) ;
220234 break ;
@@ -295,6 +309,11 @@ private void RepositoryManagerOnGitLogUpdated(List<GitLogEntry> gitLogEntries)
295309 taskManager . RunInUI ( ( ) => cacheContainer . GitLogCache . Log = gitLogEntries ) ;
296310 }
297311
312+ private void RepositoryManagerOnGitFileLogUpdated ( GitFileLog gitFileLog )
313+ {
314+ taskManager . RunInUI ( ( ) => cacheContainer . GitFileLogCache . FileLog = gitFileLog ) ;
315+ }
316+
298317 private void RepositoryManagerOnGitLocksUpdated ( List < GitLock > gitLocks )
299318 {
300319 taskManager . RunInUI ( ( ) => cacheContainer . GitLocksCache . GitLocks = gitLocks ) ;
@@ -360,6 +379,7 @@ public void Dispose()
360379 public string CurrentBranchName => CurrentConfigBranch ? . Name ;
361380 public GitRemote ? CurrentRemote => cacheContainer . RepositoryInfoCache . CurrentGitRemote ;
362381 public List < GitLogEntry > CurrentLog => cacheContainer . GitLogCache . Log ;
382+ public GitFileLog CurrentFileLog => cacheContainer . GitFileLogCache . FileLog ;
363383 public List < GitLock > CurrentLocks => cacheContainer . GitLocksCache . GitLocks ;
364384 public string CurrentHead => cacheContainer . RepositoryInfoCache . CurrentHead ;
365385
0 commit comments