Fossil SCM
Merge updates from trunk.
Commit
e4af590ff935bd654cacf6f52db58a026c6f7e99
Parent
a6faa2aee488d53…
7 files changed
+12
-1
+4
+16
-9
-1
-1
+5
+16
-1
+12
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -817,10 +817,17 @@ | ||
| 817 | 817 | blob_append(&prompt, |
| 818 | 818 | "# PRIVATE BRANCH: This check-in will be private and will not sync to\n" |
| 819 | 819 | "# repositories.\n" |
| 820 | 820 | "#\n", -1 |
| 821 | 821 | ); |
| 822 | + } | |
| 823 | + if( p->integrateFlag ){ | |
| 824 | + blob_append(&prompt, | |
| 825 | + "#\n" | |
| 826 | + "# All merged-in branches will be closed due to the --integrate flag\n" | |
| 827 | + "#\n", -1 | |
| 828 | + ); | |
| 822 | 829 | } |
| 823 | 830 | prompt_for_user_comment(pComment, &prompt); |
| 824 | 831 | blob_reset(&prompt); |
| 825 | 832 | } |
| 826 | 833 | |
| @@ -955,10 +962,11 @@ | ||
| 955 | 962 | struct CheckinInfo { |
| 956 | 963 | Blob *pComment; /* Check-in comment text */ |
| 957 | 964 | const char *zMimetype; /* Mimetype of check-in command. May be NULL */ |
| 958 | 965 | int verifyDate; /* Verify that child is younger */ |
| 959 | 966 | int closeFlag; /* Close the branch being committed */ |
| 967 | + int integrateFlag; /* Close merged-in branches */ | |
| 960 | 968 | Blob *pCksum; /* Repository checksum. May be 0 */ |
| 961 | 969 | const char *zDateOvrd; /* Date override. If 0 then use 'now' */ |
| 962 | 970 | const char *zUserOvrd; /* User override. If 0 then use g.zLogin */ |
| 963 | 971 | const char *zBranch; /* Branch name. May be 0 */ |
| 964 | 972 | const char *zColor; /* One-time background color. May be 0 */ |
| @@ -1148,11 +1156,12 @@ | ||
| 1148 | 1156 | } |
| 1149 | 1157 | if( p->closeFlag ){ |
| 1150 | 1158 | blob_appendf(pOut, "T +closed *\n"); |
| 1151 | 1159 | } |
| 1152 | 1160 | db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid" |
| 1153 | - " WHERE id=-4 ORDER BY 1"); | |
| 1161 | + " WHERE id %s ORDER BY 1", | |
| 1162 | + p->integrateFlag ? "IN(0,-4)" : "=(-4)"); | |
| 1154 | 1163 | while( db_step(&q)==SQLITE_ROW ){ |
| 1155 | 1164 | const char *zIntegrateUuid = db_column_text(&q, 0); |
| 1156 | 1165 | int rid = db_column_int(&q, 1); |
| 1157 | 1166 | if( is_a_leaf(rid) && !db_exists("SELECT 1 FROM tagxref " |
| 1158 | 1167 | " WHERE tagid=%d AND rid=%d AND tagtype>0", TAG_CLOSED, rid)){ |
| @@ -1393,10 +1402,11 @@ | ||
| 1393 | 1402 | ** --bgcolor COLOR apply COLOR to this one check-in only |
| 1394 | 1403 | ** --branch NEW-BRANCH-NAME check in to this new branch |
| 1395 | 1404 | ** --branchcolor COLOR apply given COLOR to the branch |
| 1396 | 1405 | ** --close close the branch being committed |
| 1397 | 1406 | ** --delta use a delta manifest in the commit process |
| 1407 | +** --integrate close all merged-in branches | |
| 1398 | 1408 | ** -m|--comment COMMENT-TEXT use COMMENT-TEXT as commit comment |
| 1399 | 1409 | ** -M|--message-file FILE read the commit comment from given file |
| 1400 | 1410 | ** --mimetype MIMETYPE mimetype of check-in comment |
| 1401 | 1411 | ** -n|--dry-run If given, display instead of run actions |
| 1402 | 1412 | ** --no-warnings omit all warnings about file contents |
| @@ -1469,10 +1479,11 @@ | ||
| 1469 | 1479 | noWarningFlag = find_option("no-warnings", 0, 0)!=0; |
| 1470 | 1480 | sCiInfo.zBranch = find_option("branch","b",1); |
| 1471 | 1481 | sCiInfo.zColor = find_option("bgcolor",0,1); |
| 1472 | 1482 | sCiInfo.zBrClr = find_option("branchcolor",0,1); |
| 1473 | 1483 | sCiInfo.closeFlag = find_option("close",0,0)!=0; |
| 1484 | + sCiInfo.integrateFlag = find_option("integrate",0,0)!=0; | |
| 1474 | 1485 | sCiInfo.zMimetype = find_option("mimetype",0,1); |
| 1475 | 1486 | while( (zTag = find_option("tag",0,1))!=0 ){ |
| 1476 | 1487 | if( zTag[0]==0 ) continue; |
| 1477 | 1488 | sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag, sizeof(char*)*(nTag+2)); |
| 1478 | 1489 | sCiInfo.azTag[nTag++] = zTag; |
| 1479 | 1490 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -817,10 +817,17 @@ | |
| 817 | blob_append(&prompt, |
| 818 | "# PRIVATE BRANCH: This check-in will be private and will not sync to\n" |
| 819 | "# repositories.\n" |
| 820 | "#\n", -1 |
| 821 | ); |
| 822 | } |
| 823 | prompt_for_user_comment(pComment, &prompt); |
| 824 | blob_reset(&prompt); |
| 825 | } |
| 826 | |
| @@ -955,10 +962,11 @@ | |
| 955 | struct CheckinInfo { |
| 956 | Blob *pComment; /* Check-in comment text */ |
| 957 | const char *zMimetype; /* Mimetype of check-in command. May be NULL */ |
| 958 | int verifyDate; /* Verify that child is younger */ |
| 959 | int closeFlag; /* Close the branch being committed */ |
| 960 | Blob *pCksum; /* Repository checksum. May be 0 */ |
| 961 | const char *zDateOvrd; /* Date override. If 0 then use 'now' */ |
| 962 | const char *zUserOvrd; /* User override. If 0 then use g.zLogin */ |
| 963 | const char *zBranch; /* Branch name. May be 0 */ |
| 964 | const char *zColor; /* One-time background color. May be 0 */ |
| @@ -1148,11 +1156,12 @@ | |
| 1148 | } |
| 1149 | if( p->closeFlag ){ |
| 1150 | blob_appendf(pOut, "T +closed *\n"); |
| 1151 | } |
| 1152 | db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid" |
| 1153 | " WHERE id=-4 ORDER BY 1"); |
| 1154 | while( db_step(&q)==SQLITE_ROW ){ |
| 1155 | const char *zIntegrateUuid = db_column_text(&q, 0); |
| 1156 | int rid = db_column_int(&q, 1); |
| 1157 | if( is_a_leaf(rid) && !db_exists("SELECT 1 FROM tagxref " |
| 1158 | " WHERE tagid=%d AND rid=%d AND tagtype>0", TAG_CLOSED, rid)){ |
| @@ -1393,10 +1402,11 @@ | |
| 1393 | ** --bgcolor COLOR apply COLOR to this one check-in only |
| 1394 | ** --branch NEW-BRANCH-NAME check in to this new branch |
| 1395 | ** --branchcolor COLOR apply given COLOR to the branch |
| 1396 | ** --close close the branch being committed |
| 1397 | ** --delta use a delta manifest in the commit process |
| 1398 | ** -m|--comment COMMENT-TEXT use COMMENT-TEXT as commit comment |
| 1399 | ** -M|--message-file FILE read the commit comment from given file |
| 1400 | ** --mimetype MIMETYPE mimetype of check-in comment |
| 1401 | ** -n|--dry-run If given, display instead of run actions |
| 1402 | ** --no-warnings omit all warnings about file contents |
| @@ -1469,10 +1479,11 @@ | |
| 1469 | noWarningFlag = find_option("no-warnings", 0, 0)!=0; |
| 1470 | sCiInfo.zBranch = find_option("branch","b",1); |
| 1471 | sCiInfo.zColor = find_option("bgcolor",0,1); |
| 1472 | sCiInfo.zBrClr = find_option("branchcolor",0,1); |
| 1473 | sCiInfo.closeFlag = find_option("close",0,0)!=0; |
| 1474 | sCiInfo.zMimetype = find_option("mimetype",0,1); |
| 1475 | while( (zTag = find_option("tag",0,1))!=0 ){ |
| 1476 | if( zTag[0]==0 ) continue; |
| 1477 | sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag, sizeof(char*)*(nTag+2)); |
| 1478 | sCiInfo.azTag[nTag++] = zTag; |
| 1479 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -817,10 +817,17 @@ | |
| 817 | blob_append(&prompt, |
| 818 | "# PRIVATE BRANCH: This check-in will be private and will not sync to\n" |
| 819 | "# repositories.\n" |
| 820 | "#\n", -1 |
| 821 | ); |
| 822 | } |
| 823 | if( p->integrateFlag ){ |
| 824 | blob_append(&prompt, |
| 825 | "#\n" |
| 826 | "# All merged-in branches will be closed due to the --integrate flag\n" |
| 827 | "#\n", -1 |
| 828 | ); |
| 829 | } |
| 830 | prompt_for_user_comment(pComment, &prompt); |
| 831 | blob_reset(&prompt); |
| 832 | } |
| 833 | |
| @@ -955,10 +962,11 @@ | |
| 962 | struct CheckinInfo { |
| 963 | Blob *pComment; /* Check-in comment text */ |
| 964 | const char *zMimetype; /* Mimetype of check-in command. May be NULL */ |
| 965 | int verifyDate; /* Verify that child is younger */ |
| 966 | int closeFlag; /* Close the branch being committed */ |
| 967 | int integrateFlag; /* Close merged-in branches */ |
| 968 | Blob *pCksum; /* Repository checksum. May be 0 */ |
| 969 | const char *zDateOvrd; /* Date override. If 0 then use 'now' */ |
| 970 | const char *zUserOvrd; /* User override. If 0 then use g.zLogin */ |
| 971 | const char *zBranch; /* Branch name. May be 0 */ |
| 972 | const char *zColor; /* One-time background color. May be 0 */ |
| @@ -1148,11 +1156,12 @@ | |
| 1156 | } |
| 1157 | if( p->closeFlag ){ |
| 1158 | blob_appendf(pOut, "T +closed *\n"); |
| 1159 | } |
| 1160 | db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid" |
| 1161 | " WHERE id %s ORDER BY 1", |
| 1162 | p->integrateFlag ? "IN(0,-4)" : "=(-4)"); |
| 1163 | while( db_step(&q)==SQLITE_ROW ){ |
| 1164 | const char *zIntegrateUuid = db_column_text(&q, 0); |
| 1165 | int rid = db_column_int(&q, 1); |
| 1166 | if( is_a_leaf(rid) && !db_exists("SELECT 1 FROM tagxref " |
| 1167 | " WHERE tagid=%d AND rid=%d AND tagtype>0", TAG_CLOSED, rid)){ |
| @@ -1393,10 +1402,11 @@ | |
| 1402 | ** --bgcolor COLOR apply COLOR to this one check-in only |
| 1403 | ** --branch NEW-BRANCH-NAME check in to this new branch |
| 1404 | ** --branchcolor COLOR apply given COLOR to the branch |
| 1405 | ** --close close the branch being committed |
| 1406 | ** --delta use a delta manifest in the commit process |
| 1407 | ** --integrate close all merged-in branches |
| 1408 | ** -m|--comment COMMENT-TEXT use COMMENT-TEXT as commit comment |
| 1409 | ** -M|--message-file FILE read the commit comment from given file |
| 1410 | ** --mimetype MIMETYPE mimetype of check-in comment |
| 1411 | ** -n|--dry-run If given, display instead of run actions |
| 1412 | ** --no-warnings omit all warnings about file contents |
| @@ -1469,10 +1479,11 @@ | |
| 1479 | noWarningFlag = find_option("no-warnings", 0, 0)!=0; |
| 1480 | sCiInfo.zBranch = find_option("branch","b",1); |
| 1481 | sCiInfo.zColor = find_option("bgcolor",0,1); |
| 1482 | sCiInfo.zBrClr = find_option("branchcolor",0,1); |
| 1483 | sCiInfo.closeFlag = find_option("close",0,0)!=0; |
| 1484 | sCiInfo.integrateFlag = find_option("integrate",0,0)!=0; |
| 1485 | sCiInfo.zMimetype = find_option("mimetype",0,1); |
| 1486 | while( (zTag = find_option("tag",0,1))!=0 ){ |
| 1487 | if( zTag[0]==0 ) continue; |
| 1488 | sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag, sizeof(char*)*(nTag+2)); |
| 1489 | sCiInfo.azTag[nTag++] = zTag; |
| 1490 |
+4
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -567,10 +567,14 @@ | ||
| 567 | 567 | #endif |
| 568 | 568 | { |
| 569 | 569 | const char *zCmdName = "unknown"; |
| 570 | 570 | int idx; |
| 571 | 571 | int rc; |
| 572 | + if( sqlite3_libversion_number()<3008002 ){ | |
| 573 | + fossil_fatal("Unsuitable SQLite version %s, must be at least 3.8.2", | |
| 574 | + sqlite3_libversion()); | |
| 575 | + } | |
| 572 | 576 | sqlite3_config(SQLITE_CONFIG_SINGLETHREAD); |
| 573 | 577 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 574 | 578 | memset(&g, 0, sizeof(g)); |
| 575 | 579 | g.now = time(0); |
| 576 | 580 | g.httpHeader = empty_blob; |
| 577 | 581 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -567,10 +567,14 @@ | |
| 567 | #endif |
| 568 | { |
| 569 | const char *zCmdName = "unknown"; |
| 570 | int idx; |
| 571 | int rc; |
| 572 | sqlite3_config(SQLITE_CONFIG_SINGLETHREAD); |
| 573 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 574 | memset(&g, 0, sizeof(g)); |
| 575 | g.now = time(0); |
| 576 | g.httpHeader = empty_blob; |
| 577 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -567,10 +567,14 @@ | |
| 567 | #endif |
| 568 | { |
| 569 | const char *zCmdName = "unknown"; |
| 570 | int idx; |
| 571 | int rc; |
| 572 | if( sqlite3_libversion_number()<3008002 ){ |
| 573 | fossil_fatal("Unsuitable SQLite version %s, must be at least 3.8.2", |
| 574 | sqlite3_libversion()); |
| 575 | } |
| 576 | sqlite3_config(SQLITE_CONFIG_SINGLETHREAD); |
| 577 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 578 | memset(&g, 0, sizeof(g)); |
| 579 | g.now = time(0); |
| 580 | g.httpHeader = empty_blob; |
| 581 |
M
src/th.c
+16
-9
| --- src/th.c | ||
| +++ src/th.c | ||
| @@ -1060,11 +1060,12 @@ | ||
| 1060 | 1060 | static Th_Variable *thFindValue( |
| 1061 | 1061 | Th_Interp *interp, |
| 1062 | 1062 | const char *zVar, /* Pointer to variable name */ |
| 1063 | 1063 | int nVar, /* Number of bytes at nVar */ |
| 1064 | 1064 | int create, /* If true, create the variable if not found */ |
| 1065 | - int arrayok /* If true, an array is Ok. Otherwise array==error */ | |
| 1065 | + int arrayok, /* If true, an array is Ok. Otherwise array==error */ | |
| 1066 | + int noerror /* If false, set interpreter result to error message */ | |
| 1066 | 1067 | ){ |
| 1067 | 1068 | const char *zOuter; |
| 1068 | 1069 | int nOuter; |
| 1069 | 1070 | const char *zInner; |
| 1070 | 1071 | int nInner; |
| @@ -1093,11 +1094,13 @@ | ||
| 1093 | 1094 | pEntry->pData = (void *)pValue; |
| 1094 | 1095 | } |
| 1095 | 1096 | |
| 1096 | 1097 | if( zInner ){ |
| 1097 | 1098 | if( pValue->zData ){ |
| 1098 | - Th_ErrorMessage(interp, "variable is a scalar:", zOuter, nOuter); | |
| 1099 | + if( !noerror ){ | |
| 1100 | + Th_ErrorMessage(interp, "variable is a scalar:", zOuter, nOuter); | |
| 1101 | + } | |
| 1099 | 1102 | return 0; |
| 1100 | 1103 | } |
| 1101 | 1104 | if( !pValue->pHash ){ |
| 1102 | 1105 | if( !create ){ |
| 1103 | 1106 | goto no_such_var; |
| @@ -1115,19 +1118,23 @@ | ||
| 1115 | 1118 | pValue->nRef = 1; |
| 1116 | 1119 | pEntry->pData = (void *)pValue; |
| 1117 | 1120 | } |
| 1118 | 1121 | }else{ |
| 1119 | 1122 | if( pValue->pHash && !arrayok ){ |
| 1120 | - Th_ErrorMessage(interp, "variable is an array:", zOuter, nOuter); | |
| 1123 | + if( !noerror ){ | |
| 1124 | + Th_ErrorMessage(interp, "variable is an array:", zOuter, nOuter); | |
| 1125 | + } | |
| 1121 | 1126 | return 0; |
| 1122 | 1127 | } |
| 1123 | 1128 | } |
| 1124 | 1129 | |
| 1125 | 1130 | return pValue; |
| 1126 | 1131 | |
| 1127 | 1132 | no_such_var: |
| 1128 | - Th_ErrorMessage(interp, "no such variable:", zVar, nVar); | |
| 1133 | + if( !noerror ){ | |
| 1134 | + Th_ErrorMessage(interp, "no such variable:", zVar, nVar); | |
| 1135 | + } | |
| 1129 | 1136 | return 0; |
| 1130 | 1137 | } |
| 1131 | 1138 | |
| 1132 | 1139 | /* |
| 1133 | 1140 | ** String (zVar, nVar) must contain the name of a scalar variable or |
| @@ -1138,11 +1145,11 @@ | ||
| 1138 | 1145 | ** an error message in the interpreter result. |
| 1139 | 1146 | */ |
| 1140 | 1147 | int Th_GetVar(Th_Interp *interp, const char *zVar, int nVar){ |
| 1141 | 1148 | Th_Variable *pValue; |
| 1142 | 1149 | |
| 1143 | - pValue = thFindValue(interp, zVar, nVar, 0, 0); | |
| 1150 | + pValue = thFindValue(interp, zVar, nVar, 0, 0, 0); | |
| 1144 | 1151 | if( !pValue ){ |
| 1145 | 1152 | return TH_ERROR; |
| 1146 | 1153 | } |
| 1147 | 1154 | if( !pValue->zData ){ |
| 1148 | 1155 | Th_ErrorMessage(interp, "no such variable:", zVar, nVar); |
| @@ -1154,11 +1161,11 @@ | ||
| 1154 | 1161 | |
| 1155 | 1162 | /* |
| 1156 | 1163 | ** Return true if variable (zVar, nVar) exists. |
| 1157 | 1164 | */ |
| 1158 | 1165 | int Th_ExistsVar(Th_Interp *interp, const char *zVar, int nVar){ |
| 1159 | - Th_Variable *pValue = thFindValue(interp, zVar, nVar, 0, 0); | |
| 1166 | + Th_Variable *pValue = thFindValue(interp, zVar, nVar, 0, 0, 1); | |
| 1160 | 1167 | return pValue && pValue->zData; |
| 1161 | 1168 | } |
| 1162 | 1169 | |
| 1163 | 1170 | /* |
| 1164 | 1171 | ** String (zVar, nVar) must contain the name of a scalar variable or |
| @@ -1175,11 +1182,11 @@ | ||
| 1175 | 1182 | const char *zValue, |
| 1176 | 1183 | int nValue |
| 1177 | 1184 | ){ |
| 1178 | 1185 | Th_Variable *pValue; |
| 1179 | 1186 | |
| 1180 | - pValue = thFindValue(interp, zVar, nVar, 1, 0); | |
| 1187 | + pValue = thFindValue(interp, zVar, nVar, 1, 0, 0); | |
| 1181 | 1188 | if( !pValue ){ |
| 1182 | 1189 | return TH_ERROR; |
| 1183 | 1190 | } |
| 1184 | 1191 | |
| 1185 | 1192 | if( nValue<0 ){ |
| @@ -1218,11 +1225,11 @@ | ||
| 1218 | 1225 | if( !pFrame ){ |
| 1219 | 1226 | return TH_ERROR; |
| 1220 | 1227 | } |
| 1221 | 1228 | pSavedFrame = interp->pFrame; |
| 1222 | 1229 | interp->pFrame = pFrame; |
| 1223 | - pValue = thFindValue(interp, zLink, nLink, 1, 1); | |
| 1230 | + pValue = thFindValue(interp, zLink, nLink, 1, 1, 0); | |
| 1224 | 1231 | interp->pFrame = pSavedFrame; |
| 1225 | 1232 | |
| 1226 | 1233 | pEntry = Th_HashFind(interp, interp->pFrame->paVar, zLocal, nLocal, 1); |
| 1227 | 1234 | if( pEntry->pData ){ |
| 1228 | 1235 | Th_ErrorMessage(interp, "variable exists:", zLocal, nLocal); |
| @@ -1241,11 +1248,11 @@ | ||
| 1241 | 1248 | ** in the interpreter result and TH_ERROR is returned. |
| 1242 | 1249 | */ |
| 1243 | 1250 | int Th_UnsetVar(Th_Interp *interp, const char *zVar, int nVar){ |
| 1244 | 1251 | Th_Variable *pValue; |
| 1245 | 1252 | |
| 1246 | - pValue = thFindValue(interp, zVar, nVar, 0, 1); | |
| 1253 | + pValue = thFindValue(interp, zVar, nVar, 0, 1, 0); | |
| 1247 | 1254 | if( !pValue ){ |
| 1248 | 1255 | return TH_ERROR; |
| 1249 | 1256 | } |
| 1250 | 1257 | |
| 1251 | 1258 | Th_Free(interp, pValue->zData); |
| 1252 | 1259 |
| --- src/th.c | |
| +++ src/th.c | |
| @@ -1060,11 +1060,12 @@ | |
| 1060 | static Th_Variable *thFindValue( |
| 1061 | Th_Interp *interp, |
| 1062 | const char *zVar, /* Pointer to variable name */ |
| 1063 | int nVar, /* Number of bytes at nVar */ |
| 1064 | int create, /* If true, create the variable if not found */ |
| 1065 | int arrayok /* If true, an array is Ok. Otherwise array==error */ |
| 1066 | ){ |
| 1067 | const char *zOuter; |
| 1068 | int nOuter; |
| 1069 | const char *zInner; |
| 1070 | int nInner; |
| @@ -1093,11 +1094,13 @@ | |
| 1093 | pEntry->pData = (void *)pValue; |
| 1094 | } |
| 1095 | |
| 1096 | if( zInner ){ |
| 1097 | if( pValue->zData ){ |
| 1098 | Th_ErrorMessage(interp, "variable is a scalar:", zOuter, nOuter); |
| 1099 | return 0; |
| 1100 | } |
| 1101 | if( !pValue->pHash ){ |
| 1102 | if( !create ){ |
| 1103 | goto no_such_var; |
| @@ -1115,19 +1118,23 @@ | |
| 1115 | pValue->nRef = 1; |
| 1116 | pEntry->pData = (void *)pValue; |
| 1117 | } |
| 1118 | }else{ |
| 1119 | if( pValue->pHash && !arrayok ){ |
| 1120 | Th_ErrorMessage(interp, "variable is an array:", zOuter, nOuter); |
| 1121 | return 0; |
| 1122 | } |
| 1123 | } |
| 1124 | |
| 1125 | return pValue; |
| 1126 | |
| 1127 | no_such_var: |
| 1128 | Th_ErrorMessage(interp, "no such variable:", zVar, nVar); |
| 1129 | return 0; |
| 1130 | } |
| 1131 | |
| 1132 | /* |
| 1133 | ** String (zVar, nVar) must contain the name of a scalar variable or |
| @@ -1138,11 +1145,11 @@ | |
| 1138 | ** an error message in the interpreter result. |
| 1139 | */ |
| 1140 | int Th_GetVar(Th_Interp *interp, const char *zVar, int nVar){ |
| 1141 | Th_Variable *pValue; |
| 1142 | |
| 1143 | pValue = thFindValue(interp, zVar, nVar, 0, 0); |
| 1144 | if( !pValue ){ |
| 1145 | return TH_ERROR; |
| 1146 | } |
| 1147 | if( !pValue->zData ){ |
| 1148 | Th_ErrorMessage(interp, "no such variable:", zVar, nVar); |
| @@ -1154,11 +1161,11 @@ | |
| 1154 | |
| 1155 | /* |
| 1156 | ** Return true if variable (zVar, nVar) exists. |
| 1157 | */ |
| 1158 | int Th_ExistsVar(Th_Interp *interp, const char *zVar, int nVar){ |
| 1159 | Th_Variable *pValue = thFindValue(interp, zVar, nVar, 0, 0); |
| 1160 | return pValue && pValue->zData; |
| 1161 | } |
| 1162 | |
| 1163 | /* |
| 1164 | ** String (zVar, nVar) must contain the name of a scalar variable or |
| @@ -1175,11 +1182,11 @@ | |
| 1175 | const char *zValue, |
| 1176 | int nValue |
| 1177 | ){ |
| 1178 | Th_Variable *pValue; |
| 1179 | |
| 1180 | pValue = thFindValue(interp, zVar, nVar, 1, 0); |
| 1181 | if( !pValue ){ |
| 1182 | return TH_ERROR; |
| 1183 | } |
| 1184 | |
| 1185 | if( nValue<0 ){ |
| @@ -1218,11 +1225,11 @@ | |
| 1218 | if( !pFrame ){ |
| 1219 | return TH_ERROR; |
| 1220 | } |
| 1221 | pSavedFrame = interp->pFrame; |
| 1222 | interp->pFrame = pFrame; |
| 1223 | pValue = thFindValue(interp, zLink, nLink, 1, 1); |
| 1224 | interp->pFrame = pSavedFrame; |
| 1225 | |
| 1226 | pEntry = Th_HashFind(interp, interp->pFrame->paVar, zLocal, nLocal, 1); |
| 1227 | if( pEntry->pData ){ |
| 1228 | Th_ErrorMessage(interp, "variable exists:", zLocal, nLocal); |
| @@ -1241,11 +1248,11 @@ | |
| 1241 | ** in the interpreter result and TH_ERROR is returned. |
| 1242 | */ |
| 1243 | int Th_UnsetVar(Th_Interp *interp, const char *zVar, int nVar){ |
| 1244 | Th_Variable *pValue; |
| 1245 | |
| 1246 | pValue = thFindValue(interp, zVar, nVar, 0, 1); |
| 1247 | if( !pValue ){ |
| 1248 | return TH_ERROR; |
| 1249 | } |
| 1250 | |
| 1251 | Th_Free(interp, pValue->zData); |
| 1252 |
| --- src/th.c | |
| +++ src/th.c | |
| @@ -1060,11 +1060,12 @@ | |
| 1060 | static Th_Variable *thFindValue( |
| 1061 | Th_Interp *interp, |
| 1062 | const char *zVar, /* Pointer to variable name */ |
| 1063 | int nVar, /* Number of bytes at nVar */ |
| 1064 | int create, /* If true, create the variable if not found */ |
| 1065 | int arrayok, /* If true, an array is Ok. Otherwise array==error */ |
| 1066 | int noerror /* If false, set interpreter result to error message */ |
| 1067 | ){ |
| 1068 | const char *zOuter; |
| 1069 | int nOuter; |
| 1070 | const char *zInner; |
| 1071 | int nInner; |
| @@ -1093,11 +1094,13 @@ | |
| 1094 | pEntry->pData = (void *)pValue; |
| 1095 | } |
| 1096 | |
| 1097 | if( zInner ){ |
| 1098 | if( pValue->zData ){ |
| 1099 | if( !noerror ){ |
| 1100 | Th_ErrorMessage(interp, "variable is a scalar:", zOuter, nOuter); |
| 1101 | } |
| 1102 | return 0; |
| 1103 | } |
| 1104 | if( !pValue->pHash ){ |
| 1105 | if( !create ){ |
| 1106 | goto no_such_var; |
| @@ -1115,19 +1118,23 @@ | |
| 1118 | pValue->nRef = 1; |
| 1119 | pEntry->pData = (void *)pValue; |
| 1120 | } |
| 1121 | }else{ |
| 1122 | if( pValue->pHash && !arrayok ){ |
| 1123 | if( !noerror ){ |
| 1124 | Th_ErrorMessage(interp, "variable is an array:", zOuter, nOuter); |
| 1125 | } |
| 1126 | return 0; |
| 1127 | } |
| 1128 | } |
| 1129 | |
| 1130 | return pValue; |
| 1131 | |
| 1132 | no_such_var: |
| 1133 | if( !noerror ){ |
| 1134 | Th_ErrorMessage(interp, "no such variable:", zVar, nVar); |
| 1135 | } |
| 1136 | return 0; |
| 1137 | } |
| 1138 | |
| 1139 | /* |
| 1140 | ** String (zVar, nVar) must contain the name of a scalar variable or |
| @@ -1138,11 +1145,11 @@ | |
| 1145 | ** an error message in the interpreter result. |
| 1146 | */ |
| 1147 | int Th_GetVar(Th_Interp *interp, const char *zVar, int nVar){ |
| 1148 | Th_Variable *pValue; |
| 1149 | |
| 1150 | pValue = thFindValue(interp, zVar, nVar, 0, 0, 0); |
| 1151 | if( !pValue ){ |
| 1152 | return TH_ERROR; |
| 1153 | } |
| 1154 | if( !pValue->zData ){ |
| 1155 | Th_ErrorMessage(interp, "no such variable:", zVar, nVar); |
| @@ -1154,11 +1161,11 @@ | |
| 1161 | |
| 1162 | /* |
| 1163 | ** Return true if variable (zVar, nVar) exists. |
| 1164 | */ |
| 1165 | int Th_ExistsVar(Th_Interp *interp, const char *zVar, int nVar){ |
| 1166 | Th_Variable *pValue = thFindValue(interp, zVar, nVar, 0, 0, 1); |
| 1167 | return pValue && pValue->zData; |
| 1168 | } |
| 1169 | |
| 1170 | /* |
| 1171 | ** String (zVar, nVar) must contain the name of a scalar variable or |
| @@ -1175,11 +1182,11 @@ | |
| 1182 | const char *zValue, |
| 1183 | int nValue |
| 1184 | ){ |
| 1185 | Th_Variable *pValue; |
| 1186 | |
| 1187 | pValue = thFindValue(interp, zVar, nVar, 1, 0, 0); |
| 1188 | if( !pValue ){ |
| 1189 | return TH_ERROR; |
| 1190 | } |
| 1191 | |
| 1192 | if( nValue<0 ){ |
| @@ -1218,11 +1225,11 @@ | |
| 1225 | if( !pFrame ){ |
| 1226 | return TH_ERROR; |
| 1227 | } |
| 1228 | pSavedFrame = interp->pFrame; |
| 1229 | interp->pFrame = pFrame; |
| 1230 | pValue = thFindValue(interp, zLink, nLink, 1, 1, 0); |
| 1231 | interp->pFrame = pSavedFrame; |
| 1232 | |
| 1233 | pEntry = Th_HashFind(interp, interp->pFrame->paVar, zLocal, nLocal, 1); |
| 1234 | if( pEntry->pData ){ |
| 1235 | Th_ErrorMessage(interp, "variable exists:", zLocal, nLocal); |
| @@ -1241,11 +1248,11 @@ | |
| 1248 | ** in the interpreter result and TH_ERROR is returned. |
| 1249 | */ |
| 1250 | int Th_UnsetVar(Th_Interp *interp, const char *zVar, int nVar){ |
| 1251 | Th_Variable *pValue; |
| 1252 | |
| 1253 | pValue = thFindValue(interp, zVar, nVar, 0, 1, 0); |
| 1254 | if( !pValue ){ |
| 1255 | return TH_ERROR; |
| 1256 | } |
| 1257 | |
| 1258 | Th_Free(interp, pValue->zData); |
| 1259 |
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -881,11 +881,10 @@ | ||
| 881 | 881 | ** # ... code here |
| 882 | 882 | ** set common_done 1 |
| 883 | 883 | ** } |
| 884 | 884 | */ |
| 885 | 885 | int xfer_run_common_script(void){ |
| 886 | - Th_FossilInit(TH_INIT_DEFAULT); | |
| 887 | 886 | return xfer_run_script(xfer_common_code(), 0); |
| 888 | 887 | } |
| 889 | 888 | |
| 890 | 889 | /* |
| 891 | 890 | ** If this variable is set, disable login checks. Used for debugging |
| 892 | 891 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -881,11 +881,10 @@ | |
| 881 | ** # ... code here |
| 882 | ** set common_done 1 |
| 883 | ** } |
| 884 | */ |
| 885 | int xfer_run_common_script(void){ |
| 886 | Th_FossilInit(TH_INIT_DEFAULT); |
| 887 | return xfer_run_script(xfer_common_code(), 0); |
| 888 | } |
| 889 | |
| 890 | /* |
| 891 | ** If this variable is set, disable login checks. Used for debugging |
| 892 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -881,11 +881,10 @@ | |
| 881 | ** # ... code here |
| 882 | ** set common_done 1 |
| 883 | ** } |
| 884 | */ |
| 885 | int xfer_run_common_script(void){ |
| 886 | return xfer_run_script(xfer_common_code(), 0); |
| 887 | } |
| 888 | |
| 889 | /* |
| 890 | ** If this variable is set, disable login checks. Used for debugging |
| 891 |
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -881,11 +881,10 @@ | ||
| 881 | 881 | ** # ... code here |
| 882 | 882 | ** set common_done 1 |
| 883 | 883 | ** } |
| 884 | 884 | */ |
| 885 | 885 | int xfer_run_common_script(void){ |
| 886 | - Th_FossilInit(TH_INIT_DEFAULT); | |
| 887 | 886 | return xfer_run_script(xfer_common_code(), 0); |
| 888 | 887 | } |
| 889 | 888 | |
| 890 | 889 | /* |
| 891 | 890 | ** If this variable is set, disable login checks. Used for debugging |
| 892 | 891 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -881,11 +881,10 @@ | |
| 881 | ** # ... code here |
| 882 | ** set common_done 1 |
| 883 | ** } |
| 884 | */ |
| 885 | int xfer_run_common_script(void){ |
| 886 | Th_FossilInit(TH_INIT_DEFAULT); |
| 887 | return xfer_run_script(xfer_common_code(), 0); |
| 888 | } |
| 889 | |
| 890 | /* |
| 891 | ** If this variable is set, disable login checks. Used for debugging |
| 892 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -881,11 +881,10 @@ | |
| 881 | ** # ... code here |
| 882 | ** set common_done 1 |
| 883 | ** } |
| 884 | */ |
| 885 | int xfer_run_common_script(void){ |
| 886 | return xfer_run_script(xfer_common_code(), 0); |
| 887 | } |
| 888 | |
| 889 | /* |
| 890 | ** If this variable is set, disable login checks. Used for debugging |
| 891 |
+5
| --- test/th1.test | ||
| +++ test/th1.test | ||
| @@ -132,10 +132,15 @@ | ||
| 132 | 132 | |
| 133 | 133 | ############################################################################### |
| 134 | 134 | |
| 135 | 135 | fossil test-th-eval "set var 1; unset var; expr {\$var+0}" |
| 136 | 136 | test th1-info-exists-5 {$RESULT eq {TH_ERROR: no such variable: var}} |
| 137 | + | |
| 138 | +############################################################################### | |
| 139 | + | |
| 140 | +fossil test-th-eval "catch {bad}; info exists var; set th_stack_trace" | |
| 141 | +test th1-info-exists-6 {$RESULT eq {bad}} | |
| 137 | 142 | |
| 138 | 143 | ############################################################################### |
| 139 | 144 | |
| 140 | 145 | fossil test-th-eval "set var 1; unset var" |
| 141 | 146 | test th1-unset-1 {$RESULT eq {var}} |
| 142 | 147 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -132,10 +132,15 @@ | |
| 132 | |
| 133 | ############################################################################### |
| 134 | |
| 135 | fossil test-th-eval "set var 1; unset var; expr {\$var+0}" |
| 136 | test th1-info-exists-5 {$RESULT eq {TH_ERROR: no such variable: var}} |
| 137 | |
| 138 | ############################################################################### |
| 139 | |
| 140 | fossil test-th-eval "set var 1; unset var" |
| 141 | test th1-unset-1 {$RESULT eq {var}} |
| 142 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -132,10 +132,15 @@ | |
| 132 | |
| 133 | ############################################################################### |
| 134 | |
| 135 | fossil test-th-eval "set var 1; unset var; expr {\$var+0}" |
| 136 | test th1-info-exists-5 {$RESULT eq {TH_ERROR: no such variable: var}} |
| 137 | |
| 138 | ############################################################################### |
| 139 | |
| 140 | fossil test-th-eval "catch {bad}; info exists var; set th_stack_trace" |
| 141 | test th1-info-exists-6 {$RESULT eq {bad}} |
| 142 | |
| 143 | ############################################################################### |
| 144 | |
| 145 | fossil test-th-eval "set var 1; unset var" |
| 146 | test th1-unset-1 {$RESULT eq {var}} |
| 147 |
+16
-1
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -34,11 +34,26 @@ | ||
| 34 | 34 | repository. |
| 35 | 35 | * Fossil now hides check-ins that have the "hidden" tag in timeline webpages. |
| 36 | 36 | * Enhance <tt>/ci_edit</tt> page to add the "hidden" tag to check-ins. |
| 37 | 37 | * Advanced possibilities for commit and ticket change notifications over |
| 38 | 38 | http using TH1 scripting. |
| 39 | - * Add --sha1sum option to "[/help?cmd=commit | fossil commit]" command. | |
| 39 | + * Add --sha1sum and --integrate options | |
| 40 | + to the "[/help?cmd=commit | fossil commit]" command. | |
| 41 | + * Add the "clean" and "extra" subcommands to the | |
| 42 | + "[/help?cmd=all | fossil all]" command | |
| 43 | + * Add the --whatif option to "[/help?cmd=clean|fossil clean]" that works the | |
| 44 | + same as "--dry-run", | |
| 45 | + so that the name does not collide with the --dry-run option of "fossil all". | |
| 46 | + * Provide a configuration option to show dates on the web timeline | |
| 47 | + as "YYMMMDD HH:MM" | |
| 48 | + * Add an option to the "stats" webpage that allows an administrator to see | |
| 49 | + the current repository schema. | |
| 50 | + * Enhancements to the "[/help?cmd=/vdiff|/vdiff]" webpage for more difference | |
| 51 | + display options. | |
| 52 | + * Added the "[/tree?ci=trunk&expand | /tree]" webpage as an alternative | |
| 53 | + to "/dir" and make it the default way of showing file lists. | |
| 54 | + * Send gzipped HTTP responses to clients that support it. | |
| 40 | 55 | |
| 41 | 56 | <h2>Changes For Version 1.27 (2013-09-11)</h2> |
| 42 | 57 | * Enhance the [/help?cmd=changes | fossil changes], |
| 43 | 58 | [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras], |
| 44 | 59 | [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands |
| 45 | 60 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -34,11 +34,26 @@ | |
| 34 | repository. |
| 35 | * Fossil now hides check-ins that have the "hidden" tag in timeline webpages. |
| 36 | * Enhance <tt>/ci_edit</tt> page to add the "hidden" tag to check-ins. |
| 37 | * Advanced possibilities for commit and ticket change notifications over |
| 38 | http using TH1 scripting. |
| 39 | * Add --sha1sum option to "[/help?cmd=commit | fossil commit]" command. |
| 40 | |
| 41 | <h2>Changes For Version 1.27 (2013-09-11)</h2> |
| 42 | * Enhance the [/help?cmd=changes | fossil changes], |
| 43 | [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras], |
| 44 | [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands |
| 45 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -34,11 +34,26 @@ | |
| 34 | repository. |
| 35 | * Fossil now hides check-ins that have the "hidden" tag in timeline webpages. |
| 36 | * Enhance <tt>/ci_edit</tt> page to add the "hidden" tag to check-ins. |
| 37 | * Advanced possibilities for commit and ticket change notifications over |
| 38 | http using TH1 scripting. |
| 39 | * Add --sha1sum and --integrate options |
| 40 | to the "[/help?cmd=commit | fossil commit]" command. |
| 41 | * Add the "clean" and "extra" subcommands to the |
| 42 | "[/help?cmd=all | fossil all]" command |
| 43 | * Add the --whatif option to "[/help?cmd=clean|fossil clean]" that works the |
| 44 | same as "--dry-run", |
| 45 | so that the name does not collide with the --dry-run option of "fossil all". |
| 46 | * Provide a configuration option to show dates on the web timeline |
| 47 | as "YYMMMDD HH:MM" |
| 48 | * Add an option to the "stats" webpage that allows an administrator to see |
| 49 | the current repository schema. |
| 50 | * Enhancements to the "[/help?cmd=/vdiff|/vdiff]" webpage for more difference |
| 51 | display options. |
| 52 | * Added the "[/tree?ci=trunk&expand | /tree]" webpage as an alternative |
| 53 | to "/dir" and make it the default way of showing file lists. |
| 54 | * Send gzipped HTTP responses to clients that support it. |
| 55 | |
| 56 | <h2>Changes For Version 1.27 (2013-09-11)</h2> |
| 57 | * Enhance the [/help?cmd=changes | fossil changes], |
| 58 | [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras], |
| 59 | [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands |
| 60 |