Fossil SCM

Make diff --checkin VERSION capable for working from outside of a checkout.

stephan 2023-01-21 11:40 trunk
Commit 8e8e0269a96a2e210794ad66c11199c2e3334064f7031ad24804904845d74983
1 file changed +8 -4
+8 -4
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -1135,14 +1135,18 @@
11351135
}
11361136
if( zCheckin!=0 && ( zFrom!=0 || zTo!=0 ) ){
11371137
fossil_fatal("cannot use --checkin together with --from or --to");
11381138
}
11391139
g.diffCnt[0] = g.diffCnt[1] = g.diffCnt[2] = 0;
1140
- if( zTo==0 || againstUndo ){
1141
- db_must_be_within_tree();
1142
- }else if( zFrom==0 ){
1143
- fossil_fatal("must use --from if --to is present");
1140
+ if( 0==zCheckin ){
1141
+ if( zTo==0 || againstUndo ){
1142
+ db_must_be_within_tree();
1143
+ }else if( zFrom==0 ){
1144
+ fossil_fatal("must use --from if --to is present");
1145
+ }else{
1146
+ db_find_and_open_repository(0, 0);
1147
+ }
11441148
}else{
11451149
db_find_and_open_repository(0, 0);
11461150
}
11471151
diff_options(&DCfg, isGDiff, 0);
11481152
determine_exec_relative_option(1);
11491153
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -1135,14 +1135,18 @@
1135 }
1136 if( zCheckin!=0 && ( zFrom!=0 || zTo!=0 ) ){
1137 fossil_fatal("cannot use --checkin together with --from or --to");
1138 }
1139 g.diffCnt[0] = g.diffCnt[1] = g.diffCnt[2] = 0;
1140 if( zTo==0 || againstUndo ){
1141 db_must_be_within_tree();
1142 }else if( zFrom==0 ){
1143 fossil_fatal("must use --from if --to is present");
 
 
 
 
1144 }else{
1145 db_find_and_open_repository(0, 0);
1146 }
1147 diff_options(&DCfg, isGDiff, 0);
1148 determine_exec_relative_option(1);
1149
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -1135,14 +1135,18 @@
1135 }
1136 if( zCheckin!=0 && ( zFrom!=0 || zTo!=0 ) ){
1137 fossil_fatal("cannot use --checkin together with --from or --to");
1138 }
1139 g.diffCnt[0] = g.diffCnt[1] = g.diffCnt[2] = 0;
1140 if( 0==zCheckin ){
1141 if( zTo==0 || againstUndo ){
1142 db_must_be_within_tree();
1143 }else if( zFrom==0 ){
1144 fossil_fatal("must use --from if --to is present");
1145 }else{
1146 db_find_and_open_repository(0, 0);
1147 }
1148 }else{
1149 db_find_and_open_repository(0, 0);
1150 }
1151 diff_options(&DCfg, isGDiff, 0);
1152 determine_exec_relative_option(1);
1153

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button