Fossil SCM

Remove an unused parameter and bring the code more in line with [dd72a96111].

danield 2024-04-30 10:17 trunk
Commit 89da205267ee6e8322ba5e080bca26cea89c21acf8c86dfe6b0eda1c154c9a75
1 file changed +16 -17
+16 -17
--- src/checkin.c
+++ src/checkin.c
@@ -628,33 +628,31 @@
628628
*/
629629
static const char *print_filelist_section(
630630
const char *zIn, /* List of filenames, separated by \n */
631631
const char *zLast, /* Last filename in the list to print */
632632
const char *zPrefix, /* Prefix so put before each output line */
633
- int nDir, /* Ignore this many characters of directory name */
634
- int treeFmt /* 1 = use Unicode symbols, 2 = use ASCII chars */
633
+ int nDir /* Ignore this many characters of directory name */
635634
){
636635
/* Unicode box-drawing characters: U+251C, U+2514, U+2502 */
637
- const char *treeEntry = "\342\224\234\342\224\200\342\224\200 ";
638
- const char *treeLastE = "\342\224\224\342\224\200\342\224\200 ";
639
- const char *treeContu = "\342\224\202 ";
640
- const char *treeBlank = " ";
636
+ const char *zENTRY = "\342\224\234\342\224\200\342\224\200 ";
637
+ const char *zLASTE = "\342\224\224\342\224\200\342\224\200 ";
638
+ const char *zCONTU = "\342\224\202 ";
639
+ const char *zBLANK = " ";
641640
642641
while( zIn<=zLast ){
643642
int i;
644643
for(i=nDir; zIn[i]!='\n' && zIn[i]!='/'; i++){}
645644
if( zIn[i]=='/' ){
646645
char *zSubPrefix;
647646
const char *zSubLast = last_line(zIn, i+1);
648
- zSubPrefix = mprintf("%s%s", zPrefix,
649
- zSubLast==zLast ? treeBlank : treeContu);
650
- fossil_print("%s%s%.*s\n", zPrefix,
651
- zSubLast==zLast ? treeLastE : treeEntry, i-nDir, &zIn[nDir]);
652
- zIn = print_filelist_section(zIn, zSubLast, zSubPrefix, i+1, treeFmt);
647
+ zSubPrefix = mprintf("%s%s", zPrefix, zSubLast==zLast ? zBLANK : zCONTU);
648
+ fossil_print("%s%s%.*s\n", zPrefix, zSubLast==zLast ? zLASTE : zENTRY,
649
+ i-nDir, &zIn[nDir]);
650
+ zIn = print_filelist_section(zIn, zSubLast, zSubPrefix, i+1);
653651
fossil_free(zSubPrefix);
654652
}else{
655
- fossil_print("%s%s%.*s\n", zPrefix, zIn==zLast ? treeLastE : treeEntry,
653
+ fossil_print("%s%s%.*s\n", zPrefix, zIn==zLast ? zLASTE : zENTRY,
656654
i-nDir, &zIn[nDir]);
657655
zIn = next_line(zIn);
658656
}
659657
}
660658
return zIn;
@@ -663,18 +661,18 @@
663661
/*
664662
** Input blob pList is a list of filenames, one filename per line,
665663
** in sorted order and with / directory separators. Output this list
666664
** as a tree in a manner similar to the "tree" command on Linux.
667665
*/
668
-static void print_filelist_as_tree(Blob *pList, int treeFmt){
666
+static void print_filelist_as_tree(Blob *pList){
669667
char *zAll;
670668
const char *zLast;
671669
fossil_print("%s\n", g.zLocalRoot);
672670
zAll = blob_str(pList);
673671
if( zAll[0] ){
674672
zLast = last_line(zAll, 0);
675
- print_filelist_section(zAll, zLast, "", 0, treeFmt);
673
+ print_filelist_section(zAll, zLast, "", 0);
676674
}
677675
}
678676
679677
/*
680678
** Take care of -r version of ls command
@@ -750,11 +748,11 @@
750748
fossil_print("%s\n", zFile);
751749
}
752750
}
753751
db_finalize(&q);
754752
if( treeFmt ){
755
- print_filelist_as_tree(&out, treeFmt);
753
+ print_filelist_as_tree(&out);
756754
blob_reset(&out);
757755
}
758756
}
759757
760758
/*
@@ -942,15 +940,16 @@
942940
**
943941
** See also: [[ls]]
944942
*/
945943
void tree_cmd(void){
946944
const char *zRev;
945
+
947946
zRev = find_option("r","r",1);
948947
if( zRev==0 ) zRev = "current";
949948
db_find_and_open_repository(0, 0);
950949
verify_all_options();
951
- ls_cmd_rev(zRev, 0, 0, 0, 1);
950
+ ls_cmd_rev(zRev,0,0,0,1);
952951
}
953952
954953
/*
955954
** COMMAND: extras
956955
**
@@ -1020,11 +1019,11 @@
10201019
if( showHdr ){
10211020
fossil_print("Extras for %s at %s:\n", db_get("project-name","<unnamed>"),
10221021
g.zLocalRoot);
10231022
}
10241023
if( treeFmt ){
1025
- print_filelist_as_tree(&report, treeFmt);
1024
+ print_filelist_as_tree(&report);
10261025
}else{
10271026
blob_write_to_file(&report, "-");
10281027
}
10291028
}
10301029
blob_reset(&report);
10311030
--- src/checkin.c
+++ src/checkin.c
@@ -628,33 +628,31 @@
628 */
629 static const char *print_filelist_section(
630 const char *zIn, /* List of filenames, separated by \n */
631 const char *zLast, /* Last filename in the list to print */
632 const char *zPrefix, /* Prefix so put before each output line */
633 int nDir, /* Ignore this many characters of directory name */
634 int treeFmt /* 1 = use Unicode symbols, 2 = use ASCII chars */
635 ){
636 /* Unicode box-drawing characters: U+251C, U+2514, U+2502 */
637 const char *treeEntry = "\342\224\234\342\224\200\342\224\200 ";
638 const char *treeLastE = "\342\224\224\342\224\200\342\224\200 ";
639 const char *treeContu = "\342\224\202 ";
640 const char *treeBlank = " ";
641
642 while( zIn<=zLast ){
643 int i;
644 for(i=nDir; zIn[i]!='\n' && zIn[i]!='/'; i++){}
645 if( zIn[i]=='/' ){
646 char *zSubPrefix;
647 const char *zSubLast = last_line(zIn, i+1);
648 zSubPrefix = mprintf("%s%s", zPrefix,
649 zSubLast==zLast ? treeBlank : treeContu);
650 fossil_print("%s%s%.*s\n", zPrefix,
651 zSubLast==zLast ? treeLastE : treeEntry, i-nDir, &zIn[nDir]);
652 zIn = print_filelist_section(zIn, zSubLast, zSubPrefix, i+1, treeFmt);
653 fossil_free(zSubPrefix);
654 }else{
655 fossil_print("%s%s%.*s\n", zPrefix, zIn==zLast ? treeLastE : treeEntry,
656 i-nDir, &zIn[nDir]);
657 zIn = next_line(zIn);
658 }
659 }
660 return zIn;
@@ -663,18 +661,18 @@
663 /*
664 ** Input blob pList is a list of filenames, one filename per line,
665 ** in sorted order and with / directory separators. Output this list
666 ** as a tree in a manner similar to the "tree" command on Linux.
667 */
668 static void print_filelist_as_tree(Blob *pList, int treeFmt){
669 char *zAll;
670 const char *zLast;
671 fossil_print("%s\n", g.zLocalRoot);
672 zAll = blob_str(pList);
673 if( zAll[0] ){
674 zLast = last_line(zAll, 0);
675 print_filelist_section(zAll, zLast, "", 0, treeFmt);
676 }
677 }
678
679 /*
680 ** Take care of -r version of ls command
@@ -750,11 +748,11 @@
750 fossil_print("%s\n", zFile);
751 }
752 }
753 db_finalize(&q);
754 if( treeFmt ){
755 print_filelist_as_tree(&out, treeFmt);
756 blob_reset(&out);
757 }
758 }
759
760 /*
@@ -942,15 +940,16 @@
942 **
943 ** See also: [[ls]]
944 */
945 void tree_cmd(void){
946 const char *zRev;
 
947 zRev = find_option("r","r",1);
948 if( zRev==0 ) zRev = "current";
949 db_find_and_open_repository(0, 0);
950 verify_all_options();
951 ls_cmd_rev(zRev, 0, 0, 0, 1);
952 }
953
954 /*
955 ** COMMAND: extras
956 **
@@ -1020,11 +1019,11 @@
1020 if( showHdr ){
1021 fossil_print("Extras for %s at %s:\n", db_get("project-name","<unnamed>"),
1022 g.zLocalRoot);
1023 }
1024 if( treeFmt ){
1025 print_filelist_as_tree(&report, treeFmt);
1026 }else{
1027 blob_write_to_file(&report, "-");
1028 }
1029 }
1030 blob_reset(&report);
1031
--- src/checkin.c
+++ src/checkin.c
@@ -628,33 +628,31 @@
628 */
629 static const char *print_filelist_section(
630 const char *zIn, /* List of filenames, separated by \n */
631 const char *zLast, /* Last filename in the list to print */
632 const char *zPrefix, /* Prefix so put before each output line */
633 int nDir /* Ignore this many characters of directory name */
 
634 ){
635 /* Unicode box-drawing characters: U+251C, U+2514, U+2502 */
636 const char *zENTRY = "\342\224\234\342\224\200\342\224\200 ";
637 const char *zLASTE = "\342\224\224\342\224\200\342\224\200 ";
638 const char *zCONTU = "\342\224\202 ";
639 const char *zBLANK = " ";
640
641 while( zIn<=zLast ){
642 int i;
643 for(i=nDir; zIn[i]!='\n' && zIn[i]!='/'; i++){}
644 if( zIn[i]=='/' ){
645 char *zSubPrefix;
646 const char *zSubLast = last_line(zIn, i+1);
647 zSubPrefix = mprintf("%s%s", zPrefix, zSubLast==zLast ? zBLANK : zCONTU);
648 fossil_print("%s%s%.*s\n", zPrefix, zSubLast==zLast ? zLASTE : zENTRY,
649 i-nDir, &zIn[nDir]);
650 zIn = print_filelist_section(zIn, zSubLast, zSubPrefix, i+1);
 
651 fossil_free(zSubPrefix);
652 }else{
653 fossil_print("%s%s%.*s\n", zPrefix, zIn==zLast ? zLASTE : zENTRY,
654 i-nDir, &zIn[nDir]);
655 zIn = next_line(zIn);
656 }
657 }
658 return zIn;
@@ -663,18 +661,18 @@
661 /*
662 ** Input blob pList is a list of filenames, one filename per line,
663 ** in sorted order and with / directory separators. Output this list
664 ** as a tree in a manner similar to the "tree" command on Linux.
665 */
666 static void print_filelist_as_tree(Blob *pList){
667 char *zAll;
668 const char *zLast;
669 fossil_print("%s\n", g.zLocalRoot);
670 zAll = blob_str(pList);
671 if( zAll[0] ){
672 zLast = last_line(zAll, 0);
673 print_filelist_section(zAll, zLast, "", 0);
674 }
675 }
676
677 /*
678 ** Take care of -r version of ls command
@@ -750,11 +748,11 @@
748 fossil_print("%s\n", zFile);
749 }
750 }
751 db_finalize(&q);
752 if( treeFmt ){
753 print_filelist_as_tree(&out);
754 blob_reset(&out);
755 }
756 }
757
758 /*
@@ -942,15 +940,16 @@
940 **
941 ** See also: [[ls]]
942 */
943 void tree_cmd(void){
944 const char *zRev;
945
946 zRev = find_option("r","r",1);
947 if( zRev==0 ) zRev = "current";
948 db_find_and_open_repository(0, 0);
949 verify_all_options();
950 ls_cmd_rev(zRev,0,0,0,1);
951 }
952
953 /*
954 ** COMMAND: extras
955 **
@@ -1020,11 +1019,11 @@
1019 if( showHdr ){
1020 fossil_print("Extras for %s at %s:\n", db_get("project-name","<unnamed>"),
1021 g.zLocalRoot);
1022 }
1023 if( treeFmt ){
1024 print_filelist_as_tree(&report);
1025 }else{
1026 blob_write_to_file(&report, "-");
1027 }
1028 }
1029 blob_reset(&report);
1030

Keyboard Shortcuts

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