Fossil SCM

Merge in new feature from trunk.

andybradford 2015-04-17 00:11 sync-forkwarn merge
Commit eab553c77ed059faaf6ace04bd649f642bc6752b
+1 -1
--- src/allrepo.c
+++ src/allrepo.c
@@ -275,11 +275,11 @@
275275
useCheckouts = find_option("ckout","c",0)!=0;
276276
verify_all_options();
277277
db_begin_transaction();
278278
for(j=3; j<g.argc; j++, blob_reset(&sql), blob_reset(&fn)){
279279
file_canonical_name(g.argv[j], &fn, 0);
280
- blob_append_sql(&sql,
280
+ blob_append_sql(&sql,
281281
"DELETE FROM global_config WHERE name GLOB '%s:%q'",
282282
useCheckouts?"ckout":"repo", blob_str(&fn)
283283
);
284284
if( dryRunFlag ){
285285
fossil_print("%s\n", blob_sql_text(&sql));
286286
--- src/allrepo.c
+++ src/allrepo.c
@@ -275,11 +275,11 @@
275 useCheckouts = find_option("ckout","c",0)!=0;
276 verify_all_options();
277 db_begin_transaction();
278 for(j=3; j<g.argc; j++, blob_reset(&sql), blob_reset(&fn)){
279 file_canonical_name(g.argv[j], &fn, 0);
280 blob_append_sql(&sql,
281 "DELETE FROM global_config WHERE name GLOB '%s:%q'",
282 useCheckouts?"ckout":"repo", blob_str(&fn)
283 );
284 if( dryRunFlag ){
285 fossil_print("%s\n", blob_sql_text(&sql));
286
--- src/allrepo.c
+++ src/allrepo.c
@@ -275,11 +275,11 @@
275 useCheckouts = find_option("ckout","c",0)!=0;
276 verify_all_options();
277 db_begin_transaction();
278 for(j=3; j<g.argc; j++, blob_reset(&sql), blob_reset(&fn)){
279 file_canonical_name(g.argv[j], &fn, 0);
280 blob_append_sql(&sql,
281 "DELETE FROM global_config WHERE name GLOB '%s:%q'",
282 useCheckouts?"ckout":"repo", blob_str(&fn)
283 );
284 if( dryRunFlag ){
285 fossil_print("%s\n", blob_sql_text(&sql));
286
+1 -1
--- src/clone.c
+++ src/clone.c
@@ -206,11 +206,11 @@
206206
rebuild_db(0, 1, 0);
207207
fossil_print("Extra delta compression... "); fflush(stdout);
208208
extra_deltification();
209209
db_end_transaction(0);
210210
fossil_print("\nVacuuming the database... "); fflush(stdout);
211
- if( db_int(0, "PRAGMA page_count")>1000
211
+ if( db_int(0, "PRAGMA page_count")>1000
212212
&& db_int(0, "PRAGMA page_size")<8192 ){
213213
db_multi_exec("PRAGMA page_size=8192;");
214214
}
215215
db_multi_exec("VACUUM");
216216
fossil_print("\nproject-id: %s\n", db_get("project-code", 0));
217217
--- src/clone.c
+++ src/clone.c
@@ -206,11 +206,11 @@
206 rebuild_db(0, 1, 0);
207 fossil_print("Extra delta compression... "); fflush(stdout);
208 extra_deltification();
209 db_end_transaction(0);
210 fossil_print("\nVacuuming the database... "); fflush(stdout);
211 if( db_int(0, "PRAGMA page_count")>1000
212 && db_int(0, "PRAGMA page_size")<8192 ){
213 db_multi_exec("PRAGMA page_size=8192;");
214 }
215 db_multi_exec("VACUUM");
216 fossil_print("\nproject-id: %s\n", db_get("project-code", 0));
217
--- src/clone.c
+++ src/clone.c
@@ -206,11 +206,11 @@
206 rebuild_db(0, 1, 0);
207 fossil_print("Extra delta compression... "); fflush(stdout);
208 extra_deltification();
209 db_end_transaction(0);
210 fossil_print("\nVacuuming the database... "); fflush(stdout);
211 if( db_int(0, "PRAGMA page_count")>1000
212 && db_int(0, "PRAGMA page_size")<8192 ){
213 db_multi_exec("PRAGMA page_size=8192;");
214 }
215 db_multi_exec("VACUUM");
216 fossil_print("\nproject-id: %s\n", db_get("project-code", 0));
217
+1 -1
--- src/db.c
+++ src/db.c
@@ -1646,11 +1646,11 @@
16461646
verify_all_options();
16471647
16481648
if( g.argc!=3 ){
16491649
usage("REPOSITORY-NAME");
16501650
}
1651
-
1651
+
16521652
if( -1 != file_size(g.argv[2]) ){
16531653
fossil_fatal("file already exists: %s", g.argv[2]);
16541654
}
16551655
16561656
db_create_repository(g.argv[2]);
16571657
--- src/db.c
+++ src/db.c
@@ -1646,11 +1646,11 @@
1646 verify_all_options();
1647
1648 if( g.argc!=3 ){
1649 usage("REPOSITORY-NAME");
1650 }
1651
1652 if( -1 != file_size(g.argv[2]) ){
1653 fossil_fatal("file already exists: %s", g.argv[2]);
1654 }
1655
1656 db_create_repository(g.argv[2]);
1657
--- src/db.c
+++ src/db.c
@@ -1646,11 +1646,11 @@
1646 verify_all_options();
1647
1648 if( g.argc!=3 ){
1649 usage("REPOSITORY-NAME");
1650 }
1651
1652 if( -1 != file_size(g.argv[2]) ){
1653 fossil_fatal("file already exists: %s", g.argv[2]);
1654 }
1655
1656 db_create_repository(g.argv[2]);
1657
+26 -21
--- src/descendants.c
+++ src/descendants.c
@@ -340,14 +340,15 @@
340340
db_finalize(&q);
341341
}
342342
343343
/*
344344
** COMMAND: leaves*
345
+** COMMAND: forks*
345346
**
346
-** Usage: %fossil leaves ?OPTIONS?
347
+** Usage: %fossil leaves|forks ?OPTIONS?
347348
**
348
-** Find leaves of all branches. By default show only open leaves.
349
+** Find leaves/forks of all branches. By default show only open leaves.
349350
** The -a|--all flag causes all leaves (closed and open) to be shown.
350351
** The -c|--closed flag shows only closed leaves.
351352
**
352353
** The --recompute flag causes the content of the "leaf" table in the
353354
** repository database to be recomputed.
@@ -368,10 +369,11 @@
368369
Blob sql;
369370
int showAll = find_option("all", "a", 0)!=0;
370371
int showClosed = find_option("closed", "c", 0)!=0;
371372
int recomputeFlag = find_option("recompute",0,0)!=0;
372373
int byBranch = find_option("bybranch",0,0)!=0;
374
+ int showForks = g.argv[1][0]=='f';
373375
const char *zWidth = find_option("width","W",1);
374376
char *zLastBr = 0;
375377
int n, width;
376378
char zLineNo[10];
377379
@@ -382,21 +384,21 @@
382384
}
383385
}else{
384386
width = -1;
385387
}
386388
db_find_and_open_repository(0,0);
387
-
389
+
388390
/* We should be done with options.. */
389391
verify_all_options();
390392
391393
if( recomputeFlag ) leaf_rebuild();
392394
blob_zero(&sql);
393395
blob_append(&sql, timeline_query_for_tty(), -1);
394396
blob_append_sql(&sql, " AND blob.rid IN leaf");
395397
if( showClosed ){
396398
blob_append_sql(&sql," AND %z", leaf_is_closed_sql("blob.rid"));
397
- }else if( !showAll ){
399
+ }else if( !showAll || showForks ){
398400
blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
399401
}
400402
if( byBranch ){
401403
db_prepare(&q, "%s ORDER BY nullif(branch,'trunk') COLLATE nocase,"
402404
" event.mtime DESC",
@@ -405,27 +407,30 @@
405407
db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
406408
}
407409
blob_reset(&sql);
408410
n = 0;
409411
while( db_step(&q)==SQLITE_ROW ){
410
- const char *zId = db_column_text(&q, 1);
411
- const char *zDate = db_column_text(&q, 2);
412
- const char *zCom = db_column_text(&q, 3);
413
- const char *zBr = db_column_text(&q, 7);
414
- char *z;
415
-
416
- if( byBranch && fossil_strcmp(zBr, zLastBr)!=0 ){
417
- fossil_print("*** %s ***\n", zBr);
418
- fossil_free(zLastBr);
419
- zLastBr = fossil_strdup(zBr);
420
- }
421
- n++;
422
- sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n);
423
- fossil_print("%6s ", zLineNo);
424
- z = mprintf("%s [%S] %s", zDate, zId, zCom);
425
- comment_print(z, zCom, 7, width, g.comFmtFlags);
426
- fossil_free(z);
412
+ if( !showForks ||
413
+ fossil_find_nearest_fork(db_column_int(&q, 0), db_open_local(0)) ){
414
+ const char *zId = db_column_text(&q, 1);
415
+ const char *zDate = db_column_text(&q, 2);
416
+ const char *zCom = db_column_text(&q, 3);
417
+ const char *zBr = db_column_text(&q, 7);
418
+ char *z;
419
+
420
+ if( byBranch && fossil_strcmp(zBr, zLastBr)!=0 ){
421
+ fossil_print("*** %s ***\n", zBr);
422
+ fossil_free(zLastBr);
423
+ zLastBr = fossil_strdup(zBr);
424
+ }
425
+ n++;
426
+ sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n);
427
+ fossil_print("%6s ", zLineNo);
428
+ z = mprintf("%s [%S] %s", zDate, zId, zCom);
429
+ comment_print(z, zCom, 7, width, g.comFmtFlags);
430
+ fossil_free(z);
431
+ }
427432
}
428433
fossil_free(zLastBr);
429434
db_finalize(&q);
430435
}
431436
432437
--- src/descendants.c
+++ src/descendants.c
@@ -340,14 +340,15 @@
340 db_finalize(&q);
341 }
342
343 /*
344 ** COMMAND: leaves*
 
345 **
346 ** Usage: %fossil leaves ?OPTIONS?
347 **
348 ** Find leaves of all branches. By default show only open leaves.
349 ** The -a|--all flag causes all leaves (closed and open) to be shown.
350 ** The -c|--closed flag shows only closed leaves.
351 **
352 ** The --recompute flag causes the content of the "leaf" table in the
353 ** repository database to be recomputed.
@@ -368,10 +369,11 @@
368 Blob sql;
369 int showAll = find_option("all", "a", 0)!=0;
370 int showClosed = find_option("closed", "c", 0)!=0;
371 int recomputeFlag = find_option("recompute",0,0)!=0;
372 int byBranch = find_option("bybranch",0,0)!=0;
 
373 const char *zWidth = find_option("width","W",1);
374 char *zLastBr = 0;
375 int n, width;
376 char zLineNo[10];
377
@@ -382,21 +384,21 @@
382 }
383 }else{
384 width = -1;
385 }
386 db_find_and_open_repository(0,0);
387
388 /* We should be done with options.. */
389 verify_all_options();
390
391 if( recomputeFlag ) leaf_rebuild();
392 blob_zero(&sql);
393 blob_append(&sql, timeline_query_for_tty(), -1);
394 blob_append_sql(&sql, " AND blob.rid IN leaf");
395 if( showClosed ){
396 blob_append_sql(&sql," AND %z", leaf_is_closed_sql("blob.rid"));
397 }else if( !showAll ){
398 blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
399 }
400 if( byBranch ){
401 db_prepare(&q, "%s ORDER BY nullif(branch,'trunk') COLLATE nocase,"
402 " event.mtime DESC",
@@ -405,27 +407,30 @@
405 db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
406 }
407 blob_reset(&sql);
408 n = 0;
409 while( db_step(&q)==SQLITE_ROW ){
410 const char *zId = db_column_text(&q, 1);
411 const char *zDate = db_column_text(&q, 2);
412 const char *zCom = db_column_text(&q, 3);
413 const char *zBr = db_column_text(&q, 7);
414 char *z;
415
416 if( byBranch && fossil_strcmp(zBr, zLastBr)!=0 ){
417 fossil_print("*** %s ***\n", zBr);
418 fossil_free(zLastBr);
419 zLastBr = fossil_strdup(zBr);
420 }
421 n++;
422 sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n);
423 fossil_print("%6s ", zLineNo);
424 z = mprintf("%s [%S] %s", zDate, zId, zCom);
425 comment_print(z, zCom, 7, width, g.comFmtFlags);
426 fossil_free(z);
 
 
 
427 }
428 fossil_free(zLastBr);
429 db_finalize(&q);
430 }
431
432
--- src/descendants.c
+++ src/descendants.c
@@ -340,14 +340,15 @@
340 db_finalize(&q);
341 }
342
343 /*
344 ** COMMAND: leaves*
345 ** COMMAND: forks*
346 **
347 ** Usage: %fossil leaves|forks ?OPTIONS?
348 **
349 ** Find leaves/forks of all branches. By default show only open leaves.
350 ** The -a|--all flag causes all leaves (closed and open) to be shown.
351 ** The -c|--closed flag shows only closed leaves.
352 **
353 ** The --recompute flag causes the content of the "leaf" table in the
354 ** repository database to be recomputed.
@@ -368,10 +369,11 @@
369 Blob sql;
370 int showAll = find_option("all", "a", 0)!=0;
371 int showClosed = find_option("closed", "c", 0)!=0;
372 int recomputeFlag = find_option("recompute",0,0)!=0;
373 int byBranch = find_option("bybranch",0,0)!=0;
374 int showForks = g.argv[1][0]=='f';
375 const char *zWidth = find_option("width","W",1);
376 char *zLastBr = 0;
377 int n, width;
378 char zLineNo[10];
379
@@ -382,21 +384,21 @@
384 }
385 }else{
386 width = -1;
387 }
388 db_find_and_open_repository(0,0);
389
390 /* We should be done with options.. */
391 verify_all_options();
392
393 if( recomputeFlag ) leaf_rebuild();
394 blob_zero(&sql);
395 blob_append(&sql, timeline_query_for_tty(), -1);
396 blob_append_sql(&sql, " AND blob.rid IN leaf");
397 if( showClosed ){
398 blob_append_sql(&sql," AND %z", leaf_is_closed_sql("blob.rid"));
399 }else if( !showAll || showForks ){
400 blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
401 }
402 if( byBranch ){
403 db_prepare(&q, "%s ORDER BY nullif(branch,'trunk') COLLATE nocase,"
404 " event.mtime DESC",
@@ -405,27 +407,30 @@
407 db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
408 }
409 blob_reset(&sql);
410 n = 0;
411 while( db_step(&q)==SQLITE_ROW ){
412 if( !showForks ||
413 fossil_find_nearest_fork(db_column_int(&q, 0), db_open_local(0)) ){
414 const char *zId = db_column_text(&q, 1);
415 const char *zDate = db_column_text(&q, 2);
416 const char *zCom = db_column_text(&q, 3);
417 const char *zBr = db_column_text(&q, 7);
418 char *z;
419
420 if( byBranch && fossil_strcmp(zBr, zLastBr)!=0 ){
421 fossil_print("*** %s ***\n", zBr);
422 fossil_free(zLastBr);
423 zLastBr = fossil_strdup(zBr);
424 }
425 n++;
426 sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n);
427 fossil_print("%6s ", zLineNo);
428 z = mprintf("%s [%S] %s", zDate, zId, zCom);
429 comment_print(z, zCom, 7, width, g.comFmtFlags);
430 fossil_free(z);
431 }
432 }
433 fossil_free(zLastBr);
434 db_finalize(&q);
435 }
436
437
+1 -1
--- src/info.c
+++ src/info.c
@@ -121,11 +121,11 @@
121121
" WHERE tx.rid=%d"
122122
" AND tx.tagid=%d"
123123
" AND tx.tagtype>0",
124124
rid, TAG_CLOSED)){
125125
fossil_print("%s\n", "closed");
126
- }else if( fossil_find_nearest_fork(rid, 1) ){
126
+ }else if( fossil_find_nearest_fork(rid, db_open_local(0)) ){
127127
fossil_print("%s\n", "fork");
128128
isFork = 1;
129129
}else{
130130
fossil_print("%s\n", "open");
131131
}
132132
--- src/info.c
+++ src/info.c
@@ -121,11 +121,11 @@
121 " WHERE tx.rid=%d"
122 " AND tx.tagid=%d"
123 " AND tx.tagtype>0",
124 rid, TAG_CLOSED)){
125 fossil_print("%s\n", "closed");
126 }else if( fossil_find_nearest_fork(rid, 1) ){
127 fossil_print("%s\n", "fork");
128 isFork = 1;
129 }else{
130 fossil_print("%s\n", "open");
131 }
132
--- src/info.c
+++ src/info.c
@@ -121,11 +121,11 @@
121 " WHERE tx.rid=%d"
122 " AND tx.tagid=%d"
123 " AND tx.tagtype>0",
124 rid, TAG_CLOSED)){
125 fossil_print("%s\n", "closed");
126 }else if( fossil_find_nearest_fork(rid, db_open_local(0)) ){
127 fossil_print("%s\n", "fork");
128 isFork = 1;
129 }else{
130 fossil_print("%s\n", "open");
131 }
132
+1 -1
--- src/merge.c
+++ src/merge.c
@@ -217,11 +217,11 @@
217217
*/
218218
Stmt q;
219219
if( pickFlag || backoutFlag || integrateFlag){
220220
fossil_fatal("cannot use --backout, --cherrypick or --integrate with a fork merge");
221221
}
222
- mid = fossil_find_nearest_fork(vid, 1);
222
+ mid = fossil_find_nearest_fork(vid, db_open_local(0));
223223
if( mid==0 ){
224224
fossil_fatal("no unmerged forks of branch \"%s\"",
225225
db_text(0, "SELECT value FROM tagxref"
226226
" WHERE tagid=%d AND rid=%d AND tagtype>0",
227227
TAG_BRANCH, vid)
228228
--- src/merge.c
+++ src/merge.c
@@ -217,11 +217,11 @@
217 */
218 Stmt q;
219 if( pickFlag || backoutFlag || integrateFlag){
220 fossil_fatal("cannot use --backout, --cherrypick or --integrate with a fork merge");
221 }
222 mid = fossil_find_nearest_fork(vid, 1);
223 if( mid==0 ){
224 fossil_fatal("no unmerged forks of branch \"%s\"",
225 db_text(0, "SELECT value FROM tagxref"
226 " WHERE tagid=%d AND rid=%d AND tagtype>0",
227 TAG_BRANCH, vid)
228
--- src/merge.c
+++ src/merge.c
@@ -217,11 +217,11 @@
217 */
218 Stmt q;
219 if( pickFlag || backoutFlag || integrateFlag){
220 fossil_fatal("cannot use --backout, --cherrypick or --integrate with a fork merge");
221 }
222 mid = fossil_find_nearest_fork(vid, db_open_local(0));
223 if( mid==0 ){
224 fossil_fatal("no unmerged forks of branch \"%s\"",
225 db_text(0, "SELECT value FROM tagxref"
226 " WHERE tagid=%d AND rid=%d AND tagtype>0",
227 TAG_BRANCH, vid)
228
+1 -1
--- src/sitemap.c
+++ src/sitemap.c
@@ -47,11 +47,11 @@
4747
@ <li>%z(href("%R/tree?type=flat"))Flat-view</a></li>
4848
@ <li>%z(href("%R/fileage?name=trunk"))File ages for Trunk</a></li>
4949
@ </ul>
5050
@ <li>%z(href("%R/timeline?n=200"))Project Timeline</a></li>
5151
@ <ul>
52
- @ <li>%z(href("%R/timeline?a=1970-01-01&y=ci&n=10"))First 10
52
+ @ <li>%z(href("%R/timeline?a=1970-01-01&y=ci&n=10"))First 10
5353
@ check-ins</a></li>
5454
@ <li>%z(href("%R/timeline?n=all&namechng"))All check-ins with file name
5555
@ changes</a></li>
5656
@ <li>%z(href("%R/reports"))Activity Reports</a></li>
5757
@ </ul>
5858
--- src/sitemap.c
+++ src/sitemap.c
@@ -47,11 +47,11 @@
47 @ <li>%z(href("%R/tree?type=flat"))Flat-view</a></li>
48 @ <li>%z(href("%R/fileage?name=trunk"))File ages for Trunk</a></li>
49 @ </ul>
50 @ <li>%z(href("%R/timeline?n=200"))Project Timeline</a></li>
51 @ <ul>
52 @ <li>%z(href("%R/timeline?a=1970-01-01&y=ci&n=10"))First 10
53 @ check-ins</a></li>
54 @ <li>%z(href("%R/timeline?n=all&namechng"))All check-ins with file name
55 @ changes</a></li>
56 @ <li>%z(href("%R/reports"))Activity Reports</a></li>
57 @ </ul>
58
--- src/sitemap.c
+++ src/sitemap.c
@@ -47,11 +47,11 @@
47 @ <li>%z(href("%R/tree?type=flat"))Flat-view</a></li>
48 @ <li>%z(href("%R/fileage?name=trunk"))File ages for Trunk</a></li>
49 @ </ul>
50 @ <li>%z(href("%R/timeline?n=200"))Project Timeline</a></li>
51 @ <ul>
52 @ <li>%z(href("%R/timeline?a=1970-01-01&y=ci&n=10"))First 10
53 @ check-ins</a></li>
54 @ <li>%z(href("%R/timeline?n=all&namechng"))All check-ins with file name
55 @ changes</a></li>
56 @ <li>%z(href("%R/reports"))Activity Reports</a></li>
57 @ </ul>
58
+1 -1
--- src/skins.c
+++ src/skins.c
@@ -602,11 +602,11 @@
602602
cgi_replace_parameter(aSkinAttr[ii].zFile, builtin_text(zDflt));
603603
}
604604
style_header("%s", aSkinAttr[ii].zTitle);
605605
for(j=0; j<ArraySize(aSkinAttr); j++){
606606
if( j==ii ) continue;
607
- style_submenu_element(aSkinAttr[j].zSubmenu, 0,
607
+ style_submenu_element(aSkinAttr[j].zSubmenu, 0,
608608
"%R/setup_skinedit?w=%d&basis=%h",j,zBasis);
609609
}
610610
style_submenu_element("Skins", 0, "%R/setup_skin");
611611
@ <form action="%s(g.zTop)/setup_skinedit" method="post"><div>
612612
login_insert_csrf_secret();
613613
--- src/skins.c
+++ src/skins.c
@@ -602,11 +602,11 @@
602 cgi_replace_parameter(aSkinAttr[ii].zFile, builtin_text(zDflt));
603 }
604 style_header("%s", aSkinAttr[ii].zTitle);
605 for(j=0; j<ArraySize(aSkinAttr); j++){
606 if( j==ii ) continue;
607 style_submenu_element(aSkinAttr[j].zSubmenu, 0,
608 "%R/setup_skinedit?w=%d&basis=%h",j,zBasis);
609 }
610 style_submenu_element("Skins", 0, "%R/setup_skin");
611 @ <form action="%s(g.zTop)/setup_skinedit" method="post"><div>
612 login_insert_csrf_secret();
613
--- src/skins.c
+++ src/skins.c
@@ -602,11 +602,11 @@
602 cgi_replace_parameter(aSkinAttr[ii].zFile, builtin_text(zDflt));
603 }
604 style_header("%s", aSkinAttr[ii].zTitle);
605 for(j=0; j<ArraySize(aSkinAttr); j++){
606 if( j==ii ) continue;
607 style_submenu_element(aSkinAttr[j].zSubmenu, 0,
608 "%R/setup_skinedit?w=%d&basis=%h",j,zBasis);
609 }
610 style_submenu_element("Skins", 0, "%R/setup_skin");
611 @ <form action="%s(g.zTop)/setup_skinedit" method="post"><div>
612 login_insert_csrf_secret();
613
+9 -2
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -66,21 +66,27 @@
6666
){
6767
const unsigned char *pIn;
6868
unsigned char *pOut;
6969
unsigned int nIn;
7070
unsigned long int nOut;
71
+ int rc;
7172
7273
pIn = sqlite3_value_blob(argv[0]);
7374
nIn = sqlite3_value_bytes(argv[0]);
7475
nOut = 13 + nIn + (nIn+999)/1000;
7576
pOut = sqlite3_malloc( nOut+4 );
7677
pOut[0] = nIn>>24 & 0xff;
7778
pOut[1] = nIn>>16 & 0xff;
7879
pOut[2] = nIn>>8 & 0xff;
7980
pOut[3] = nIn & 0xff;
80
- compress(&pOut[4], &nOut, pIn, nIn);
81
- sqlite3_result_blob(context, pOut, nOut+4, sqlite3_free);
81
+ rc = compress(&pOut[4], &nOut, pIn, nIn);
82
+ if( rc==Z_OK ){
83
+ sqlite3_result_blob(context, pOut, nOut+4, sqlite3_free);
84
+ }else{
85
+ sqlite3_free(pOut);
86
+ sqlite3_result_error(context, "input cannot be zlib compressed", -1);
87
+ }
8288
}
8389
8490
/*
8591
** Implementation of the "decompress(X)" SQL function. The argument X
8692
** is a blob which was obtained from compress(Y). The output will be
@@ -103,10 +109,11 @@
103109
pOut = sqlite3_malloc( nOut+1 );
104110
rc = uncompress(pOut, &nOut, &pIn[4], nIn-4);
105111
if( rc==Z_OK ){
106112
sqlite3_result_blob(context, pOut, nOut, sqlite3_free);
107113
}else{
114
+ sqlite3_free(pOut);
108115
sqlite3_result_error(context, "input is not zlib compressed", -1);
109116
}
110117
}
111118
112119
/*
113120
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -66,21 +66,27 @@
66 ){
67 const unsigned char *pIn;
68 unsigned char *pOut;
69 unsigned int nIn;
70 unsigned long int nOut;
 
71
72 pIn = sqlite3_value_blob(argv[0]);
73 nIn = sqlite3_value_bytes(argv[0]);
74 nOut = 13 + nIn + (nIn+999)/1000;
75 pOut = sqlite3_malloc( nOut+4 );
76 pOut[0] = nIn>>24 & 0xff;
77 pOut[1] = nIn>>16 & 0xff;
78 pOut[2] = nIn>>8 & 0xff;
79 pOut[3] = nIn & 0xff;
80 compress(&pOut[4], &nOut, pIn, nIn);
81 sqlite3_result_blob(context, pOut, nOut+4, sqlite3_free);
 
 
 
 
 
82 }
83
84 /*
85 ** Implementation of the "decompress(X)" SQL function. The argument X
86 ** is a blob which was obtained from compress(Y). The output will be
@@ -103,10 +109,11 @@
103 pOut = sqlite3_malloc( nOut+1 );
104 rc = uncompress(pOut, &nOut, &pIn[4], nIn-4);
105 if( rc==Z_OK ){
106 sqlite3_result_blob(context, pOut, nOut, sqlite3_free);
107 }else{
 
108 sqlite3_result_error(context, "input is not zlib compressed", -1);
109 }
110 }
111
112 /*
113
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -66,21 +66,27 @@
66 ){
67 const unsigned char *pIn;
68 unsigned char *pOut;
69 unsigned int nIn;
70 unsigned long int nOut;
71 int rc;
72
73 pIn = sqlite3_value_blob(argv[0]);
74 nIn = sqlite3_value_bytes(argv[0]);
75 nOut = 13 + nIn + (nIn+999)/1000;
76 pOut = sqlite3_malloc( nOut+4 );
77 pOut[0] = nIn>>24 & 0xff;
78 pOut[1] = nIn>>16 & 0xff;
79 pOut[2] = nIn>>8 & 0xff;
80 pOut[3] = nIn & 0xff;
81 rc = compress(&pOut[4], &nOut, pIn, nIn);
82 if( rc==Z_OK ){
83 sqlite3_result_blob(context, pOut, nOut+4, sqlite3_free);
84 }else{
85 sqlite3_free(pOut);
86 sqlite3_result_error(context, "input cannot be zlib compressed", -1);
87 }
88 }
89
90 /*
91 ** Implementation of the "decompress(X)" SQL function. The argument X
92 ** is a blob which was obtained from compress(Y). The output will be
@@ -103,10 +109,11 @@
109 pOut = sqlite3_malloc( nOut+1 );
110 rc = uncompress(pOut, &nOut, &pIn[4], nIn-4);
111 if( rc==Z_OK ){
112 sqlite3_result_blob(context, pOut, nOut, sqlite3_free);
113 }else{
114 sqlite3_free(pOut);
115 sqlite3_result_error(context, "input is not zlib compressed", -1);
116 }
117 }
118
119 /*
120
+1 -1
--- src/utf8.c
+++ src/utf8.c
@@ -323,11 +323,11 @@
323323
}
324324
325325
/* If blob to be written to the Windows console is not
326326
* UTF-8, convert it to UTF-8 first.
327327
*/
328
- blob_init(&blob, zUtf8, nByte);
328
+ blob_init(&blob, zUtf8, nByte);
329329
blob_to_utf8_no_bom(&blob, 1);
330330
nChar = MultiByteToWideChar(CP_UTF8, 0, blob_buffer(&blob),
331331
blob_size(&blob), NULL, 0);
332332
zUnicode = malloc( (nChar + 1) *sizeof(zUnicode[0]) );
333333
if( zUnicode==0 ){
334334
--- src/utf8.c
+++ src/utf8.c
@@ -323,11 +323,11 @@
323 }
324
325 /* If blob to be written to the Windows console is not
326 * UTF-8, convert it to UTF-8 first.
327 */
328 blob_init(&blob, zUtf8, nByte);
329 blob_to_utf8_no_bom(&blob, 1);
330 nChar = MultiByteToWideChar(CP_UTF8, 0, blob_buffer(&blob),
331 blob_size(&blob), NULL, 0);
332 zUnicode = malloc( (nChar + 1) *sizeof(zUnicode[0]) );
333 if( zUnicode==0 ){
334
--- src/utf8.c
+++ src/utf8.c
@@ -323,11 +323,11 @@
323 }
324
325 /* If blob to be written to the Windows console is not
326 * UTF-8, convert it to UTF-8 first.
327 */
328 blob_init(&blob, zUtf8, nByte);
329 blob_to_utf8_no_bom(&blob, 1);
330 nChar = MultiByteToWideChar(CP_UTF8, 0, blob_buffer(&blob),
331 blob_size(&blob), NULL, 0);
332 zUnicode = malloc( (nChar + 1) *sizeof(zUnicode[0]) );
333 if( zUnicode==0 ){
334
+1 -1
--- src/zip.c
+++ src/zip.c
@@ -399,11 +399,11 @@
399399
int rid;
400400
Blob zip;
401401
const char *zName;
402402
zName = find_option("name", 0, 1);
403403
db_find_and_open_repository(0, 0);
404
-
404
+
405405
/* We should be done with options.. */
406406
verify_all_options();
407407
408408
if( g.argc!=4 ){
409409
usage("VERSION OUTPUTFILE");
410410
--- src/zip.c
+++ src/zip.c
@@ -399,11 +399,11 @@
399 int rid;
400 Blob zip;
401 const char *zName;
402 zName = find_option("name", 0, 1);
403 db_find_and_open_repository(0, 0);
404
405 /* We should be done with options.. */
406 verify_all_options();
407
408 if( g.argc!=4 ){
409 usage("VERSION OUTPUTFILE");
410
--- src/zip.c
+++ src/zip.c
@@ -399,11 +399,11 @@
399 int rid;
400 Blob zip;
401 const char *zName;
402 zName = find_option("name", 0, 1);
403 db_find_and_open_repository(0, 0);
404
405 /* We should be done with options.. */
406 verify_all_options();
407
408 if( g.argc!=4 ){
409 usage("VERSION OUTPUTFILE");
410
--- www/changes.wiki
+++ www/changes.wiki
@@ -11,10 +11,11 @@
1111
or HTML.
1212
* Formally translate TH1 to Tcl return codes and vice-versa, where
1313
necessary, in the Tcl integration subsystem.
1414
* Better fork detection on [/help?cmd=import|fossil update],
1515
[/help?cmd=import|fossil status] and related commands.
16
+ * Add [/help?cmd=forks|fossil forks], for finding all forks.
1617
1718
<h2>Changes for Version 1.32 (2015-03-14)</h2>
1819
* When creating a new repository using [/help?cmd=init|fossil init], ensure
1920
that the new repository is fully compatible with historical versions of
2021
Fossil by having a valid manifest as RID 1.
2122
--- www/changes.wiki
+++ www/changes.wiki
@@ -11,10 +11,11 @@
11 or HTML.
12 * Formally translate TH1 to Tcl return codes and vice-versa, where
13 necessary, in the Tcl integration subsystem.
14 * Better fork detection on [/help?cmd=import|fossil update],
15 [/help?cmd=import|fossil status] and related commands.
 
16
17 <h2>Changes for Version 1.32 (2015-03-14)</h2>
18 * When creating a new repository using [/help?cmd=init|fossil init], ensure
19 that the new repository is fully compatible with historical versions of
20 Fossil by having a valid manifest as RID 1.
21
--- www/changes.wiki
+++ www/changes.wiki
@@ -11,10 +11,11 @@
11 or HTML.
12 * Formally translate TH1 to Tcl return codes and vice-versa, where
13 necessary, in the Tcl integration subsystem.
14 * Better fork detection on [/help?cmd=import|fossil update],
15 [/help?cmd=import|fossil status] and related commands.
16 * Add [/help?cmd=forks|fossil forks], for finding all forks.
17
18 <h2>Changes for Version 1.32 (2015-03-14)</h2>
19 * When creating a new repository using [/help?cmd=init|fossil init], ensure
20 that the new repository is fully compatible with historical versions of
21 Fossil by having a valid manifest as RID 1.
22

Keyboard Shortcuts

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