Fossil SCM

Code cleaning after the previous check-in. No functional changes.

danield 2024-04-29 21:33 trunk
Commit b705d756cf645ecd3d8ae2197179cbf7bac6d2f7c507ff2816fc977620477f57
1 file changed +8 -28
+8 -28
--- src/checkin.c
+++ src/checkin.c
@@ -592,28 +592,10 @@
592592
/* The status command ends with warnings about ambiguous leaves (forks). */
593593
if( command==STATUS ){
594594
leaf_ambiguity_warning(vid, vid);
595595
}
596596
}
597
-
598
-/*
599
-** Characters used for drawing a file hierarchy graph.
600
-*/
601
-#if _WIN32
602
-/* ASCII only available on Windows */
603
-#define ENTRY "|-- "
604
-#define LASTE "`-- "
605
-#define CONTU "| "
606
-#define BLANK " "
607
-#else
608
-/* All other platforms support Unicode box-drawing chracters */
609
-#define ENTRY "\342\224\234\342\224\200\342\224\200 "
610
-#define LASTE "\342\224\224\342\224\200\342\224\200 "
611
-#define CONTU "\342\224\202 "
612
-#define BLANK " "
613
-#endif
614
-
615597
616598
/* zIn is a string that is guaranteed to be followed by \n. Return
617599
** a pointer to the next line after the \n. The returned value might
618600
** point to the \000 string terminator.
619601
*/
@@ -649,25 +631,23 @@
649631
const char *zLast, /* Last filename in the list to print */
650632
const char *zPrefix, /* Prefix so put before each output line */
651633
int nDir, /* Ignore this many characters of directory name */
652634
int treeFmt /* 1 = use Unicode symbols, 2 = use ASCII chars */
653635
){
636
+ /* ASCII characters used for drawing a file hierarchy graph */
654637
const char *treeEntry = "|-- ";
655638
const char *treeLastE = "`-- ";
656639
const char *treeContu = "| ";
657640
const char *treeBlank = " ";
658641
if( treeFmt == 1 ){
642
+ /* Unicode box-drawing characters: U+251C, U+2514, U+2502 */
659643
treeEntry = "\342\224\234\342\224\200\342\224\200 ";
660644
treeLastE = "\342\224\224\342\224\200\342\224\200 ";
661645
treeContu = "\342\224\202 ";
662646
}
663647
while( zIn<=zLast ){
664648
int i;
665
- // const char *treeContu = (treeFmt == 1) ? "\342\224\202 " : "| ";
666
- // const char *treeEntry = (treeFmt == 1) ? "\342\224\234\342\224\200\342\224\200 " : "|-- ";
667
- // const char *treeLastE = (treeFmt == 1) ? "\342\224\224\342\224\200\342\224\200 " : "`-- ";
668
- // const char *treeBlank = " ";
669649
for(i=nDir; zIn[i]!='\n' && zIn[i]!='/'; i++){}
670650
if( zIn[i]=='/' ){
671651
char *zSubPrefix;
672652
const char *zSubLast = last_line(zIn, i+1);
673653
zSubPrefix = mprintf("%s%s", zPrefix,
@@ -814,11 +794,11 @@
814794
** rather than relying on file sizes and mtimes
815795
** -r VERSION The specific check-in to list
816796
** -R|--repository REPO Extract info from repository REPO
817797
** -t Sort output in time order
818798
** --tree Tree format
819
-** -u|--unicode-tree Use Unicode symbols when drawing the tree
799
+** -u|--unicode-tree Use Unicode characters when drawing the tree
820800
** -v|--verbose Provide extra information about each file
821801
**
822802
** See also: [[changes]], [[extras]], [[status]], [[tree]]
823803
*/
824804
void ls_cmd(void){
@@ -852,11 +832,11 @@
852832
unicodeTree = find_option("unicode-tree","u",0)!=0;
853833
if( treeFmt ){
854834
if( zRev==0 ) zRev = "current";
855835
#ifdef _WIN32
856836
treeFmt = 2;
857
-#endif
837
+#endif
858838
if( unicodeTree ) treeFmt = 1;
859839
if( asciiTree ) treeFmt = 2;
860840
}
861841
862842
if( zRev!=0 ){
@@ -974,11 +954,11 @@
974954
**
975955
** Options:
976956
** -a|--ascii-tree Use ASCII characters when drawing the tree
977957
** -r VERSION The specific check-in to list
978958
** -R|--repository REPO Extract info from repository REPO
979
-** -u|--unicode-tree Use Unicode symbols when drawing the tree
959
+** -u|--unicode-tree Use Unicode characters when drawing the tree
980960
**
981961
** See also: [[ls]]
982962
*/
983963
void tree_cmd(void){
984964
const char *zRev;
@@ -985,11 +965,11 @@
985965
int treeFmt = 1;
986966
int asciiTree = find_option("ascii-tree","a",0)!=0;
987967
int unicodeTree = find_option("unicode-tree","u",0)!=0;
988968
#ifdef _WIN32
989969
treeFmt = 2;
990
-#endif
970
+#endif
991971
if( unicodeTree ) treeFmt = 1;
992972
if( asciiTree ) treeFmt = 2;
993973
zRev = find_option("r","r",1);
994974
if( zRev==0 ) zRev = "current";
995975
db_find_and_open_repository(0, 0);
@@ -1024,11 +1004,11 @@
10241004
** --header Identify the repository if there are extras
10251005
** --ignore CSG Ignore files matching patterns from the argument
10261006
** --rel-paths Display pathnames relative to the current working
10271007
** directory
10281008
** --tree Show output in the tree format
1029
-** -u|--unicode-tree Use Unicode symbols when drawing the tree
1009
+** -u|--unicode-tree Use Unicode characters when drawing the tree
10301010
**
10311011
** See also: [[changes]], [[clean]], [[status]]
10321012
*/
10331013
void extras_cmd(void){
10341014
Blob report = BLOB_INITIALIZER;
@@ -1052,11 +1032,11 @@
10521032
10531033
if( treeFmt ){
10541034
flags &= ~C_RELPATH;
10551035
#ifdef _WIN32
10561036
treeFmt = 2;
1057
-#endif
1037
+#endif
10581038
if( unicodeTree ) treeFmt = 1;
10591039
if( asciiTree ) treeFmt = 2;
10601040
}
10611041
10621042
/* We should be done with options.. */
10631043
--- src/checkin.c
+++ src/checkin.c
@@ -592,28 +592,10 @@
592 /* The status command ends with warnings about ambiguous leaves (forks). */
593 if( command==STATUS ){
594 leaf_ambiguity_warning(vid, vid);
595 }
596 }
597
598 /*
599 ** Characters used for drawing a file hierarchy graph.
600 */
601 #if _WIN32
602 /* ASCII only available on Windows */
603 #define ENTRY "|-- "
604 #define LASTE "`-- "
605 #define CONTU "| "
606 #define BLANK " "
607 #else
608 /* All other platforms support Unicode box-drawing chracters */
609 #define ENTRY "\342\224\234\342\224\200\342\224\200 "
610 #define LASTE "\342\224\224\342\224\200\342\224\200 "
611 #define CONTU "\342\224\202 "
612 #define BLANK " "
613 #endif
614
615
616 /* zIn is a string that is guaranteed to be followed by \n. Return
617 ** a pointer to the next line after the \n. The returned value might
618 ** point to the \000 string terminator.
619 */
@@ -649,25 +631,23 @@
649 const char *zLast, /* Last filename in the list to print */
650 const char *zPrefix, /* Prefix so put before each output line */
651 int nDir, /* Ignore this many characters of directory name */
652 int treeFmt /* 1 = use Unicode symbols, 2 = use ASCII chars */
653 ){
 
654 const char *treeEntry = "|-- ";
655 const char *treeLastE = "`-- ";
656 const char *treeContu = "| ";
657 const char *treeBlank = " ";
658 if( treeFmt == 1 ){
 
659 treeEntry = "\342\224\234\342\224\200\342\224\200 ";
660 treeLastE = "\342\224\224\342\224\200\342\224\200 ";
661 treeContu = "\342\224\202 ";
662 }
663 while( zIn<=zLast ){
664 int i;
665 // const char *treeContu = (treeFmt == 1) ? "\342\224\202 " : "| ";
666 // const char *treeEntry = (treeFmt == 1) ? "\342\224\234\342\224\200\342\224\200 " : "|-- ";
667 // const char *treeLastE = (treeFmt == 1) ? "\342\224\224\342\224\200\342\224\200 " : "`-- ";
668 // const char *treeBlank = " ";
669 for(i=nDir; zIn[i]!='\n' && zIn[i]!='/'; i++){}
670 if( zIn[i]=='/' ){
671 char *zSubPrefix;
672 const char *zSubLast = last_line(zIn, i+1);
673 zSubPrefix = mprintf("%s%s", zPrefix,
@@ -814,11 +794,11 @@
814 ** rather than relying on file sizes and mtimes
815 ** -r VERSION The specific check-in to list
816 ** -R|--repository REPO Extract info from repository REPO
817 ** -t Sort output in time order
818 ** --tree Tree format
819 ** -u|--unicode-tree Use Unicode symbols when drawing the tree
820 ** -v|--verbose Provide extra information about each file
821 **
822 ** See also: [[changes]], [[extras]], [[status]], [[tree]]
823 */
824 void ls_cmd(void){
@@ -852,11 +832,11 @@
852 unicodeTree = find_option("unicode-tree","u",0)!=0;
853 if( treeFmt ){
854 if( zRev==0 ) zRev = "current";
855 #ifdef _WIN32
856 treeFmt = 2;
857 #endif
858 if( unicodeTree ) treeFmt = 1;
859 if( asciiTree ) treeFmt = 2;
860 }
861
862 if( zRev!=0 ){
@@ -974,11 +954,11 @@
974 **
975 ** Options:
976 ** -a|--ascii-tree Use ASCII characters when drawing the tree
977 ** -r VERSION The specific check-in to list
978 ** -R|--repository REPO Extract info from repository REPO
979 ** -u|--unicode-tree Use Unicode symbols when drawing the tree
980 **
981 ** See also: [[ls]]
982 */
983 void tree_cmd(void){
984 const char *zRev;
@@ -985,11 +965,11 @@
985 int treeFmt = 1;
986 int asciiTree = find_option("ascii-tree","a",0)!=0;
987 int unicodeTree = find_option("unicode-tree","u",0)!=0;
988 #ifdef _WIN32
989 treeFmt = 2;
990 #endif
991 if( unicodeTree ) treeFmt = 1;
992 if( asciiTree ) treeFmt = 2;
993 zRev = find_option("r","r",1);
994 if( zRev==0 ) zRev = "current";
995 db_find_and_open_repository(0, 0);
@@ -1024,11 +1004,11 @@
1024 ** --header Identify the repository if there are extras
1025 ** --ignore CSG Ignore files matching patterns from the argument
1026 ** --rel-paths Display pathnames relative to the current working
1027 ** directory
1028 ** --tree Show output in the tree format
1029 ** -u|--unicode-tree Use Unicode symbols when drawing the tree
1030 **
1031 ** See also: [[changes]], [[clean]], [[status]]
1032 */
1033 void extras_cmd(void){
1034 Blob report = BLOB_INITIALIZER;
@@ -1052,11 +1032,11 @@
1052
1053 if( treeFmt ){
1054 flags &= ~C_RELPATH;
1055 #ifdef _WIN32
1056 treeFmt = 2;
1057 #endif
1058 if( unicodeTree ) treeFmt = 1;
1059 if( asciiTree ) treeFmt = 2;
1060 }
1061
1062 /* We should be done with options.. */
1063
--- src/checkin.c
+++ src/checkin.c
@@ -592,28 +592,10 @@
592 /* The status command ends with warnings about ambiguous leaves (forks). */
593 if( command==STATUS ){
594 leaf_ambiguity_warning(vid, vid);
595 }
596 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
597
598 /* zIn is a string that is guaranteed to be followed by \n. Return
599 ** a pointer to the next line after the \n. The returned value might
600 ** point to the \000 string terminator.
601 */
@@ -649,25 +631,23 @@
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 /* ASCII characters used for drawing a file hierarchy graph */
637 const char *treeEntry = "|-- ";
638 const char *treeLastE = "`-- ";
639 const char *treeContu = "| ";
640 const char *treeBlank = " ";
641 if( treeFmt == 1 ){
642 /* Unicode box-drawing characters: U+251C, U+2514, U+2502 */
643 treeEntry = "\342\224\234\342\224\200\342\224\200 ";
644 treeLastE = "\342\224\224\342\224\200\342\224\200 ";
645 treeContu = "\342\224\202 ";
646 }
647 while( zIn<=zLast ){
648 int i;
 
 
 
 
649 for(i=nDir; zIn[i]!='\n' && zIn[i]!='/'; i++){}
650 if( zIn[i]=='/' ){
651 char *zSubPrefix;
652 const char *zSubLast = last_line(zIn, i+1);
653 zSubPrefix = mprintf("%s%s", zPrefix,
@@ -814,11 +794,11 @@
794 ** rather than relying on file sizes and mtimes
795 ** -r VERSION The specific check-in to list
796 ** -R|--repository REPO Extract info from repository REPO
797 ** -t Sort output in time order
798 ** --tree Tree format
799 ** -u|--unicode-tree Use Unicode characters when drawing the tree
800 ** -v|--verbose Provide extra information about each file
801 **
802 ** See also: [[changes]], [[extras]], [[status]], [[tree]]
803 */
804 void ls_cmd(void){
@@ -852,11 +832,11 @@
832 unicodeTree = find_option("unicode-tree","u",0)!=0;
833 if( treeFmt ){
834 if( zRev==0 ) zRev = "current";
835 #ifdef _WIN32
836 treeFmt = 2;
837 #endif
838 if( unicodeTree ) treeFmt = 1;
839 if( asciiTree ) treeFmt = 2;
840 }
841
842 if( zRev!=0 ){
@@ -974,11 +954,11 @@
954 **
955 ** Options:
956 ** -a|--ascii-tree Use ASCII characters when drawing the tree
957 ** -r VERSION The specific check-in to list
958 ** -R|--repository REPO Extract info from repository REPO
959 ** -u|--unicode-tree Use Unicode characters when drawing the tree
960 **
961 ** See also: [[ls]]
962 */
963 void tree_cmd(void){
964 const char *zRev;
@@ -985,11 +965,11 @@
965 int treeFmt = 1;
966 int asciiTree = find_option("ascii-tree","a",0)!=0;
967 int unicodeTree = find_option("unicode-tree","u",0)!=0;
968 #ifdef _WIN32
969 treeFmt = 2;
970 #endif
971 if( unicodeTree ) treeFmt = 1;
972 if( asciiTree ) treeFmt = 2;
973 zRev = find_option("r","r",1);
974 if( zRev==0 ) zRev = "current";
975 db_find_and_open_repository(0, 0);
@@ -1024,11 +1004,11 @@
1004 ** --header Identify the repository if there are extras
1005 ** --ignore CSG Ignore files matching patterns from the argument
1006 ** --rel-paths Display pathnames relative to the current working
1007 ** directory
1008 ** --tree Show output in the tree format
1009 ** -u|--unicode-tree Use Unicode characters when drawing the tree
1010 **
1011 ** See also: [[changes]], [[clean]], [[status]]
1012 */
1013 void extras_cmd(void){
1014 Blob report = BLOB_INITIALIZER;
@@ -1052,11 +1032,11 @@
1032
1033 if( treeFmt ){
1034 flags &= ~C_RELPATH;
1035 #ifdef _WIN32
1036 treeFmt = 2;
1037 #endif
1038 if( unicodeTree ) treeFmt = 1;
1039 if( asciiTree ) treeFmt = 2;
1040 }
1041
1042 /* We should be done with options.. */
1043

Keyboard Shortcuts

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