Fossil SCM
Added --hash flag to ls -v, for consistency with status/changes, per [https://fossil-scm.org/forum/forumpost/896de8f963].
Commit
15001dd013152b71f3254d445ee702d37e541ce12c04815ea8e3ec8be457e331
Parent
068e26af37d7f64…
1 file changed
+7
-1
+7
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -678,10 +678,12 @@ | ||
| 678 | 678 | ** --age Show when each file was committed. |
| 679 | 679 | ** -v|--verbose Provide extra information about each file. |
| 680 | 680 | ** -t Sort output in time order. |
| 681 | 681 | ** -r VERSION The specific check-in to list. |
| 682 | 682 | ** -R|--repository FILE Extract info from repository FILE. |
| 683 | +** --hash With -v, verify file status using hashing | |
| 684 | +** rather than relying on file sizes and mtimes. | |
| 683 | 685 | ** |
| 684 | 686 | ** See also: [[changes]], [[extras]], [[status]] |
| 685 | 687 | */ |
| 686 | 688 | void ls_cmd(void){ |
| 687 | 689 | int vid; |
| @@ -690,10 +692,11 @@ | ||
| 690 | 692 | int showAge; |
| 691 | 693 | int timeOrder; |
| 692 | 694 | char *zOrderBy = "pathname"; |
| 693 | 695 | Blob where; |
| 694 | 696 | int i; |
| 697 | + int useHash = 0; | |
| 695 | 698 | const char *zName; |
| 696 | 699 | const char *zRev; |
| 697 | 700 | |
| 698 | 701 | verboseFlag = find_option("verbose","v", 0)!=0; |
| 699 | 702 | if( !verboseFlag ){ |
| @@ -700,10 +703,13 @@ | ||
| 700 | 703 | verboseFlag = find_option("l","l", 0)!=0; /* deprecated */ |
| 701 | 704 | } |
| 702 | 705 | showAge = find_option("age",0,0)!=0; |
| 703 | 706 | zRev = find_option("r","r",1); |
| 704 | 707 | timeOrder = find_option("t","t",0)!=0; |
| 708 | + if( verboseFlag ){ | |
| 709 | + useHash = find_option("hash",0,0)!=0 || find_option("sha1sum",0,0)!=0; | |
| 710 | + } | |
| 705 | 711 | |
| 706 | 712 | if( zRev!=0 ){ |
| 707 | 713 | db_find_and_open_repository(0, 0); |
| 708 | 714 | verify_all_options(); |
| 709 | 715 | ls_cmd_rev(zRev,verboseFlag,showAge,timeOrder); |
| @@ -737,11 +743,11 @@ | ||
| 737 | 743 | (blob_size(&where)>0) ? "OR" : "WHERE", zName, |
| 738 | 744 | filename_collation(), zName, filename_collation(), |
| 739 | 745 | zName, filename_collation() |
| 740 | 746 | ); |
| 741 | 747 | } |
| 742 | - vfile_check_signature(vid, 0); | |
| 748 | + vfile_check_signature(vid, useHash ? CKSIG_HASH : 0); | |
| 743 | 749 | if( showAge ){ |
| 744 | 750 | db_prepare(&q, |
| 745 | 751 | "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)," |
| 746 | 752 | " datetime(checkin_mtime(%d,rid),'unixepoch',toLocal())" |
| 747 | 753 | " FROM vfile %s" |
| 748 | 754 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -678,10 +678,12 @@ | |
| 678 | ** --age Show when each file was committed. |
| 679 | ** -v|--verbose Provide extra information about each file. |
| 680 | ** -t Sort output in time order. |
| 681 | ** -r VERSION The specific check-in to list. |
| 682 | ** -R|--repository FILE Extract info from repository FILE. |
| 683 | ** |
| 684 | ** See also: [[changes]], [[extras]], [[status]] |
| 685 | */ |
| 686 | void ls_cmd(void){ |
| 687 | int vid; |
| @@ -690,10 +692,11 @@ | |
| 690 | int showAge; |
| 691 | int timeOrder; |
| 692 | char *zOrderBy = "pathname"; |
| 693 | Blob where; |
| 694 | int i; |
| 695 | const char *zName; |
| 696 | const char *zRev; |
| 697 | |
| 698 | verboseFlag = find_option("verbose","v", 0)!=0; |
| 699 | if( !verboseFlag ){ |
| @@ -700,10 +703,13 @@ | |
| 700 | verboseFlag = find_option("l","l", 0)!=0; /* deprecated */ |
| 701 | } |
| 702 | showAge = find_option("age",0,0)!=0; |
| 703 | zRev = find_option("r","r",1); |
| 704 | timeOrder = find_option("t","t",0)!=0; |
| 705 | |
| 706 | if( zRev!=0 ){ |
| 707 | db_find_and_open_repository(0, 0); |
| 708 | verify_all_options(); |
| 709 | ls_cmd_rev(zRev,verboseFlag,showAge,timeOrder); |
| @@ -737,11 +743,11 @@ | |
| 737 | (blob_size(&where)>0) ? "OR" : "WHERE", zName, |
| 738 | filename_collation(), zName, filename_collation(), |
| 739 | zName, filename_collation() |
| 740 | ); |
| 741 | } |
| 742 | vfile_check_signature(vid, 0); |
| 743 | if( showAge ){ |
| 744 | db_prepare(&q, |
| 745 | "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)," |
| 746 | " datetime(checkin_mtime(%d,rid),'unixepoch',toLocal())" |
| 747 | " FROM vfile %s" |
| 748 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -678,10 +678,12 @@ | |
| 678 | ** --age Show when each file was committed. |
| 679 | ** -v|--verbose Provide extra information about each file. |
| 680 | ** -t Sort output in time order. |
| 681 | ** -r VERSION The specific check-in to list. |
| 682 | ** -R|--repository FILE Extract info from repository FILE. |
| 683 | ** --hash With -v, verify file status using hashing |
| 684 | ** rather than relying on file sizes and mtimes. |
| 685 | ** |
| 686 | ** See also: [[changes]], [[extras]], [[status]] |
| 687 | */ |
| 688 | void ls_cmd(void){ |
| 689 | int vid; |
| @@ -690,10 +692,11 @@ | |
| 692 | int showAge; |
| 693 | int timeOrder; |
| 694 | char *zOrderBy = "pathname"; |
| 695 | Blob where; |
| 696 | int i; |
| 697 | int useHash = 0; |
| 698 | const char *zName; |
| 699 | const char *zRev; |
| 700 | |
| 701 | verboseFlag = find_option("verbose","v", 0)!=0; |
| 702 | if( !verboseFlag ){ |
| @@ -700,10 +703,13 @@ | |
| 703 | verboseFlag = find_option("l","l", 0)!=0; /* deprecated */ |
| 704 | } |
| 705 | showAge = find_option("age",0,0)!=0; |
| 706 | zRev = find_option("r","r",1); |
| 707 | timeOrder = find_option("t","t",0)!=0; |
| 708 | if( verboseFlag ){ |
| 709 | useHash = find_option("hash",0,0)!=0 || find_option("sha1sum",0,0)!=0; |
| 710 | } |
| 711 | |
| 712 | if( zRev!=0 ){ |
| 713 | db_find_and_open_repository(0, 0); |
| 714 | verify_all_options(); |
| 715 | ls_cmd_rev(zRev,verboseFlag,showAge,timeOrder); |
| @@ -737,11 +743,11 @@ | |
| 743 | (blob_size(&where)>0) ? "OR" : "WHERE", zName, |
| 744 | filename_collation(), zName, filename_collation(), |
| 745 | zName, filename_collation() |
| 746 | ); |
| 747 | } |
| 748 | vfile_check_signature(vid, useHash ? CKSIG_HASH : 0); |
| 749 | if( showAge ){ |
| 750 | db_prepare(&q, |
| 751 | "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)," |
| 752 | " datetime(checkin_mtime(%d,rid),'unixepoch',toLocal())" |
| 753 | " FROM vfile %s" |
| 754 |