Fossil SCM
Make diff --checkin VERSION capable for working from outside of a checkout.
Commit
8e8e0269a96a2e210794ad66c11199c2e3334064f7031ad24804904845d74983
Parent
7a76111fe0b758c…
1 file changed
+8
-4
+8
-4
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -1135,14 +1135,18 @@ | ||
| 1135 | 1135 | } |
| 1136 | 1136 | if( zCheckin!=0 && ( zFrom!=0 || zTo!=0 ) ){ |
| 1137 | 1137 | fossil_fatal("cannot use --checkin together with --from or --to"); |
| 1138 | 1138 | } |
| 1139 | 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"); | |
| 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 | + } | |
| 1144 | 1148 | }else{ |
| 1145 | 1149 | db_find_and_open_repository(0, 0); |
| 1146 | 1150 | } |
| 1147 | 1151 | diff_options(&DCfg, isGDiff, 0); |
| 1148 | 1152 | determine_exec_relative_option(1); |
| 1149 | 1153 |
| --- 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 |