Fossil SCM

Added --hash flag to ls -v, for consistency with status/changes, per [https://fossil-scm.org/forum/forumpost/896de8f963].

stephan 2020-10-02 09:38 trunk
Commit 15001dd013152b71f3254d445ee702d37e541ce12c04815ea8e3ec8be457e331
1 file changed +7 -1
+7 -1
--- src/checkin.c
+++ src/checkin.c
@@ -678,10 +678,12 @@
678678
** --age Show when each file was committed.
679679
** -v|--verbose Provide extra information about each file.
680680
** -t Sort output in time order.
681681
** -r VERSION The specific check-in to list.
682682
** -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.
683685
**
684686
** See also: [[changes]], [[extras]], [[status]]
685687
*/
686688
void ls_cmd(void){
687689
int vid;
@@ -690,10 +692,11 @@
690692
int showAge;
691693
int timeOrder;
692694
char *zOrderBy = "pathname";
693695
Blob where;
694696
int i;
697
+ int useHash = 0;
695698
const char *zName;
696699
const char *zRev;
697700
698701
verboseFlag = find_option("verbose","v", 0)!=0;
699702
if( !verboseFlag ){
@@ -700,10 +703,13 @@
700703
verboseFlag = find_option("l","l", 0)!=0; /* deprecated */
701704
}
702705
showAge = find_option("age",0,0)!=0;
703706
zRev = find_option("r","r",1);
704707
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
+ }
705711
706712
if( zRev!=0 ){
707713
db_find_and_open_repository(0, 0);
708714
verify_all_options();
709715
ls_cmd_rev(zRev,verboseFlag,showAge,timeOrder);
@@ -737,11 +743,11 @@
737743
(blob_size(&where)>0) ? "OR" : "WHERE", zName,
738744
filename_collation(), zName, filename_collation(),
739745
zName, filename_collation()
740746
);
741747
}
742
- vfile_check_signature(vid, 0);
748
+ vfile_check_signature(vid, useHash ? CKSIG_HASH : 0);
743749
if( showAge ){
744750
db_prepare(&q,
745751
"SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0),"
746752
" datetime(checkin_mtime(%d,rid),'unixepoch',toLocal())"
747753
" FROM vfile %s"
748754
--- 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

Keyboard Shortcuts

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