Fossil SCM
option to separate filenames w/ NULL instead of whitespace. Eases operations w/ whitespace-containing filenames
Commit
6e88c64bb28eb48b8d8e6c793be63da3ed91aba59b264837da6f2cf4078755f0
Parent
17525ceddb79e37…
1 file changed
+11
-2
+11
-2
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -675,25 +675,30 @@ | ||
| 675 | 675 | ** --age Show when each file was committed. |
| 676 | 676 | ** -v|--verbose Provide extra information about each file. |
| 677 | 677 | ** -t Sort output in time order. |
| 678 | 678 | ** -r VERSION The specific check-in to list. |
| 679 | 679 | ** -R|--repository FILE Extract info from repository FILE. |
| 680 | +** -0 Use NULL instead of whitespace to separate | |
| 681 | +** filenames | |
| 680 | 682 | ** |
| 681 | 683 | ** See also: changes, extras, status |
| 682 | 684 | */ |
| 683 | 685 | void ls_cmd(void){ |
| 684 | 686 | int vid; |
| 685 | 687 | Stmt q; |
| 686 | 688 | int verboseFlag; |
| 689 | + int nullSeparateFlag; | |
| 690 | + char separator = '\n'; | |
| 687 | 691 | int showAge; |
| 688 | 692 | int timeOrder; |
| 689 | 693 | char *zOrderBy = "pathname"; |
| 690 | 694 | Blob where; |
| 691 | 695 | int i; |
| 692 | 696 | const char *zName; |
| 693 | 697 | const char *zRev; |
| 694 | 698 | |
| 699 | + nullSeparateFlag = find_option("0", "0", 0)!=0; | |
| 695 | 700 | verboseFlag = find_option("verbose","v", 0)!=0; |
| 696 | 701 | if( !verboseFlag ){ |
| 697 | 702 | verboseFlag = find_option("l","l", 0)!=0; /* deprecated */ |
| 698 | 703 | } |
| 699 | 704 | showAge = find_option("age",0,0)!=0; |
| @@ -792,14 +797,18 @@ | ||
| 792 | 797 | type = "RENAMED "; |
| 793 | 798 | }else{ |
| 794 | 799 | type = "UNCHANGED "; |
| 795 | 800 | } |
| 796 | 801 | } |
| 802 | + if (nullSeparateFlag) | |
| 803 | + separator='\0'; | |
| 797 | 804 | if( showAge ){ |
| 798 | - fossil_print("%s%s %s\n", type, db_column_text(&q, 5), zPathname); | |
| 805 | + fossil_print("%s%s %s%c", type, db_column_text(&q, 5), zPathname, separator); | |
| 806 | + if (nullSeparateFlag) putchar('\0'); | |
| 799 | 807 | }else{ |
| 800 | - fossil_print("%s%s\n", type, zPathname); | |
| 808 | + fossil_print("%s%s%c", type, zPathname, separator); | |
| 809 | + if (nullSeparateFlag) putchar('\0'); | |
| 801 | 810 | } |
| 802 | 811 | free(zFullName); |
| 803 | 812 | } |
| 804 | 813 | db_finalize(&q); |
| 805 | 814 | } |
| 806 | 815 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -675,25 +675,30 @@ | |
| 675 | ** --age Show when each file was committed. |
| 676 | ** -v|--verbose Provide extra information about each file. |
| 677 | ** -t Sort output in time order. |
| 678 | ** -r VERSION The specific check-in to list. |
| 679 | ** -R|--repository FILE Extract info from repository FILE. |
| 680 | ** |
| 681 | ** See also: changes, extras, status |
| 682 | */ |
| 683 | void ls_cmd(void){ |
| 684 | int vid; |
| 685 | Stmt q; |
| 686 | int verboseFlag; |
| 687 | int showAge; |
| 688 | int timeOrder; |
| 689 | char *zOrderBy = "pathname"; |
| 690 | Blob where; |
| 691 | int i; |
| 692 | const char *zName; |
| 693 | const char *zRev; |
| 694 | |
| 695 | verboseFlag = find_option("verbose","v", 0)!=0; |
| 696 | if( !verboseFlag ){ |
| 697 | verboseFlag = find_option("l","l", 0)!=0; /* deprecated */ |
| 698 | } |
| 699 | showAge = find_option("age",0,0)!=0; |
| @@ -792,14 +797,18 @@ | |
| 792 | type = "RENAMED "; |
| 793 | }else{ |
| 794 | type = "UNCHANGED "; |
| 795 | } |
| 796 | } |
| 797 | if( showAge ){ |
| 798 | fossil_print("%s%s %s\n", type, db_column_text(&q, 5), zPathname); |
| 799 | }else{ |
| 800 | fossil_print("%s%s\n", type, zPathname); |
| 801 | } |
| 802 | free(zFullName); |
| 803 | } |
| 804 | db_finalize(&q); |
| 805 | } |
| 806 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -675,25 +675,30 @@ | |
| 675 | ** --age Show when each file was committed. |
| 676 | ** -v|--verbose Provide extra information about each file. |
| 677 | ** -t Sort output in time order. |
| 678 | ** -r VERSION The specific check-in to list. |
| 679 | ** -R|--repository FILE Extract info from repository FILE. |
| 680 | ** -0 Use NULL instead of whitespace to separate |
| 681 | ** filenames |
| 682 | ** |
| 683 | ** See also: changes, extras, status |
| 684 | */ |
| 685 | void ls_cmd(void){ |
| 686 | int vid; |
| 687 | Stmt q; |
| 688 | int verboseFlag; |
| 689 | int nullSeparateFlag; |
| 690 | char separator = '\n'; |
| 691 | int showAge; |
| 692 | int timeOrder; |
| 693 | char *zOrderBy = "pathname"; |
| 694 | Blob where; |
| 695 | int i; |
| 696 | const char *zName; |
| 697 | const char *zRev; |
| 698 | |
| 699 | nullSeparateFlag = find_option("0", "0", 0)!=0; |
| 700 | verboseFlag = find_option("verbose","v", 0)!=0; |
| 701 | if( !verboseFlag ){ |
| 702 | verboseFlag = find_option("l","l", 0)!=0; /* deprecated */ |
| 703 | } |
| 704 | showAge = find_option("age",0,0)!=0; |
| @@ -792,14 +797,18 @@ | |
| 797 | type = "RENAMED "; |
| 798 | }else{ |
| 799 | type = "UNCHANGED "; |
| 800 | } |
| 801 | } |
| 802 | if (nullSeparateFlag) |
| 803 | separator='\0'; |
| 804 | if( showAge ){ |
| 805 | fossil_print("%s%s %s%c", type, db_column_text(&q, 5), zPathname, separator); |
| 806 | if (nullSeparateFlag) putchar('\0'); |
| 807 | }else{ |
| 808 | fossil_print("%s%s%c", type, zPathname, separator); |
| 809 | if (nullSeparateFlag) putchar('\0'); |
| 810 | } |
| 811 | free(zFullName); |
| 812 | } |
| 813 | db_finalize(&q); |
| 814 | } |
| 815 |