@@ -391,7 +391,9 @@ public ContextMenu CreateChangeContextMenu(Models.Change change)
391391 resetToThisRevision . Icon = App . CreateMenuIcon ( "Icons.File.Checkout" ) ;
392392 resetToThisRevision . Click += ( _ , ev ) =>
393393 {
394- new Commands . Checkout ( _repo . FullPath ) . FileWithRevision ( change . Path , $ "{ _commit . SHA } ") ;
394+ var log = _repo . CreateLog ( $ "Reset File to '{ _commit . SHA } '") ;
395+ new Commands . Checkout ( _repo . FullPath ) . Use ( log ) . FileWithRevision ( change . Path , $ "{ _commit . SHA } ") ;
396+ log . Complete ( ) ;
395397 ev . Handled = true ;
396398 } ;
397399
@@ -401,10 +403,12 @@ public ContextMenu CreateChangeContextMenu(Models.Change change)
401403 resetToFirstParent . IsEnabled = _commit . Parents . Count > 0 ;
402404 resetToFirstParent . Click += ( _ , ev ) =>
403405 {
406+ var log = _repo . CreateLog ( $ "Reset File to '{ _commit . SHA } ~1'") ;
404407 if ( change . Index == Models . ChangeState . Renamed )
405- new Commands . Checkout ( _repo . FullPath ) . FileWithRevision ( change . OriginalPath , $ "{ _commit . SHA } ~1") ;
408+ new Commands . Checkout ( _repo . FullPath ) . Use ( log ) . FileWithRevision ( change . OriginalPath , $ "{ _commit . SHA } ~1") ;
406409
407- new Commands . Checkout ( _repo . FullPath ) . FileWithRevision ( change . Path , $ "{ _commit . SHA } ~1") ;
410+ new Commands . Checkout ( _repo . FullPath ) . Use ( log ) . FileWithRevision ( change . Path , $ "{ _commit . SHA } ~1") ;
411+ log . Complete ( ) ;
408412 ev . Handled = true ;
409413 } ;
410414
@@ -530,7 +534,9 @@ public ContextMenu CreateRevisionFileContextMenu(Models.Object file)
530534 resetToThisRevision . IsEnabled = File . Exists ( fullPath ) ;
531535 resetToThisRevision . Click += ( _ , ev ) =>
532536 {
533- new Commands . Checkout ( _repo . FullPath ) . FileWithRevision ( file . Path , $ "{ _commit . SHA } ") ;
537+ var log = _repo . CreateLog ( $ "Reset File to '{ _commit . SHA } '") ;
538+ new Commands . Checkout ( _repo . FullPath ) . Use ( log ) . FileWithRevision ( file . Path , $ "{ _commit . SHA } ") ;
539+ log . Complete ( ) ;
534540 ev . Handled = true ;
535541 } ;
536542
@@ -542,7 +548,9 @@ public ContextMenu CreateRevisionFileContextMenu(Models.Object file)
542548 resetToFirstParent . IsEnabled = _commit . Parents . Count > 0 && fileIndex != Models . ChangeState . Renamed ;
543549 resetToFirstParent . Click += ( _ , ev ) =>
544550 {
545- new Commands . Checkout ( _repo . FullPath ) . FileWithRevision ( file . Path , $ "{ _commit . SHA } ~1") ;
551+ var log = _repo . CreateLog ( $ "Reset File to '{ _commit . SHA } ~1'") ;
552+ new Commands . Checkout ( _repo . FullPath ) . Use ( log ) . FileWithRevision ( file . Path , $ "{ _commit . SHA } ~1") ;
553+ log . Complete ( ) ;
546554 ev . Handled = true ;
547555 } ;
548556
@@ -737,10 +745,12 @@ private void TryToAddContextMenuItemsForGitLFS(ContextMenu menu, string path)
737745 {
738746 lfsLock . Click += async ( _ , e ) =>
739747 {
740- var succ = await Task . Run ( ( ) => new Commands . LFS ( _repo . FullPath ) . Lock ( _repo . Remotes [ 0 ] . Name , path ) ) ;
748+ var log = _repo . CreateLog ( "Lock LFS file" ) ;
749+ var succ = await Task . Run ( ( ) => new Commands . LFS ( _repo . FullPath ) . Lock ( _repo . Remotes [ 0 ] . Name , path , log ) ) ;
741750 if ( succ )
742751 App . SendNotification ( _repo . FullPath , $ "Lock file \" { path } \" successfully!") ;
743752
753+ log . Complete ( ) ;
744754 e . Handled = true ;
745755 } ;
746756 }
@@ -753,10 +763,12 @@ private void TryToAddContextMenuItemsForGitLFS(ContextMenu menu, string path)
753763 lockRemote . Header = remoteName ;
754764 lockRemote . Click += async ( _ , e ) =>
755765 {
756- var succ = await Task . Run ( ( ) => new Commands . LFS ( _repo . FullPath ) . Lock ( remoteName , path ) ) ;
766+ var log = _repo . CreateLog ( "Lock LFS file" ) ;
767+ var succ = await Task . Run ( ( ) => new Commands . LFS ( _repo . FullPath ) . Lock ( remoteName , path , log ) ) ;
757768 if ( succ )
758769 App . SendNotification ( _repo . FullPath , $ "Lock file \" { path } \" successfully!") ;
759770
771+ log . Complete ( ) ;
760772 e . Handled = true ;
761773 } ;
762774 lfsLock . Items . Add ( lockRemote ) ;
@@ -772,10 +784,12 @@ private void TryToAddContextMenuItemsForGitLFS(ContextMenu menu, string path)
772784 {
773785 lfsUnlock . Click += async ( _ , e ) =>
774786 {
775- var succ = await Task . Run ( ( ) => new Commands . LFS ( _repo . FullPath ) . Unlock ( _repo . Remotes [ 0 ] . Name , path , false ) ) ;
787+ var log = _repo . CreateLog ( "Unlock LFS file" ) ;
788+ var succ = await Task . Run ( ( ) => new Commands . LFS ( _repo . FullPath ) . Unlock ( _repo . Remotes [ 0 ] . Name , path , false , log ) ) ;
776789 if ( succ )
777790 App . SendNotification ( _repo . FullPath , $ "Unlock file \" { path } \" successfully!") ;
778791
792+ log . Complete ( ) ;
779793 e . Handled = true ;
780794 } ;
781795 }
@@ -788,10 +802,12 @@ private void TryToAddContextMenuItemsForGitLFS(ContextMenu menu, string path)
788802 unlockRemote . Header = remoteName ;
789803 unlockRemote . Click += async ( _ , e ) =>
790804 {
791- var succ = await Task . Run ( ( ) => new Commands . LFS ( _repo . FullPath ) . Unlock ( remoteName , path , false ) ) ;
805+ var log = _repo . CreateLog ( "Unlock LFS file" ) ;
806+ var succ = await Task . Run ( ( ) => new Commands . LFS ( _repo . FullPath ) . Unlock ( remoteName , path , false , log ) ) ;
792807 if ( succ )
793808 App . SendNotification ( _repo . FullPath , $ "Unlock file \" { path } \" successfully!") ;
794809
810+ log . Complete ( ) ;
795811 e . Handled = true ;
796812 } ;
797813 lfsUnlock . Items . Add ( unlockRemote ) ;
0 commit comments