Fossil SCM

merge trunk

jan.nijtmans 2015-04-29 09:17 sync-forkwarn merge
Commit 97ab502fca28a80e359efd119e7cde0a03e23f03
+44 -31
--- src/checkin.c
+++ src/checkin.c
@@ -65,11 +65,12 @@
6565
6666
db_prepare(&q,
6767
"SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
6868
" FROM vfile "
6969
" WHERE is_selected(id) %s"
70
- " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1 /*scan*/",
70
+ " AND (chnged OR deleted OR rid=0 OR pathname!=origname)"
71
+ " ORDER BY 1 /*scan*/",
7172
blob_sql_text(&where)
7273
);
7374
blob_zero(&rewrittenPathname);
7475
while( db_step(&q)==SQLITE_ROW ){
7576
const char *zPathname = db_column_text(&q,0);
@@ -616,30 +617,29 @@
616617
db_finalize(&q);
617618
}
618619
619620
/*
620621
** COMMAND: clean
621
-** Usage: %fossil clean ?OPTIONS? ?PATH1 ...?
622
+** Usage: %fossil clean ?OPTIONS? ?PATH ...?
622623
**
623624
** Delete all "extra" files in the source tree. "Extra" files are
624625
** files that are not officially part of the checkout. This operation
625
-** cannot be undone. If paths are specified, only the directories or
626
-** files specified will be considered for cleaning.
627
-**
628
-** You will be prompted before removing each eligible file unless the
629
-** --force flag is in use or it matches the --clean option. The
630
-** GLOBPATTERN specified by the "ignore-glob" setting is used if the
631
-** --ignore option is omitted, the same with "clean-glob" and --clean
632
-** as well as "keep-glob" and --keep. If you are sure you wish to
633
-** remove all "extra" files except the ones specified with --ignore
634
-** and --keep, you can specify the optional -f|--force flag and no
635
-** prompts will be issued. If a file matches both --keep and --clean,
636
-** --keep takes precedence.
637
-**
638
-** Files and subdirectories whose names begin with "." are
639
-** normally kept. They are handled if the "--dotfiles" option
640
-** is used.
626
+** cannot be undone. If one or more PATH arguments appear, then only
627
+** the files named, or files contained with directories named, will be
628
+** removed.
629
+**
630
+** Prompted are issued to confirm the removal of each file, unless
631
+** the --force or --verily flag is used or unless the file matches
632
+** glob pattern specified by the --clean option. No file that matches
633
+** glob patterns specified by --ignore or --keep will ever be deleted.
634
+** The default values for --clean, --ignore, and --keep are determined
635
+** by the (versionable) clean-glob, ignore-glob, and keep-glob settings.
636
+** Files and subdirectories whose names begin with "." are automatically
637
+** ignored unless the --dotfiles option is used.
638
+**
639
+** The --verily option overrides all other options and settings and
640
+** deletes all unmanaged files and empty directories without prompting.
641641
**
642642
** Options:
643643
** --allckouts Check for empty directories within any checkouts
644644
** that may be nested within the current one. This
645645
** option should be used with great care because the
@@ -657,11 +657,13 @@
657657
** argument. Matching files, if any, are removed
658658
** prior to checking for any empty directories;
659659
** therefore, directories that contain only files
660660
** that were removed will be removed as well.
661661
** -f|--force Remove files without prompting.
662
-** --verily Shorthand for: -f --emptydirs --dotfiles
662
+** -x|--verily Remove everything that is not a managed file or
663
+** the repository itself. Implies -f --emptydirs
664
+** --dotfiles --ignore '' --keep ''.
663665
** --clean <CSG> Never prompt for files matching this
664666
** comma separated list of glob patterns.
665667
** --ignore <CSG> Ignore files matching patterns from the
666668
** comma separated list of glob patterns.
667669
** --keep <CSG> Keep files matching this comma separated
@@ -674,10 +676,11 @@
674676
*/
675677
void clean_cmd(void){
676678
int allFileFlag, allDirFlag, dryRunFlag, verboseFlag;
677679
int emptyDirsFlag, dirsOnlyFlag;
678680
unsigned scanFlags = 0;
681
+ int verilyFlag = 0;
679682
const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
680683
Glob *pIgnore, *pKeep, *pClean;
681684
int nRoot;
682685
683686
dryRunFlag = find_option("dry-run","n",0)!=0;
@@ -696,22 +699,25 @@
696699
zIgnoreFlag = find_option("ignore",0,1);
697700
verboseFlag = find_option("verbose","v",0)!=0;
698701
zKeepFlag = find_option("keep",0,1);
699702
zCleanFlag = find_option("clean",0,1);
700703
db_must_be_within_tree();
701
- if( find_option("verily",0,0)!=0 ){
702
- allFileFlag = allDirFlag = 1;
704
+ if( find_option("verily","x",0)!=0 ){
705
+ verilyFlag = allFileFlag = allDirFlag = 1;
703706
emptyDirsFlag = 1;
704707
scanFlags |= SCAN_ALL;
708
+ zKeepFlag = 0;
709
+ zIgnoreFlag = 0;
710
+ zCleanFlag = 0;
705711
}
706
- if( zIgnoreFlag==0 ){
712
+ if( zIgnoreFlag==0 && !verilyFlag ){
707713
zIgnoreFlag = db_get("ignore-glob", 0);
708714
}
709
- if( zKeepFlag==0 ){
715
+ if( zKeepFlag==0 && !verilyFlag ){
710716
zKeepFlag = db_get("keep-glob", 0);
711717
}
712
- if( zCleanFlag==0 ){
718
+ if( zCleanFlag==0 && !verilyFlag ){
713719
zCleanFlag = db_get("clean-glob", 0);
714720
}
715721
if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL;
716722
verify_all_options();
717723
pIgnore = glob_create(zIgnoreFlag);
@@ -950,14 +956,16 @@
950956
#else
951957
blob_init(&prompt, zInit, -1);
952958
#endif
953959
blob_append(&prompt,
954960
"\n"
955
- "# Enter a commit message for this check-in. Lines beginning with # are ignored.\n"
961
+ "# Enter a commit message for this check-in."
962
+ " Lines beginning with # are ignored.\n"
956963
"#\n", -1
957964
);
958
- blob_appendf(&prompt, "# user: %s\n", p->zUserOvrd ? p->zUserOvrd : login_name());
965
+ blob_appendf(&prompt, "# user: %s\n",
966
+ p->zUserOvrd ? p->zUserOvrd : login_name());
959967
if( p->zBranch && p->zBranch[0] ){
960968
blob_appendf(&prompt, "# tags: %s\n#\n", p->zBranch);
961969
}else{
962970
char *zTags = info_tags_of_checkin(parent_rid, 1);
963971
if( zTags || p->azTag ){
@@ -1042,11 +1050,12 @@
10421050
fossil_warning("fossil knows nothing about: %s", g.argv[ii]);
10431051
result = 1;
10441052
}
10451053
blob_reset(&fname);
10461054
}
1047
- g.aCommitFile = fossil_malloc( (bag_count(&toCommit)+1) * sizeof(g.aCommitFile[0]) );
1055
+ g.aCommitFile = fossil_malloc( (bag_count(&toCommit)+1) *
1056
+ sizeof(g.aCommitFile[0]) );
10481057
for(ii=bag_first(&toCommit); ii>0; ii=bag_next(&toCommit, ii)){
10491058
g.aCommitFile[jj++] = ii;
10501059
}
10511060
g.aCommitFile[jj] = 0;
10521061
bag_clear(&toCommit);
@@ -1270,11 +1279,13 @@
12701279
free(zParentUuid);
12711280
db_prepare(&q, "SELECT merge FROM vmerge WHERE id=0 OR id<-2");
12721281
while( db_step(&q)==SQLITE_ROW ){
12731282
char *zMergeUuid;
12741283
int mid = db_column_int(&q, 0);
1275
- if( (!g.markPrivate && content_is_private(mid)) || (mid == vid) ) continue;
1284
+ if( (!g.markPrivate && content_is_private(mid)) || (mid == vid) ){
1285
+ continue;
1286
+ }
12761287
zMergeUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid);
12771288
if( zMergeUuid ){
12781289
blob_appendf(pOut, " %s", zMergeUuid);
12791290
if( p->verifyDate ) checkin_verify_younger(mid, zMergeUuid, zDate);
12801291
free(zMergeUuid);
@@ -1381,11 +1392,11 @@
13811392
int fBinary; /* does the blob content appear to be binary? */
13821393
int lookFlags; /* output flags from looks_like_utf8/utf16() */
13831394
int fHasAnyCr; /* the blob contains one or more CR chars */
13841395
int fHasLoneCrOnly; /* all detected line endings are CR only */
13851396
int fHasCrLfOnly; /* all detected line endings are CR/LF pairs */
1386
- int fHasInvalidUtf8 = 0;/* contains byte-sequence which is invalid for UTF-8 */
1397
+ int fHasInvalidUtf8 = 0;/* contains invalid UTF-8 */
13871398
char *zMsg; /* Warning message */
13881399
Blob fname; /* Relative pathname of the file */
13891400
static int allOk = 0; /* Set to true to disable this routine */
13901401
13911402
if( allOk ) return 0;
@@ -1460,11 +1471,12 @@
14601471
zWarning = "Unicode";
14611472
zDisable = "\"encoding-glob\" setting";
14621473
}
14631474
file_relative_name(zFilename, &fname, 0);
14641475
zMsg = mprintf(
1465
- "%s contains %s. Use --no-warnings or the %s to disable this warning.\n"
1476
+ "%s contains %s. Use --no-warnings or the %s to"
1477
+ " disable this warning.\n"
14661478
"Commit anyhow (a=all/%sy/N)? ",
14671479
blob_str(&fname), zWarning, zDisable, zConvert);
14681480
prompt_user(zMsg, &ans);
14691481
fossil_free(zMsg);
14701482
cReply = blob_str(&ans)[0];
@@ -1660,11 +1672,12 @@
16601672
sCiInfo.closeFlag = find_option("close",0,0)!=0;
16611673
sCiInfo.integrateFlag = find_option("integrate",0,0)!=0;
16621674
sCiInfo.zMimetype = find_option("mimetype",0,1);
16631675
while( (zTag = find_option("tag",0,1))!=0 ){
16641676
if( zTag[0]==0 ) continue;
1665
- sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag, sizeof(char*)*(nTag+2));
1677
+ sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag,
1678
+ sizeof(char*)*(nTag+2));
16661679
sCiInfo.azTag[nTag++] = zTag;
16671680
sCiInfo.azTag[nTag] = 0;
16681681
}
16691682
zComFile = find_option("message-file", "M", 1);
16701683
if( find_option("private",0,0) ){
16711684
--- src/checkin.c
+++ src/checkin.c
@@ -65,11 +65,12 @@
65
66 db_prepare(&q,
67 "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
68 " FROM vfile "
69 " WHERE is_selected(id) %s"
70 " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1 /*scan*/",
 
71 blob_sql_text(&where)
72 );
73 blob_zero(&rewrittenPathname);
74 while( db_step(&q)==SQLITE_ROW ){
75 const char *zPathname = db_column_text(&q,0);
@@ -616,30 +617,29 @@
616 db_finalize(&q);
617 }
618
619 /*
620 ** COMMAND: clean
621 ** Usage: %fossil clean ?OPTIONS? ?PATH1 ...?
622 **
623 ** Delete all "extra" files in the source tree. "Extra" files are
624 ** files that are not officially part of the checkout. This operation
625 ** cannot be undone. If paths are specified, only the directories or
626 ** files specified will be considered for cleaning.
627 **
628 ** You will be prompted before removing each eligible file unless the
629 ** --force flag is in use or it matches the --clean option. The
630 ** GLOBPATTERN specified by the "ignore-glob" setting is used if the
631 ** --ignore option is omitted, the same with "clean-glob" and --clean
632 ** as well as "keep-glob" and --keep. If you are sure you wish to
633 ** remove all "extra" files except the ones specified with --ignore
634 ** and --keep, you can specify the optional -f|--force flag and no
635 ** prompts will be issued. If a file matches both --keep and --clean,
636 ** --keep takes precedence.
637 **
638 ** Files and subdirectories whose names begin with "." are
639 ** normally kept. They are handled if the "--dotfiles" option
640 ** is used.
641 **
642 ** Options:
643 ** --allckouts Check for empty directories within any checkouts
644 ** that may be nested within the current one. This
645 ** option should be used with great care because the
@@ -657,11 +657,13 @@
657 ** argument. Matching files, if any, are removed
658 ** prior to checking for any empty directories;
659 ** therefore, directories that contain only files
660 ** that were removed will be removed as well.
661 ** -f|--force Remove files without prompting.
662 ** --verily Shorthand for: -f --emptydirs --dotfiles
 
 
663 ** --clean <CSG> Never prompt for files matching this
664 ** comma separated list of glob patterns.
665 ** --ignore <CSG> Ignore files matching patterns from the
666 ** comma separated list of glob patterns.
667 ** --keep <CSG> Keep files matching this comma separated
@@ -674,10 +676,11 @@
674 */
675 void clean_cmd(void){
676 int allFileFlag, allDirFlag, dryRunFlag, verboseFlag;
677 int emptyDirsFlag, dirsOnlyFlag;
678 unsigned scanFlags = 0;
 
679 const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
680 Glob *pIgnore, *pKeep, *pClean;
681 int nRoot;
682
683 dryRunFlag = find_option("dry-run","n",0)!=0;
@@ -696,22 +699,25 @@
696 zIgnoreFlag = find_option("ignore",0,1);
697 verboseFlag = find_option("verbose","v",0)!=0;
698 zKeepFlag = find_option("keep",0,1);
699 zCleanFlag = find_option("clean",0,1);
700 db_must_be_within_tree();
701 if( find_option("verily",0,0)!=0 ){
702 allFileFlag = allDirFlag = 1;
703 emptyDirsFlag = 1;
704 scanFlags |= SCAN_ALL;
 
 
 
705 }
706 if( zIgnoreFlag==0 ){
707 zIgnoreFlag = db_get("ignore-glob", 0);
708 }
709 if( zKeepFlag==0 ){
710 zKeepFlag = db_get("keep-glob", 0);
711 }
712 if( zCleanFlag==0 ){
713 zCleanFlag = db_get("clean-glob", 0);
714 }
715 if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL;
716 verify_all_options();
717 pIgnore = glob_create(zIgnoreFlag);
@@ -950,14 +956,16 @@
950 #else
951 blob_init(&prompt, zInit, -1);
952 #endif
953 blob_append(&prompt,
954 "\n"
955 "# Enter a commit message for this check-in. Lines beginning with # are ignored.\n"
 
956 "#\n", -1
957 );
958 blob_appendf(&prompt, "# user: %s\n", p->zUserOvrd ? p->zUserOvrd : login_name());
 
959 if( p->zBranch && p->zBranch[0] ){
960 blob_appendf(&prompt, "# tags: %s\n#\n", p->zBranch);
961 }else{
962 char *zTags = info_tags_of_checkin(parent_rid, 1);
963 if( zTags || p->azTag ){
@@ -1042,11 +1050,12 @@
1042 fossil_warning("fossil knows nothing about: %s", g.argv[ii]);
1043 result = 1;
1044 }
1045 blob_reset(&fname);
1046 }
1047 g.aCommitFile = fossil_malloc( (bag_count(&toCommit)+1) * sizeof(g.aCommitFile[0]) );
 
1048 for(ii=bag_first(&toCommit); ii>0; ii=bag_next(&toCommit, ii)){
1049 g.aCommitFile[jj++] = ii;
1050 }
1051 g.aCommitFile[jj] = 0;
1052 bag_clear(&toCommit);
@@ -1270,11 +1279,13 @@
1270 free(zParentUuid);
1271 db_prepare(&q, "SELECT merge FROM vmerge WHERE id=0 OR id<-2");
1272 while( db_step(&q)==SQLITE_ROW ){
1273 char *zMergeUuid;
1274 int mid = db_column_int(&q, 0);
1275 if( (!g.markPrivate && content_is_private(mid)) || (mid == vid) ) continue;
 
 
1276 zMergeUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid);
1277 if( zMergeUuid ){
1278 blob_appendf(pOut, " %s", zMergeUuid);
1279 if( p->verifyDate ) checkin_verify_younger(mid, zMergeUuid, zDate);
1280 free(zMergeUuid);
@@ -1381,11 +1392,11 @@
1381 int fBinary; /* does the blob content appear to be binary? */
1382 int lookFlags; /* output flags from looks_like_utf8/utf16() */
1383 int fHasAnyCr; /* the blob contains one or more CR chars */
1384 int fHasLoneCrOnly; /* all detected line endings are CR only */
1385 int fHasCrLfOnly; /* all detected line endings are CR/LF pairs */
1386 int fHasInvalidUtf8 = 0;/* contains byte-sequence which is invalid for UTF-8 */
1387 char *zMsg; /* Warning message */
1388 Blob fname; /* Relative pathname of the file */
1389 static int allOk = 0; /* Set to true to disable this routine */
1390
1391 if( allOk ) return 0;
@@ -1460,11 +1471,12 @@
1460 zWarning = "Unicode";
1461 zDisable = "\"encoding-glob\" setting";
1462 }
1463 file_relative_name(zFilename, &fname, 0);
1464 zMsg = mprintf(
1465 "%s contains %s. Use --no-warnings or the %s to disable this warning.\n"
 
1466 "Commit anyhow (a=all/%sy/N)? ",
1467 blob_str(&fname), zWarning, zDisable, zConvert);
1468 prompt_user(zMsg, &ans);
1469 fossil_free(zMsg);
1470 cReply = blob_str(&ans)[0];
@@ -1660,11 +1672,12 @@
1660 sCiInfo.closeFlag = find_option("close",0,0)!=0;
1661 sCiInfo.integrateFlag = find_option("integrate",0,0)!=0;
1662 sCiInfo.zMimetype = find_option("mimetype",0,1);
1663 while( (zTag = find_option("tag",0,1))!=0 ){
1664 if( zTag[0]==0 ) continue;
1665 sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag, sizeof(char*)*(nTag+2));
 
1666 sCiInfo.azTag[nTag++] = zTag;
1667 sCiInfo.azTag[nTag] = 0;
1668 }
1669 zComFile = find_option("message-file", "M", 1);
1670 if( find_option("private",0,0) ){
1671
--- src/checkin.c
+++ src/checkin.c
@@ -65,11 +65,12 @@
65
66 db_prepare(&q,
67 "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
68 " FROM vfile "
69 " WHERE is_selected(id) %s"
70 " AND (chnged OR deleted OR rid=0 OR pathname!=origname)"
71 " ORDER BY 1 /*scan*/",
72 blob_sql_text(&where)
73 );
74 blob_zero(&rewrittenPathname);
75 while( db_step(&q)==SQLITE_ROW ){
76 const char *zPathname = db_column_text(&q,0);
@@ -616,30 +617,29 @@
617 db_finalize(&q);
618 }
619
620 /*
621 ** COMMAND: clean
622 ** Usage: %fossil clean ?OPTIONS? ?PATH ...?
623 **
624 ** Delete all "extra" files in the source tree. "Extra" files are
625 ** files that are not officially part of the checkout. This operation
626 ** cannot be undone. If one or more PATH arguments appear, then only
627 ** the files named, or files contained with directories named, will be
628 ** removed.
629 **
630 ** Prompted are issued to confirm the removal of each file, unless
631 ** the --force or --verily flag is used or unless the file matches
632 ** glob pattern specified by the --clean option. No file that matches
633 ** glob patterns specified by --ignore or --keep will ever be deleted.
634 ** The default values for --clean, --ignore, and --keep are determined
635 ** by the (versionable) clean-glob, ignore-glob, and keep-glob settings.
636 ** Files and subdirectories whose names begin with "." are automatically
637 ** ignored unless the --dotfiles option is used.
638 **
639 ** The --verily option overrides all other options and settings and
640 ** deletes all unmanaged files and empty directories without prompting.
 
641 **
642 ** Options:
643 ** --allckouts Check for empty directories within any checkouts
644 ** that may be nested within the current one. This
645 ** option should be used with great care because the
@@ -657,11 +657,13 @@
657 ** argument. Matching files, if any, are removed
658 ** prior to checking for any empty directories;
659 ** therefore, directories that contain only files
660 ** that were removed will be removed as well.
661 ** -f|--force Remove files without prompting.
662 ** -x|--verily Remove everything that is not a managed file or
663 ** the repository itself. Implies -f --emptydirs
664 ** --dotfiles --ignore '' --keep ''.
665 ** --clean <CSG> Never prompt for files matching this
666 ** comma separated list of glob patterns.
667 ** --ignore <CSG> Ignore files matching patterns from the
668 ** comma separated list of glob patterns.
669 ** --keep <CSG> Keep files matching this comma separated
@@ -674,10 +676,11 @@
676 */
677 void clean_cmd(void){
678 int allFileFlag, allDirFlag, dryRunFlag, verboseFlag;
679 int emptyDirsFlag, dirsOnlyFlag;
680 unsigned scanFlags = 0;
681 int verilyFlag = 0;
682 const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
683 Glob *pIgnore, *pKeep, *pClean;
684 int nRoot;
685
686 dryRunFlag = find_option("dry-run","n",0)!=0;
@@ -696,22 +699,25 @@
699 zIgnoreFlag = find_option("ignore",0,1);
700 verboseFlag = find_option("verbose","v",0)!=0;
701 zKeepFlag = find_option("keep",0,1);
702 zCleanFlag = find_option("clean",0,1);
703 db_must_be_within_tree();
704 if( find_option("verily","x",0)!=0 ){
705 verilyFlag = allFileFlag = allDirFlag = 1;
706 emptyDirsFlag = 1;
707 scanFlags |= SCAN_ALL;
708 zKeepFlag = 0;
709 zIgnoreFlag = 0;
710 zCleanFlag = 0;
711 }
712 if( zIgnoreFlag==0 && !verilyFlag ){
713 zIgnoreFlag = db_get("ignore-glob", 0);
714 }
715 if( zKeepFlag==0 && !verilyFlag ){
716 zKeepFlag = db_get("keep-glob", 0);
717 }
718 if( zCleanFlag==0 && !verilyFlag ){
719 zCleanFlag = db_get("clean-glob", 0);
720 }
721 if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL;
722 verify_all_options();
723 pIgnore = glob_create(zIgnoreFlag);
@@ -950,14 +956,16 @@
956 #else
957 blob_init(&prompt, zInit, -1);
958 #endif
959 blob_append(&prompt,
960 "\n"
961 "# Enter a commit message for this check-in."
962 " Lines beginning with # are ignored.\n"
963 "#\n", -1
964 );
965 blob_appendf(&prompt, "# user: %s\n",
966 p->zUserOvrd ? p->zUserOvrd : login_name());
967 if( p->zBranch && p->zBranch[0] ){
968 blob_appendf(&prompt, "# tags: %s\n#\n", p->zBranch);
969 }else{
970 char *zTags = info_tags_of_checkin(parent_rid, 1);
971 if( zTags || p->azTag ){
@@ -1042,11 +1050,12 @@
1050 fossil_warning("fossil knows nothing about: %s", g.argv[ii]);
1051 result = 1;
1052 }
1053 blob_reset(&fname);
1054 }
1055 g.aCommitFile = fossil_malloc( (bag_count(&toCommit)+1) *
1056 sizeof(g.aCommitFile[0]) );
1057 for(ii=bag_first(&toCommit); ii>0; ii=bag_next(&toCommit, ii)){
1058 g.aCommitFile[jj++] = ii;
1059 }
1060 g.aCommitFile[jj] = 0;
1061 bag_clear(&toCommit);
@@ -1270,11 +1279,13 @@
1279 free(zParentUuid);
1280 db_prepare(&q, "SELECT merge FROM vmerge WHERE id=0 OR id<-2");
1281 while( db_step(&q)==SQLITE_ROW ){
1282 char *zMergeUuid;
1283 int mid = db_column_int(&q, 0);
1284 if( (!g.markPrivate && content_is_private(mid)) || (mid == vid) ){
1285 continue;
1286 }
1287 zMergeUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid);
1288 if( zMergeUuid ){
1289 blob_appendf(pOut, " %s", zMergeUuid);
1290 if( p->verifyDate ) checkin_verify_younger(mid, zMergeUuid, zDate);
1291 free(zMergeUuid);
@@ -1381,11 +1392,11 @@
1392 int fBinary; /* does the blob content appear to be binary? */
1393 int lookFlags; /* output flags from looks_like_utf8/utf16() */
1394 int fHasAnyCr; /* the blob contains one or more CR chars */
1395 int fHasLoneCrOnly; /* all detected line endings are CR only */
1396 int fHasCrLfOnly; /* all detected line endings are CR/LF pairs */
1397 int fHasInvalidUtf8 = 0;/* contains invalid UTF-8 */
1398 char *zMsg; /* Warning message */
1399 Blob fname; /* Relative pathname of the file */
1400 static int allOk = 0; /* Set to true to disable this routine */
1401
1402 if( allOk ) return 0;
@@ -1460,11 +1471,12 @@
1471 zWarning = "Unicode";
1472 zDisable = "\"encoding-glob\" setting";
1473 }
1474 file_relative_name(zFilename, &fname, 0);
1475 zMsg = mprintf(
1476 "%s contains %s. Use --no-warnings or the %s to"
1477 " disable this warning.\n"
1478 "Commit anyhow (a=all/%sy/N)? ",
1479 blob_str(&fname), zWarning, zDisable, zConvert);
1480 prompt_user(zMsg, &ans);
1481 fossil_free(zMsg);
1482 cReply = blob_str(&ans)[0];
@@ -1660,11 +1672,12 @@
1672 sCiInfo.closeFlag = find_option("close",0,0)!=0;
1673 sCiInfo.integrateFlag = find_option("integrate",0,0)!=0;
1674 sCiInfo.zMimetype = find_option("mimetype",0,1);
1675 while( (zTag = find_option("tag",0,1))!=0 ){
1676 if( zTag[0]==0 ) continue;
1677 sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag,
1678 sizeof(char*)*(nTag+2));
1679 sCiInfo.azTag[nTag++] = zTag;
1680 sCiInfo.azTag[nTag] = 0;
1681 }
1682 zComFile = find_option("message-file", "M", 1);
1683 if( find_option("private",0,0) ){
1684
+1
--- src/main.c
+++ src/main.c
@@ -656,10 +656,11 @@
656656
"in conjunction with any other flags.\n");
657657
fossil_exit(1);
658658
}else{
659659
const char *zChdir = find_option("chdir",0,1);
660660
g.isHTTP = 0;
661
+ g.rcvid = 0;
661662
g.fQuiet = find_option("quiet", 0, 0)!=0;
662663
g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
663664
g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
664665
g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
665666
g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
666667
--- src/main.c
+++ src/main.c
@@ -656,10 +656,11 @@
656 "in conjunction with any other flags.\n");
657 fossil_exit(1);
658 }else{
659 const char *zChdir = find_option("chdir",0,1);
660 g.isHTTP = 0;
 
661 g.fQuiet = find_option("quiet", 0, 0)!=0;
662 g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
663 g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
664 g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
665 g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
666
--- src/main.c
+++ src/main.c
@@ -656,10 +656,11 @@
656 "in conjunction with any other flags.\n");
657 fossil_exit(1);
658 }else{
659 const char *zChdir = find_option("chdir",0,1);
660 g.isHTTP = 0;
661 g.rcvid = 0;
662 g.fQuiet = find_option("quiet", 0, 0)!=0;
663 g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
664 g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
665 g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
666 g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
667
--- src/merge.c
+++ src/merge.c
@@ -107,10 +107,11 @@
107107
*/
108108
int fossil_any_has_fork(int rcvid){
109109
static Stmt q;
110110
int fForkSeen = 0;
111111
112
+ if( rcvid==0 ) return 0;
112113
db_static_prepare(&q,
113114
" SELECT pid FROM plink WHERE pid>0 AND isprim"
114115
" AND cid IN (SELECT blob.rid FROM blob"
115116
" WHERE rcvid=:rcvid)");
116117
db_bind_int(&q, ":rcvid", rcvid);
117118
--- src/merge.c
+++ src/merge.c
@@ -107,10 +107,11 @@
107 */
108 int fossil_any_has_fork(int rcvid){
109 static Stmt q;
110 int fForkSeen = 0;
111
 
112 db_static_prepare(&q,
113 " SELECT pid FROM plink WHERE pid>0 AND isprim"
114 " AND cid IN (SELECT blob.rid FROM blob"
115 " WHERE rcvid=:rcvid)");
116 db_bind_int(&q, ":rcvid", rcvid);
117
--- src/merge.c
+++ src/merge.c
@@ -107,10 +107,11 @@
107 */
108 int fossil_any_has_fork(int rcvid){
109 static Stmt q;
110 int fForkSeen = 0;
111
112 if( rcvid==0 ) return 0;
113 db_static_prepare(&q,
114 " SELECT pid FROM plink WHERE pid>0 AND isprim"
115 " AND cid IN (SELECT blob.rid FROM blob"
116 " WHERE rcvid=:rcvid)");
117 db_bind_int(&q, ":rcvid", rcvid);
118
+52 -52
--- src/shell.c
+++ src/shell.c
@@ -334,11 +334,11 @@
334334
/*
335335
** The following is the open SQLite database. We make a pointer
336336
** to this database a static variable so that it can be accessed
337337
** by the SIGINT handler to interrupt database processing.
338338
*/
339
-static sqlite3 *db = 0;
339
+static sqlite3 *globalDb = 0;
340340
341341
/*
342342
** True if an interrupt (Control-C) has been received.
343343
*/
344344
static volatile int seenInterrupt = 0;
@@ -803,11 +803,11 @@
803803
*/
804804
static void interrupt_handler(int NotUsed){
805805
UNUSED_PARAMETER(NotUsed);
806806
seenInterrupt++;
807807
if( seenInterrupt>2 ) exit(1);
808
- if( db ) sqlite3_interrupt(db);
808
+ if( globalDb ) sqlite3_interrupt(globalDb);
809809
}
810810
#endif
811811
812812
/*
813813
** This is the callback routine that the shell
@@ -1907,27 +1907,27 @@
19071907
*/
19081908
static void open_db(ShellState *p, int keepAlive){
19091909
if( p->db==0 ){
19101910
sqlite3_initialize();
19111911
sqlite3_open(p->zDbFilename, &p->db);
1912
- db = p->db;
1913
- if( db && sqlite3_errcode(db)==SQLITE_OK ){
1914
- sqlite3_create_function(db, "shellstatic", 0, SQLITE_UTF8, 0,
1912
+ globalDb = p->db;
1913
+ if( p->db && sqlite3_errcode(p->db)==SQLITE_OK ){
1914
+ sqlite3_create_function(p->db, "shellstatic", 0, SQLITE_UTF8, 0,
19151915
shellstaticFunc, 0, 0);
19161916
}
1917
- if( db==0 || SQLITE_OK!=sqlite3_errcode(db) ){
1917
+ if( p->db==0 || SQLITE_OK!=sqlite3_errcode(p->db) ){
19181918
fprintf(stderr,"Error: unable to open database \"%s\": %s\n",
1919
- p->zDbFilename, sqlite3_errmsg(db));
1919
+ p->zDbFilename, sqlite3_errmsg(p->db));
19201920
if( keepAlive ) return;
19211921
exit(1);
19221922
}
19231923
#ifndef SQLITE_OMIT_LOAD_EXTENSION
19241924
sqlite3_enable_load_extension(p->db, 1);
19251925
#endif
1926
- sqlite3_create_function(db, "readfile", 1, SQLITE_UTF8, 0,
1926
+ sqlite3_create_function(p->db, "readfile", 1, SQLITE_UTF8, 0,
19271927
readfileFunc, 0, 0);
1928
- sqlite3_create_function(db, "writefile", 2, SQLITE_UTF8, 0,
1928
+ sqlite3_create_function(p->db, "writefile", 2, SQLITE_UTF8, 0,
19291929
writefileFunc, 0, 0);
19301930
}
19311931
}
19321932
19331933
/*
@@ -2584,36 +2584,36 @@
25842584
** process that line.
25852585
**
25862586
** Return 1 on error, 2 to exit, and 0 otherwise.
25872587
*/
25882588
static int do_meta_command(char *zLine, ShellState *p){
2589
- int i = 1;
2589
+ int h = 1;
25902590
int nArg = 0;
25912591
int n, c;
25922592
int rc = 0;
25932593
char *azArg[50];
25942594
25952595
/* Parse the input line into tokens.
25962596
*/
2597
- while( zLine[i] && nArg<ArraySize(azArg) ){
2598
- while( IsSpace(zLine[i]) ){ i++; }
2599
- if( zLine[i]==0 ) break;
2600
- if( zLine[i]=='\'' || zLine[i]=='"' ){
2601
- int delim = zLine[i++];
2602
- azArg[nArg++] = &zLine[i];
2603
- while( zLine[i] && zLine[i]!=delim ){
2604
- if( zLine[i]=='\\' && delim=='"' && zLine[i+1]!=0 ) i++;
2605
- i++;
2606
- }
2607
- if( zLine[i]==delim ){
2608
- zLine[i++] = 0;
2597
+ while( zLine[h] && nArg<ArraySize(azArg) ){
2598
+ while( IsSpace(zLine[h]) ){ h++; }
2599
+ if( zLine[h]==0 ) break;
2600
+ if( zLine[h]=='\'' || zLine[h]=='"' ){
2601
+ int delim = zLine[h++];
2602
+ azArg[nArg++] = &zLine[h];
2603
+ while( zLine[h] && zLine[h]!=delim ){
2604
+ if( zLine[h]=='\\' && delim=='"' && zLine[h+1]!=0 ) h++;
2605
+ h++;
2606
+ }
2607
+ if( zLine[h]==delim ){
2608
+ zLine[h++] = 0;
26092609
}
26102610
if( delim=='"' ) resolve_backslashes(azArg[nArg-1]);
26112611
}else{
2612
- azArg[nArg++] = &zLine[i];
2613
- while( zLine[i] && !IsSpace(zLine[i]) ){ i++; }
2614
- if( zLine[i] ) zLine[i++] = 0;
2612
+ azArg[nArg++] = &zLine[h];
2613
+ while( zLine[h] && !IsSpace(zLine[h]) ){ h++; }
2614
+ if( zLine[h] ) zLine[h++] = 0;
26152615
resolve_backslashes(azArg[nArg-1]);
26162616
}
26172617
}
26182618
26192619
/* Process the input line.
@@ -2985,11 +2985,11 @@
29852985
return 1;
29862986
}
29872987
nByte = strlen30(zSql);
29882988
rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
29892989
import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */
2990
- if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(db))==0 ){
2990
+ if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(p->db))==0 ){
29912991
char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable);
29922992
char cSep = '(';
29932993
while( xRead(&sCtx) ){
29942994
zCreate = sqlite3_mprintf("%z%c\n \"%s\" TEXT", zCreate, cSep, sCtx.z);
29952995
cSep = ',';
@@ -3005,21 +3005,21 @@
30053005
zCreate = sqlite3_mprintf("%z\n)", zCreate);
30063006
rc = sqlite3_exec(p->db, zCreate, 0, 0, 0);
30073007
sqlite3_free(zCreate);
30083008
if( rc ){
30093009
fprintf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable,
3010
- sqlite3_errmsg(db));
3010
+ sqlite3_errmsg(p->db));
30113011
sqlite3_free(sCtx.z);
30123012
xCloser(sCtx.in);
30133013
return 1;
30143014
}
30153015
rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
30163016
}
30173017
sqlite3_free(zSql);
30183018
if( rc ){
30193019
if (pStmt) sqlite3_finalize(pStmt);
3020
- fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db));
3020
+ fprintf(stderr,"Error: %s\n", sqlite3_errmsg(p->db));
30213021
xCloser(sCtx.in);
30223022
return 1;
30233023
}
30243024
nCol = sqlite3_column_count(pStmt);
30253025
sqlite3_finalize(pStmt);
@@ -3040,17 +3040,17 @@
30403040
zSql[j++] = ')';
30413041
zSql[j] = 0;
30423042
rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
30433043
sqlite3_free(zSql);
30443044
if( rc ){
3045
- fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db));
3045
+ fprintf(stderr, "Error: %s\n", sqlite3_errmsg(p->db));
30463046
if (pStmt) sqlite3_finalize(pStmt);
30473047
xCloser(sCtx.in);
30483048
return 1;
30493049
}
3050
- needCommit = sqlite3_get_autocommit(db);
3051
- if( needCommit ) sqlite3_exec(db, "BEGIN", 0, 0, 0);
3050
+ needCommit = sqlite3_get_autocommit(p->db);
3051
+ if( needCommit ) sqlite3_exec(p->db, "BEGIN", 0, 0, 0);
30523052
do{
30533053
int startLine = sCtx.nLine;
30543054
for(i=0; i<nCol; i++){
30553055
char *z = xRead(&sCtx);
30563056
/*
@@ -3085,19 +3085,19 @@
30853085
if( i>=nCol ){
30863086
sqlite3_step(pStmt);
30873087
rc = sqlite3_reset(pStmt);
30883088
if( rc!=SQLITE_OK ){
30893089
fprintf(stderr, "%s:%d: INSERT failed: %s\n", sCtx.zFile, startLine,
3090
- sqlite3_errmsg(db));
3090
+ sqlite3_errmsg(p->db));
30913091
}
30923092
}
30933093
}while( sCtx.cTerm!=EOF );
30943094
30953095
xCloser(sCtx.in);
30963096
sqlite3_free(sCtx.z);
30973097
sqlite3_finalize(pStmt);
3098
- if( needCommit ) sqlite3_exec(db, "COMMIT", 0, 0, 0);
3098
+ if( needCommit ) sqlite3_exec(p->db, "COMMIT", 0, 0, 0);
30993099
}else
31003100
31013101
if( c=='i' && (strncmp(azArg[0], "indices", n)==0
31023102
|| strncmp(azArg[0], "indexes", n)==0) ){
31033103
ShellState data;
@@ -3647,17 +3647,17 @@
36473647
sqlite3_bind_text(pStmt, 1, "%", -1, SQLITE_STATIC);
36483648
}
36493649
while( sqlite3_step(pStmt)==SQLITE_ROW ){
36503650
if( nRow>=nAlloc ){
36513651
char **azNew;
3652
- int n = nAlloc*2 + 10;
3653
- azNew = sqlite3_realloc(azResult, sizeof(azResult[0])*n);
3652
+ int n2 = nAlloc*2 + 10;
3653
+ azNew = sqlite3_realloc(azResult, sizeof(azResult[0])*n2);
36543654
if( azNew==0 ){
36553655
fprintf(stderr, "Error: out of memory\n");
36563656
break;
36573657
}
3658
- nAlloc = n;
3658
+ nAlloc = n2;
36593659
azResult = azNew;
36603660
}
36613661
azResult[nRow] = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0));
36623662
if( azResult[nRow] ) nRow++;
36633663
}
@@ -3706,19 +3706,19 @@
37063706
{ "byteorder", SQLITE_TESTCTRL_BYTEORDER },
37073707
{ "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT },
37083708
{ "imposter", SQLITE_TESTCTRL_IMPOSTER },
37093709
};
37103710
int testctrl = -1;
3711
- int rc = 0;
3712
- int i, n;
3711
+ int rc2 = 0;
3712
+ int i, n2;
37133713
open_db(p, 0);
37143714
37153715
/* convert testctrl text option to value. allow any unique prefix
37163716
** of the option name, or a numerical value. */
3717
- n = strlen30(azArg[1]);
3717
+ n2 = strlen30(azArg[1]);
37183718
for(i=0; i<(int)(sizeof(aCtrl)/sizeof(aCtrl[0])); i++){
3719
- if( strncmp(azArg[1], aCtrl[i].zCtrlName, n)==0 ){
3719
+ if( strncmp(azArg[1], aCtrl[i].zCtrlName, n2)==0 ){
37203720
if( testctrl<0 ){
37213721
testctrl = aCtrl[i].ctrlCode;
37223722
}else{
37233723
fprintf(stderr, "ambiguous option name: \"%s\"\n", azArg[1]);
37243724
testctrl = -1;
@@ -3735,12 +3735,12 @@
37353735
/* sqlite3_test_control(int, db, int) */
37363736
case SQLITE_TESTCTRL_OPTIMIZATIONS:
37373737
case SQLITE_TESTCTRL_RESERVE:
37383738
if( nArg==3 ){
37393739
int opt = (int)strtol(azArg[2], 0, 0);
3740
- rc = sqlite3_test_control(testctrl, p->db, opt);
3741
- fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3740
+ rc2 = sqlite3_test_control(testctrl, p->db, opt);
3741
+ fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
37423742
} else {
37433743
fprintf(stderr,"Error: testctrl %s takes a single int option\n",
37443744
azArg[1]);
37453745
}
37463746
break;
@@ -3749,23 +3749,23 @@
37493749
case SQLITE_TESTCTRL_PRNG_SAVE:
37503750
case SQLITE_TESTCTRL_PRNG_RESTORE:
37513751
case SQLITE_TESTCTRL_PRNG_RESET:
37523752
case SQLITE_TESTCTRL_BYTEORDER:
37533753
if( nArg==2 ){
3754
- rc = sqlite3_test_control(testctrl);
3755
- fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3754
+ rc2 = sqlite3_test_control(testctrl);
3755
+ fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
37563756
} else {
37573757
fprintf(stderr,"Error: testctrl %s takes no options\n", azArg[1]);
37583758
}
37593759
break;
37603760
37613761
/* sqlite3_test_control(int, uint) */
37623762
case SQLITE_TESTCTRL_PENDING_BYTE:
37633763
if( nArg==3 ){
37643764
unsigned int opt = (unsigned int)integerValue(azArg[2]);
3765
- rc = sqlite3_test_control(testctrl, opt);
3766
- fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3765
+ rc2 = sqlite3_test_control(testctrl, opt);
3766
+ fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
37673767
} else {
37683768
fprintf(stderr,"Error: testctrl %s takes a single unsigned"
37693769
" int option\n", azArg[1]);
37703770
}
37713771
break;
@@ -3774,12 +3774,12 @@
37743774
case SQLITE_TESTCTRL_ASSERT:
37753775
case SQLITE_TESTCTRL_ALWAYS:
37763776
case SQLITE_TESTCTRL_NEVER_CORRUPT:
37773777
if( nArg==3 ){
37783778
int opt = booleanValue(azArg[2]);
3779
- rc = sqlite3_test_control(testctrl, opt);
3780
- fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3779
+ rc2 = sqlite3_test_control(testctrl, opt);
3780
+ fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
37813781
} else {
37823782
fprintf(stderr,"Error: testctrl %s takes a single int option\n",
37833783
azArg[1]);
37843784
}
37853785
break;
@@ -3787,26 +3787,26 @@
37873787
/* sqlite3_test_control(int, char *) */
37883788
#ifdef SQLITE_N_KEYWORD
37893789
case SQLITE_TESTCTRL_ISKEYWORD:
37903790
if( nArg==3 ){
37913791
const char *opt = azArg[2];
3792
- rc = sqlite3_test_control(testctrl, opt);
3793
- fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3792
+ rc2 = sqlite3_test_control(testctrl, opt);
3793
+ fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
37943794
} else {
37953795
fprintf(stderr,"Error: testctrl %s takes a single char * option\n",
37963796
azArg[1]);
37973797
}
37983798
break;
37993799
#endif
38003800
38013801
case SQLITE_TESTCTRL_IMPOSTER:
38023802
if( nArg==5 ){
3803
- rc = sqlite3_test_control(testctrl, p->db,
3803
+ rc2 = sqlite3_test_control(testctrl, p->db,
38043804
azArg[2],
38053805
integerValue(azArg[3]),
38063806
integerValue(azArg[4]));
3807
- fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3807
+ fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
38083808
}else{
38093809
fprintf(stderr,"Usage: .testctrl imposter dbName onoff tnum\n");
38103810
}
38113811
break;
38123812
38133813
--- src/shell.c
+++ src/shell.c
@@ -334,11 +334,11 @@
334 /*
335 ** The following is the open SQLite database. We make a pointer
336 ** to this database a static variable so that it can be accessed
337 ** by the SIGINT handler to interrupt database processing.
338 */
339 static sqlite3 *db = 0;
340
341 /*
342 ** True if an interrupt (Control-C) has been received.
343 */
344 static volatile int seenInterrupt = 0;
@@ -803,11 +803,11 @@
803 */
804 static void interrupt_handler(int NotUsed){
805 UNUSED_PARAMETER(NotUsed);
806 seenInterrupt++;
807 if( seenInterrupt>2 ) exit(1);
808 if( db ) sqlite3_interrupt(db);
809 }
810 #endif
811
812 /*
813 ** This is the callback routine that the shell
@@ -1907,27 +1907,27 @@
1907 */
1908 static void open_db(ShellState *p, int keepAlive){
1909 if( p->db==0 ){
1910 sqlite3_initialize();
1911 sqlite3_open(p->zDbFilename, &p->db);
1912 db = p->db;
1913 if( db && sqlite3_errcode(db)==SQLITE_OK ){
1914 sqlite3_create_function(db, "shellstatic", 0, SQLITE_UTF8, 0,
1915 shellstaticFunc, 0, 0);
1916 }
1917 if( db==0 || SQLITE_OK!=sqlite3_errcode(db) ){
1918 fprintf(stderr,"Error: unable to open database \"%s\": %s\n",
1919 p->zDbFilename, sqlite3_errmsg(db));
1920 if( keepAlive ) return;
1921 exit(1);
1922 }
1923 #ifndef SQLITE_OMIT_LOAD_EXTENSION
1924 sqlite3_enable_load_extension(p->db, 1);
1925 #endif
1926 sqlite3_create_function(db, "readfile", 1, SQLITE_UTF8, 0,
1927 readfileFunc, 0, 0);
1928 sqlite3_create_function(db, "writefile", 2, SQLITE_UTF8, 0,
1929 writefileFunc, 0, 0);
1930 }
1931 }
1932
1933 /*
@@ -2584,36 +2584,36 @@
2584 ** process that line.
2585 **
2586 ** Return 1 on error, 2 to exit, and 0 otherwise.
2587 */
2588 static int do_meta_command(char *zLine, ShellState *p){
2589 int i = 1;
2590 int nArg = 0;
2591 int n, c;
2592 int rc = 0;
2593 char *azArg[50];
2594
2595 /* Parse the input line into tokens.
2596 */
2597 while( zLine[i] && nArg<ArraySize(azArg) ){
2598 while( IsSpace(zLine[i]) ){ i++; }
2599 if( zLine[i]==0 ) break;
2600 if( zLine[i]=='\'' || zLine[i]=='"' ){
2601 int delim = zLine[i++];
2602 azArg[nArg++] = &zLine[i];
2603 while( zLine[i] && zLine[i]!=delim ){
2604 if( zLine[i]=='\\' && delim=='"' && zLine[i+1]!=0 ) i++;
2605 i++;
2606 }
2607 if( zLine[i]==delim ){
2608 zLine[i++] = 0;
2609 }
2610 if( delim=='"' ) resolve_backslashes(azArg[nArg-1]);
2611 }else{
2612 azArg[nArg++] = &zLine[i];
2613 while( zLine[i] && !IsSpace(zLine[i]) ){ i++; }
2614 if( zLine[i] ) zLine[i++] = 0;
2615 resolve_backslashes(azArg[nArg-1]);
2616 }
2617 }
2618
2619 /* Process the input line.
@@ -2985,11 +2985,11 @@
2985 return 1;
2986 }
2987 nByte = strlen30(zSql);
2988 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
2989 import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */
2990 if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(db))==0 ){
2991 char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable);
2992 char cSep = '(';
2993 while( xRead(&sCtx) ){
2994 zCreate = sqlite3_mprintf("%z%c\n \"%s\" TEXT", zCreate, cSep, sCtx.z);
2995 cSep = ',';
@@ -3005,21 +3005,21 @@
3005 zCreate = sqlite3_mprintf("%z\n)", zCreate);
3006 rc = sqlite3_exec(p->db, zCreate, 0, 0, 0);
3007 sqlite3_free(zCreate);
3008 if( rc ){
3009 fprintf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable,
3010 sqlite3_errmsg(db));
3011 sqlite3_free(sCtx.z);
3012 xCloser(sCtx.in);
3013 return 1;
3014 }
3015 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
3016 }
3017 sqlite3_free(zSql);
3018 if( rc ){
3019 if (pStmt) sqlite3_finalize(pStmt);
3020 fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db));
3021 xCloser(sCtx.in);
3022 return 1;
3023 }
3024 nCol = sqlite3_column_count(pStmt);
3025 sqlite3_finalize(pStmt);
@@ -3040,17 +3040,17 @@
3040 zSql[j++] = ')';
3041 zSql[j] = 0;
3042 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
3043 sqlite3_free(zSql);
3044 if( rc ){
3045 fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db));
3046 if (pStmt) sqlite3_finalize(pStmt);
3047 xCloser(sCtx.in);
3048 return 1;
3049 }
3050 needCommit = sqlite3_get_autocommit(db);
3051 if( needCommit ) sqlite3_exec(db, "BEGIN", 0, 0, 0);
3052 do{
3053 int startLine = sCtx.nLine;
3054 for(i=0; i<nCol; i++){
3055 char *z = xRead(&sCtx);
3056 /*
@@ -3085,19 +3085,19 @@
3085 if( i>=nCol ){
3086 sqlite3_step(pStmt);
3087 rc = sqlite3_reset(pStmt);
3088 if( rc!=SQLITE_OK ){
3089 fprintf(stderr, "%s:%d: INSERT failed: %s\n", sCtx.zFile, startLine,
3090 sqlite3_errmsg(db));
3091 }
3092 }
3093 }while( sCtx.cTerm!=EOF );
3094
3095 xCloser(sCtx.in);
3096 sqlite3_free(sCtx.z);
3097 sqlite3_finalize(pStmt);
3098 if( needCommit ) sqlite3_exec(db, "COMMIT", 0, 0, 0);
3099 }else
3100
3101 if( c=='i' && (strncmp(azArg[0], "indices", n)==0
3102 || strncmp(azArg[0], "indexes", n)==0) ){
3103 ShellState data;
@@ -3647,17 +3647,17 @@
3647 sqlite3_bind_text(pStmt, 1, "%", -1, SQLITE_STATIC);
3648 }
3649 while( sqlite3_step(pStmt)==SQLITE_ROW ){
3650 if( nRow>=nAlloc ){
3651 char **azNew;
3652 int n = nAlloc*2 + 10;
3653 azNew = sqlite3_realloc(azResult, sizeof(azResult[0])*n);
3654 if( azNew==0 ){
3655 fprintf(stderr, "Error: out of memory\n");
3656 break;
3657 }
3658 nAlloc = n;
3659 azResult = azNew;
3660 }
3661 azResult[nRow] = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0));
3662 if( azResult[nRow] ) nRow++;
3663 }
@@ -3706,19 +3706,19 @@
3706 { "byteorder", SQLITE_TESTCTRL_BYTEORDER },
3707 { "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT },
3708 { "imposter", SQLITE_TESTCTRL_IMPOSTER },
3709 };
3710 int testctrl = -1;
3711 int rc = 0;
3712 int i, n;
3713 open_db(p, 0);
3714
3715 /* convert testctrl text option to value. allow any unique prefix
3716 ** of the option name, or a numerical value. */
3717 n = strlen30(azArg[1]);
3718 for(i=0; i<(int)(sizeof(aCtrl)/sizeof(aCtrl[0])); i++){
3719 if( strncmp(azArg[1], aCtrl[i].zCtrlName, n)==0 ){
3720 if( testctrl<0 ){
3721 testctrl = aCtrl[i].ctrlCode;
3722 }else{
3723 fprintf(stderr, "ambiguous option name: \"%s\"\n", azArg[1]);
3724 testctrl = -1;
@@ -3735,12 +3735,12 @@
3735 /* sqlite3_test_control(int, db, int) */
3736 case SQLITE_TESTCTRL_OPTIMIZATIONS:
3737 case SQLITE_TESTCTRL_RESERVE:
3738 if( nArg==3 ){
3739 int opt = (int)strtol(azArg[2], 0, 0);
3740 rc = sqlite3_test_control(testctrl, p->db, opt);
3741 fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3742 } else {
3743 fprintf(stderr,"Error: testctrl %s takes a single int option\n",
3744 azArg[1]);
3745 }
3746 break;
@@ -3749,23 +3749,23 @@
3749 case SQLITE_TESTCTRL_PRNG_SAVE:
3750 case SQLITE_TESTCTRL_PRNG_RESTORE:
3751 case SQLITE_TESTCTRL_PRNG_RESET:
3752 case SQLITE_TESTCTRL_BYTEORDER:
3753 if( nArg==2 ){
3754 rc = sqlite3_test_control(testctrl);
3755 fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3756 } else {
3757 fprintf(stderr,"Error: testctrl %s takes no options\n", azArg[1]);
3758 }
3759 break;
3760
3761 /* sqlite3_test_control(int, uint) */
3762 case SQLITE_TESTCTRL_PENDING_BYTE:
3763 if( nArg==3 ){
3764 unsigned int opt = (unsigned int)integerValue(azArg[2]);
3765 rc = sqlite3_test_control(testctrl, opt);
3766 fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3767 } else {
3768 fprintf(stderr,"Error: testctrl %s takes a single unsigned"
3769 " int option\n", azArg[1]);
3770 }
3771 break;
@@ -3774,12 +3774,12 @@
3774 case SQLITE_TESTCTRL_ASSERT:
3775 case SQLITE_TESTCTRL_ALWAYS:
3776 case SQLITE_TESTCTRL_NEVER_CORRUPT:
3777 if( nArg==3 ){
3778 int opt = booleanValue(azArg[2]);
3779 rc = sqlite3_test_control(testctrl, opt);
3780 fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3781 } else {
3782 fprintf(stderr,"Error: testctrl %s takes a single int option\n",
3783 azArg[1]);
3784 }
3785 break;
@@ -3787,26 +3787,26 @@
3787 /* sqlite3_test_control(int, char *) */
3788 #ifdef SQLITE_N_KEYWORD
3789 case SQLITE_TESTCTRL_ISKEYWORD:
3790 if( nArg==3 ){
3791 const char *opt = azArg[2];
3792 rc = sqlite3_test_control(testctrl, opt);
3793 fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3794 } else {
3795 fprintf(stderr,"Error: testctrl %s takes a single char * option\n",
3796 azArg[1]);
3797 }
3798 break;
3799 #endif
3800
3801 case SQLITE_TESTCTRL_IMPOSTER:
3802 if( nArg==5 ){
3803 rc = sqlite3_test_control(testctrl, p->db,
3804 azArg[2],
3805 integerValue(azArg[3]),
3806 integerValue(azArg[4]));
3807 fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3808 }else{
3809 fprintf(stderr,"Usage: .testctrl imposter dbName onoff tnum\n");
3810 }
3811 break;
3812
3813
--- src/shell.c
+++ src/shell.c
@@ -334,11 +334,11 @@
334 /*
335 ** The following is the open SQLite database. We make a pointer
336 ** to this database a static variable so that it can be accessed
337 ** by the SIGINT handler to interrupt database processing.
338 */
339 static sqlite3 *globalDb = 0;
340
341 /*
342 ** True if an interrupt (Control-C) has been received.
343 */
344 static volatile int seenInterrupt = 0;
@@ -803,11 +803,11 @@
803 */
804 static void interrupt_handler(int NotUsed){
805 UNUSED_PARAMETER(NotUsed);
806 seenInterrupt++;
807 if( seenInterrupt>2 ) exit(1);
808 if( globalDb ) sqlite3_interrupt(globalDb);
809 }
810 #endif
811
812 /*
813 ** This is the callback routine that the shell
@@ -1907,27 +1907,27 @@
1907 */
1908 static void open_db(ShellState *p, int keepAlive){
1909 if( p->db==0 ){
1910 sqlite3_initialize();
1911 sqlite3_open(p->zDbFilename, &p->db);
1912 globalDb = p->db;
1913 if( p->db && sqlite3_errcode(p->db)==SQLITE_OK ){
1914 sqlite3_create_function(p->db, "shellstatic", 0, SQLITE_UTF8, 0,
1915 shellstaticFunc, 0, 0);
1916 }
1917 if( p->db==0 || SQLITE_OK!=sqlite3_errcode(p->db) ){
1918 fprintf(stderr,"Error: unable to open database \"%s\": %s\n",
1919 p->zDbFilename, sqlite3_errmsg(p->db));
1920 if( keepAlive ) return;
1921 exit(1);
1922 }
1923 #ifndef SQLITE_OMIT_LOAD_EXTENSION
1924 sqlite3_enable_load_extension(p->db, 1);
1925 #endif
1926 sqlite3_create_function(p->db, "readfile", 1, SQLITE_UTF8, 0,
1927 readfileFunc, 0, 0);
1928 sqlite3_create_function(p->db, "writefile", 2, SQLITE_UTF8, 0,
1929 writefileFunc, 0, 0);
1930 }
1931 }
1932
1933 /*
@@ -2584,36 +2584,36 @@
2584 ** process that line.
2585 **
2586 ** Return 1 on error, 2 to exit, and 0 otherwise.
2587 */
2588 static int do_meta_command(char *zLine, ShellState *p){
2589 int h = 1;
2590 int nArg = 0;
2591 int n, c;
2592 int rc = 0;
2593 char *azArg[50];
2594
2595 /* Parse the input line into tokens.
2596 */
2597 while( zLine[h] && nArg<ArraySize(azArg) ){
2598 while( IsSpace(zLine[h]) ){ h++; }
2599 if( zLine[h]==0 ) break;
2600 if( zLine[h]=='\'' || zLine[h]=='"' ){
2601 int delim = zLine[h++];
2602 azArg[nArg++] = &zLine[h];
2603 while( zLine[h] && zLine[h]!=delim ){
2604 if( zLine[h]=='\\' && delim=='"' && zLine[h+1]!=0 ) h++;
2605 h++;
2606 }
2607 if( zLine[h]==delim ){
2608 zLine[h++] = 0;
2609 }
2610 if( delim=='"' ) resolve_backslashes(azArg[nArg-1]);
2611 }else{
2612 azArg[nArg++] = &zLine[h];
2613 while( zLine[h] && !IsSpace(zLine[h]) ){ h++; }
2614 if( zLine[h] ) zLine[h++] = 0;
2615 resolve_backslashes(azArg[nArg-1]);
2616 }
2617 }
2618
2619 /* Process the input line.
@@ -2985,11 +2985,11 @@
2985 return 1;
2986 }
2987 nByte = strlen30(zSql);
2988 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
2989 import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */
2990 if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(p->db))==0 ){
2991 char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable);
2992 char cSep = '(';
2993 while( xRead(&sCtx) ){
2994 zCreate = sqlite3_mprintf("%z%c\n \"%s\" TEXT", zCreate, cSep, sCtx.z);
2995 cSep = ',';
@@ -3005,21 +3005,21 @@
3005 zCreate = sqlite3_mprintf("%z\n)", zCreate);
3006 rc = sqlite3_exec(p->db, zCreate, 0, 0, 0);
3007 sqlite3_free(zCreate);
3008 if( rc ){
3009 fprintf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable,
3010 sqlite3_errmsg(p->db));
3011 sqlite3_free(sCtx.z);
3012 xCloser(sCtx.in);
3013 return 1;
3014 }
3015 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
3016 }
3017 sqlite3_free(zSql);
3018 if( rc ){
3019 if (pStmt) sqlite3_finalize(pStmt);
3020 fprintf(stderr,"Error: %s\n", sqlite3_errmsg(p->db));
3021 xCloser(sCtx.in);
3022 return 1;
3023 }
3024 nCol = sqlite3_column_count(pStmt);
3025 sqlite3_finalize(pStmt);
@@ -3040,17 +3040,17 @@
3040 zSql[j++] = ')';
3041 zSql[j] = 0;
3042 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
3043 sqlite3_free(zSql);
3044 if( rc ){
3045 fprintf(stderr, "Error: %s\n", sqlite3_errmsg(p->db));
3046 if (pStmt) sqlite3_finalize(pStmt);
3047 xCloser(sCtx.in);
3048 return 1;
3049 }
3050 needCommit = sqlite3_get_autocommit(p->db);
3051 if( needCommit ) sqlite3_exec(p->db, "BEGIN", 0, 0, 0);
3052 do{
3053 int startLine = sCtx.nLine;
3054 for(i=0; i<nCol; i++){
3055 char *z = xRead(&sCtx);
3056 /*
@@ -3085,19 +3085,19 @@
3085 if( i>=nCol ){
3086 sqlite3_step(pStmt);
3087 rc = sqlite3_reset(pStmt);
3088 if( rc!=SQLITE_OK ){
3089 fprintf(stderr, "%s:%d: INSERT failed: %s\n", sCtx.zFile, startLine,
3090 sqlite3_errmsg(p->db));
3091 }
3092 }
3093 }while( sCtx.cTerm!=EOF );
3094
3095 xCloser(sCtx.in);
3096 sqlite3_free(sCtx.z);
3097 sqlite3_finalize(pStmt);
3098 if( needCommit ) sqlite3_exec(p->db, "COMMIT", 0, 0, 0);
3099 }else
3100
3101 if( c=='i' && (strncmp(azArg[0], "indices", n)==0
3102 || strncmp(azArg[0], "indexes", n)==0) ){
3103 ShellState data;
@@ -3647,17 +3647,17 @@
3647 sqlite3_bind_text(pStmt, 1, "%", -1, SQLITE_STATIC);
3648 }
3649 while( sqlite3_step(pStmt)==SQLITE_ROW ){
3650 if( nRow>=nAlloc ){
3651 char **azNew;
3652 int n2 = nAlloc*2 + 10;
3653 azNew = sqlite3_realloc(azResult, sizeof(azResult[0])*n2);
3654 if( azNew==0 ){
3655 fprintf(stderr, "Error: out of memory\n");
3656 break;
3657 }
3658 nAlloc = n2;
3659 azResult = azNew;
3660 }
3661 azResult[nRow] = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0));
3662 if( azResult[nRow] ) nRow++;
3663 }
@@ -3706,19 +3706,19 @@
3706 { "byteorder", SQLITE_TESTCTRL_BYTEORDER },
3707 { "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT },
3708 { "imposter", SQLITE_TESTCTRL_IMPOSTER },
3709 };
3710 int testctrl = -1;
3711 int rc2 = 0;
3712 int i, n2;
3713 open_db(p, 0);
3714
3715 /* convert testctrl text option to value. allow any unique prefix
3716 ** of the option name, or a numerical value. */
3717 n2 = strlen30(azArg[1]);
3718 for(i=0; i<(int)(sizeof(aCtrl)/sizeof(aCtrl[0])); i++){
3719 if( strncmp(azArg[1], aCtrl[i].zCtrlName, n2)==0 ){
3720 if( testctrl<0 ){
3721 testctrl = aCtrl[i].ctrlCode;
3722 }else{
3723 fprintf(stderr, "ambiguous option name: \"%s\"\n", azArg[1]);
3724 testctrl = -1;
@@ -3735,12 +3735,12 @@
3735 /* sqlite3_test_control(int, db, int) */
3736 case SQLITE_TESTCTRL_OPTIMIZATIONS:
3737 case SQLITE_TESTCTRL_RESERVE:
3738 if( nArg==3 ){
3739 int opt = (int)strtol(azArg[2], 0, 0);
3740 rc2 = sqlite3_test_control(testctrl, p->db, opt);
3741 fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
3742 } else {
3743 fprintf(stderr,"Error: testctrl %s takes a single int option\n",
3744 azArg[1]);
3745 }
3746 break;
@@ -3749,23 +3749,23 @@
3749 case SQLITE_TESTCTRL_PRNG_SAVE:
3750 case SQLITE_TESTCTRL_PRNG_RESTORE:
3751 case SQLITE_TESTCTRL_PRNG_RESET:
3752 case SQLITE_TESTCTRL_BYTEORDER:
3753 if( nArg==2 ){
3754 rc2 = sqlite3_test_control(testctrl);
3755 fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
3756 } else {
3757 fprintf(stderr,"Error: testctrl %s takes no options\n", azArg[1]);
3758 }
3759 break;
3760
3761 /* sqlite3_test_control(int, uint) */
3762 case SQLITE_TESTCTRL_PENDING_BYTE:
3763 if( nArg==3 ){
3764 unsigned int opt = (unsigned int)integerValue(azArg[2]);
3765 rc2 = sqlite3_test_control(testctrl, opt);
3766 fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
3767 } else {
3768 fprintf(stderr,"Error: testctrl %s takes a single unsigned"
3769 " int option\n", azArg[1]);
3770 }
3771 break;
@@ -3774,12 +3774,12 @@
3774 case SQLITE_TESTCTRL_ASSERT:
3775 case SQLITE_TESTCTRL_ALWAYS:
3776 case SQLITE_TESTCTRL_NEVER_CORRUPT:
3777 if( nArg==3 ){
3778 int opt = booleanValue(azArg[2]);
3779 rc2 = sqlite3_test_control(testctrl, opt);
3780 fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
3781 } else {
3782 fprintf(stderr,"Error: testctrl %s takes a single int option\n",
3783 azArg[1]);
3784 }
3785 break;
@@ -3787,26 +3787,26 @@
3787 /* sqlite3_test_control(int, char *) */
3788 #ifdef SQLITE_N_KEYWORD
3789 case SQLITE_TESTCTRL_ISKEYWORD:
3790 if( nArg==3 ){
3791 const char *opt = azArg[2];
3792 rc2 = sqlite3_test_control(testctrl, opt);
3793 fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
3794 } else {
3795 fprintf(stderr,"Error: testctrl %s takes a single char * option\n",
3796 azArg[1]);
3797 }
3798 break;
3799 #endif
3800
3801 case SQLITE_TESTCTRL_IMPOSTER:
3802 if( nArg==5 ){
3803 rc2 = sqlite3_test_control(testctrl, p->db,
3804 azArg[2],
3805 integerValue(azArg[3]),
3806 integerValue(azArg[4]));
3807 fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
3808 }else{
3809 fprintf(stderr,"Usage: .testctrl imposter dbName onoff tnum\n");
3810 }
3811 break;
3812
3813
+1 -1
--- src/xfer.c
+++ src/xfer.c
@@ -1972,11 +1972,11 @@
19721972
db_multi_exec("DROP TABLE onremote");
19731973
manifest_crosslink_end(MC_PERMIT_HOOKS);
19741974
content_enable_dephantomize(1);
19751975
db_end_transaction(0);
19761976
}
1977
- if( (syncFlags & SYNC_CLONE)==0 && fossil_any_has_fork(g.rcvid) ){
1977
+ if( (syncFlags & SYNC_CLONE)==0 && g.rcvid && fossil_any_has_fork(g.rcvid) ){
19781978
fossil_warning("***** WARNING: multiple leaves on the same branch are formed *****\n"
19791979
"use \"fossil info\" for more details.");
19801980
}
19811981
return nErr;
19821982
}
19831983
--- src/xfer.c
+++ src/xfer.c
@@ -1972,11 +1972,11 @@
1972 db_multi_exec("DROP TABLE onremote");
1973 manifest_crosslink_end(MC_PERMIT_HOOKS);
1974 content_enable_dephantomize(1);
1975 db_end_transaction(0);
1976 }
1977 if( (syncFlags & SYNC_CLONE)==0 && fossil_any_has_fork(g.rcvid) ){
1978 fossil_warning("***** WARNING: multiple leaves on the same branch are formed *****\n"
1979 "use \"fossil info\" for more details.");
1980 }
1981 return nErr;
1982 }
1983
--- src/xfer.c
+++ src/xfer.c
@@ -1972,11 +1972,11 @@
1972 db_multi_exec("DROP TABLE onremote");
1973 manifest_crosslink_end(MC_PERMIT_HOOKS);
1974 content_enable_dephantomize(1);
1975 db_end_transaction(0);
1976 }
1977 if( (syncFlags & SYNC_CLONE)==0 && g.rcvid && fossil_any_has_fork(g.rcvid) ){
1978 fossil_warning("***** WARNING: multiple leaves on the same branch are formed *****\n"
1979 "use \"fossil info\" for more details.");
1980 }
1981 return nErr;
1982 }
1983
+1 -1
--- src/xfer.c
+++ src/xfer.c
@@ -1972,11 +1972,11 @@
19721972
db_multi_exec("DROP TABLE onremote");
19731973
manifest_crosslink_end(MC_PERMIT_HOOKS);
19741974
content_enable_dephantomize(1);
19751975
db_end_transaction(0);
19761976
}
1977
- if( (syncFlags & SYNC_CLONE)==0 && fossil_any_has_fork(g.rcvid) ){
1977
+ if( (syncFlags & SYNC_CLONE)==0 && g.rcvid && fossil_any_has_fork(g.rcvid) ){
19781978
fossil_warning("***** WARNING: multiple leaves on the same branch are formed *****\n"
19791979
"use \"fossil info\" for more details.");
19801980
}
19811981
return nErr;
19821982
}
19831983
--- src/xfer.c
+++ src/xfer.c
@@ -1972,11 +1972,11 @@
1972 db_multi_exec("DROP TABLE onremote");
1973 manifest_crosslink_end(MC_PERMIT_HOOKS);
1974 content_enable_dephantomize(1);
1975 db_end_transaction(0);
1976 }
1977 if( (syncFlags & SYNC_CLONE)==0 && fossil_any_has_fork(g.rcvid) ){
1978 fossil_warning("***** WARNING: multiple leaves on the same branch are formed *****\n"
1979 "use \"fossil info\" for more details.");
1980 }
1981 return nErr;
1982 }
1983
--- src/xfer.c
+++ src/xfer.c
@@ -1972,11 +1972,11 @@
1972 db_multi_exec("DROP TABLE onremote");
1973 manifest_crosslink_end(MC_PERMIT_HOOKS);
1974 content_enable_dephantomize(1);
1975 db_end_transaction(0);
1976 }
1977 if( (syncFlags & SYNC_CLONE)==0 && g.rcvid && fossil_any_has_fork(g.rcvid) ){
1978 fossil_warning("***** WARNING: multiple leaves on the same branch are formed *****\n"
1979 "use \"fossil info\" for more details.");
1980 }
1981 return nErr;
1982 }
1983

Keyboard Shortcuts

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