@@ -391,7 +391,9 @@ public ContextMenu CreateChangeContextMenu(Models.Change change)
391
391
resetToThisRevision . Icon = App . CreateMenuIcon ( "Icons.File.Checkout" ) ;
392
392
resetToThisRevision . Click += ( _ , ev ) =>
393
393
{
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 ( ) ;
395
397
ev . Handled = true ;
396
398
} ;
397
399
@@ -401,10 +403,12 @@ public ContextMenu CreateChangeContextMenu(Models.Change change)
401
403
resetToFirstParent . IsEnabled = _commit . Parents . Count > 0 ;
402
404
resetToFirstParent . Click += ( _ , ev ) =>
403
405
{
406
+ var log = _repo . CreateLog ( $ "Reset File to '{ _commit . SHA } ~1'") ;
404
407
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") ;
406
409
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 ( ) ;
408
412
ev . Handled = true ;
409
413
} ;
410
414
@@ -530,7 +534,9 @@ public ContextMenu CreateRevisionFileContextMenu(Models.Object file)
530
534
resetToThisRevision . IsEnabled = File . Exists ( fullPath ) ;
531
535
resetToThisRevision . Click += ( _ , ev ) =>
532
536
{
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 ( ) ;
534
540
ev . Handled = true ;
535
541
} ;
536
542
@@ -542,7 +548,9 @@ public ContextMenu CreateRevisionFileContextMenu(Models.Object file)
542
548
resetToFirstParent . IsEnabled = _commit . Parents . Count > 0 && fileIndex != Models . ChangeState . Renamed ;
543
549
resetToFirstParent . Click += ( _ , ev ) =>
544
550
{
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 ( ) ;
546
554
ev . Handled = true ;
547
555
} ;
548
556
@@ -737,10 +745,12 @@ private void TryToAddContextMenuItemsForGitLFS(ContextMenu menu, string path)
737
745
{
738
746
lfsLock . Click += async ( _ , e ) =>
739
747
{
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 ) ) ;
741
750
if ( succ )
742
751
App . SendNotification ( _repo . FullPath , $ "Lock file \" { path } \" successfully!") ;
743
752
753
+ log . Complete ( ) ;
744
754
e . Handled = true ;
745
755
} ;
746
756
}
@@ -753,10 +763,12 @@ private void TryToAddContextMenuItemsForGitLFS(ContextMenu menu, string path)
753
763
lockRemote . Header = remoteName ;
754
764
lockRemote . Click += async ( _ , e ) =>
755
765
{
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 ) ) ;
757
768
if ( succ )
758
769
App . SendNotification ( _repo . FullPath , $ "Lock file \" { path } \" successfully!") ;
759
770
771
+ log . Complete ( ) ;
760
772
e . Handled = true ;
761
773
} ;
762
774
lfsLock . Items . Add ( lockRemote ) ;
@@ -772,10 +784,12 @@ private void TryToAddContextMenuItemsForGitLFS(ContextMenu menu, string path)
772
784
{
773
785
lfsUnlock . Click += async ( _ , e ) =>
774
786
{
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 ) ) ;
776
789
if ( succ )
777
790
App . SendNotification ( _repo . FullPath , $ "Unlock file \" { path } \" successfully!") ;
778
791
792
+ log . Complete ( ) ;
779
793
e . Handled = true ;
780
794
} ;
781
795
}
@@ -788,10 +802,12 @@ private void TryToAddContextMenuItemsForGitLFS(ContextMenu menu, string path)
788
802
unlockRemote . Header = remoteName ;
789
803
unlockRemote . Click += async ( _ , e ) =>
790
804
{
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 ) ) ;
792
807
if ( succ )
793
808
App . SendNotification ( _repo . FullPath , $ "Unlock file \" { path } \" successfully!") ;
794
809
810
+ log . Complete ( ) ;
795
811
e . Handled = true ;
796
812
} ;
797
813
lfsUnlock . Items . Add ( unlockRemote ) ;
0 commit comments