@@ -744,6 +744,11 @@ mod render {
744
744
/// instead.
745
745
pub revset : Option < Revset > ,
746
746
747
+ /// Deprecated
748
+ /// Reverse the ordering of items in the smartlog output, list the most
749
+ /// recent commits first.
750
+ pub reverse : bool ,
751
+
747
752
/// The options to use when resolving the revset.
748
753
pub resolve_revset_options : ResolveRevsetOptions ,
749
754
@@ -762,6 +767,7 @@ pub fn smartlog(
762
767
let SmartlogOptions {
763
768
event_id,
764
769
revset,
770
+ reverse,
765
771
resolve_revset_options,
766
772
exact,
767
773
} = options;
@@ -820,9 +826,22 @@ pub fn smartlog(
820
826
exact,
821
827
) ?;
822
828
823
- let reverse = get_smartlog_reverse ( & repo) ?;
829
+ if reverse {
830
+ print ! (
831
+ "\
832
+ branchless: WARNING: The `--reverse` flag is deprecated.
833
+ branchless: Please use the `branchless.smartlog.reverse` configuration option.
834
+ "
835
+ ) ;
836
+ }
837
+ let reverse_cfg = get_smartlog_reverse ( & repo) ?;
838
+ let reverse_value = match ( reverse_cfg, reverse) {
839
+ ( .., true ) => true ,
840
+ _ => reverse_cfg,
841
+ } ;
842
+
824
843
let mut lines = render_graph (
825
- & effects. reverse_order ( reverse ) ,
844
+ & effects. reverse_order ( reverse_value ) ,
826
845
& repo,
827
846
& dag,
828
847
& graph,
@@ -845,7 +864,7 @@ pub fn smartlog(
845
864
] ,
846
865
) ?
847
866
. into_iter ( ) ;
848
- while let Some ( line) = if reverse {
867
+ while let Some ( line) = if reverse_value {
849
868
lines. next_back ( )
850
869
} else {
851
870
lines. next ( )
@@ -910,6 +929,7 @@ pub fn command_main(ctx: CommandContext, args: SmartlogArgs) -> EyreExitOr<()> {
910
929
event_id,
911
930
revset,
912
931
resolve_revset_options,
932
+ reverse,
913
933
exact,
914
934
} = args;
915
935
@@ -920,6 +940,7 @@ pub fn command_main(ctx: CommandContext, args: SmartlogArgs) -> EyreExitOr<()> {
920
940
event_id,
921
941
revset,
922
942
resolve_revset_options,
943
+ reverse,
923
944
exact,
924
945
} ,
925
946
)
0 commit comments