Fossil SCM
Remove an unused parameter and bring the code more in line with [dd72a96111].
Commit
89da205267ee6e8322ba5e080bca26cea89c21acf8c86dfe6b0eda1c154c9a75
Parent
7045859339403bb…
1 file changed
+16
-17
+16
-17
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -628,33 +628,31 @@ | ||
| 628 | 628 | */ |
| 629 | 629 | static const char *print_filelist_section( |
| 630 | 630 | const char *zIn, /* List of filenames, separated by \n */ |
| 631 | 631 | const char *zLast, /* Last filename in the list to print */ |
| 632 | 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 */ | |
| 633 | + int nDir /* Ignore this many characters of directory name */ | |
| 635 | 634 | ){ |
| 636 | 635 | /* 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 = " "; | |
| 641 | 640 | |
| 642 | 641 | while( zIn<=zLast ){ |
| 643 | 642 | int i; |
| 644 | 643 | for(i=nDir; zIn[i]!='\n' && zIn[i]!='/'; i++){} |
| 645 | 644 | if( zIn[i]=='/' ){ |
| 646 | 645 | char *zSubPrefix; |
| 647 | 646 | 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); | |
| 653 | 651 | fossil_free(zSubPrefix); |
| 654 | 652 | }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, | |
| 656 | 654 | i-nDir, &zIn[nDir]); |
| 657 | 655 | zIn = next_line(zIn); |
| 658 | 656 | } |
| 659 | 657 | } |
| 660 | 658 | return zIn; |
| @@ -663,18 +661,18 @@ | ||
| 663 | 661 | /* |
| 664 | 662 | ** Input blob pList is a list of filenames, one filename per line, |
| 665 | 663 | ** in sorted order and with / directory separators. Output this list |
| 666 | 664 | ** as a tree in a manner similar to the "tree" command on Linux. |
| 667 | 665 | */ |
| 668 | -static void print_filelist_as_tree(Blob *pList, int treeFmt){ | |
| 666 | +static void print_filelist_as_tree(Blob *pList){ | |
| 669 | 667 | char *zAll; |
| 670 | 668 | const char *zLast; |
| 671 | 669 | fossil_print("%s\n", g.zLocalRoot); |
| 672 | 670 | zAll = blob_str(pList); |
| 673 | 671 | if( zAll[0] ){ |
| 674 | 672 | zLast = last_line(zAll, 0); |
| 675 | - print_filelist_section(zAll, zLast, "", 0, treeFmt); | |
| 673 | + print_filelist_section(zAll, zLast, "", 0); | |
| 676 | 674 | } |
| 677 | 675 | } |
| 678 | 676 | |
| 679 | 677 | /* |
| 680 | 678 | ** Take care of -r version of ls command |
| @@ -750,11 +748,11 @@ | ||
| 750 | 748 | fossil_print("%s\n", zFile); |
| 751 | 749 | } |
| 752 | 750 | } |
| 753 | 751 | db_finalize(&q); |
| 754 | 752 | if( treeFmt ){ |
| 755 | - print_filelist_as_tree(&out, treeFmt); | |
| 753 | + print_filelist_as_tree(&out); | |
| 756 | 754 | blob_reset(&out); |
| 757 | 755 | } |
| 758 | 756 | } |
| 759 | 757 | |
| 760 | 758 | /* |
| @@ -942,15 +940,16 @@ | ||
| 942 | 940 | ** |
| 943 | 941 | ** See also: [[ls]] |
| 944 | 942 | */ |
| 945 | 943 | void tree_cmd(void){ |
| 946 | 944 | const char *zRev; |
| 945 | + | |
| 947 | 946 | zRev = find_option("r","r",1); |
| 948 | 947 | if( zRev==0 ) zRev = "current"; |
| 949 | 948 | db_find_and_open_repository(0, 0); |
| 950 | 949 | verify_all_options(); |
| 951 | - ls_cmd_rev(zRev, 0, 0, 0, 1); | |
| 950 | + ls_cmd_rev(zRev,0,0,0,1); | |
| 952 | 951 | } |
| 953 | 952 | |
| 954 | 953 | /* |
| 955 | 954 | ** COMMAND: extras |
| 956 | 955 | ** |
| @@ -1020,11 +1019,11 @@ | ||
| 1020 | 1019 | if( showHdr ){ |
| 1021 | 1020 | fossil_print("Extras for %s at %s:\n", db_get("project-name","<unnamed>"), |
| 1022 | 1021 | g.zLocalRoot); |
| 1023 | 1022 | } |
| 1024 | 1023 | if( treeFmt ){ |
| 1025 | - print_filelist_as_tree(&report, treeFmt); | |
| 1024 | + print_filelist_as_tree(&report); | |
| 1026 | 1025 | }else{ |
| 1027 | 1026 | blob_write_to_file(&report, "-"); |
| 1028 | 1027 | } |
| 1029 | 1028 | } |
| 1030 | 1029 | blob_reset(&report); |
| 1031 | 1030 |
| --- 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 |