Fossil SCM

Use SHA3 to identify unversioned files, if the hash policy is sha3 or higher.

drh 2020-03-07 16:56 trunk
Commit 17525ceddb79e375e58761b055ccf169341aa1342bf3ec4098d8d917d2289eec
1 file changed +3 -3
--- src/unversioned.c
+++ src/unversioned.c
@@ -119,11 +119,11 @@
119119
120120
db_prepare(&ins,
121121
"REPLACE INTO unversioned(name,rcvid,mtime,hash,sz,encoding,content)"
122122
" VALUES(:name,:rcvid,:mtime,:hash,:sz,:encoding,:content)"
123123
);
124
- sha1sum_blob(pContent, &hash);
124
+ hname_hash(pContent, 0, &hash);
125125
blob_compress(pContent, &compressed);
126126
db_bind_text(&ins, ":name", zUVFile);
127127
db_bind_int(&ins, ":rcvid", g.rcvid);
128128
db_bind_int64(&ins, ":mtime", mtime);
129129
db_bind_text(&ins, ":hash", blob_str(&hash));
@@ -143,11 +143,11 @@
143143
}
144144
145145
146146
/*
147147
** Check the status of unversioned file zName. "mtime" and "zHash" are the
148
-** time of last change and SHA1 hash of a copy of this file on a remote
148
+** time of last change and hash of a copy of this file on a remote
149149
** server. Return an integer status code as follows:
150150
**
151151
** 0: zName does not exist in the unversioned table.
152152
** 1: zName exists and should be replaced by the mtime/zHash remote.
153153
** 2: zName exists and is the same as zHash but has a older mtime
@@ -526,11 +526,11 @@
526526
@ <thead><tr>
527527
@ <th> Name
528528
@ <th> Age
529529
@ <th> Size
530530
@ <th> User
531
- @ <th> SHA1
531
+ @ <th> Hash
532532
if( g.perm.Admin ){
533533
@ <th> rcvid
534534
}
535535
@ </tr></thead>
536536
@ <tbody>
537537
--- src/unversioned.c
+++ src/unversioned.c
@@ -119,11 +119,11 @@
119
120 db_prepare(&ins,
121 "REPLACE INTO unversioned(name,rcvid,mtime,hash,sz,encoding,content)"
122 " VALUES(:name,:rcvid,:mtime,:hash,:sz,:encoding,:content)"
123 );
124 sha1sum_blob(pContent, &hash);
125 blob_compress(pContent, &compressed);
126 db_bind_text(&ins, ":name", zUVFile);
127 db_bind_int(&ins, ":rcvid", g.rcvid);
128 db_bind_int64(&ins, ":mtime", mtime);
129 db_bind_text(&ins, ":hash", blob_str(&hash));
@@ -143,11 +143,11 @@
143 }
144
145
146 /*
147 ** Check the status of unversioned file zName. "mtime" and "zHash" are the
148 ** time of last change and SHA1 hash of a copy of this file on a remote
149 ** server. Return an integer status code as follows:
150 **
151 ** 0: zName does not exist in the unversioned table.
152 ** 1: zName exists and should be replaced by the mtime/zHash remote.
153 ** 2: zName exists and is the same as zHash but has a older mtime
@@ -526,11 +526,11 @@
526 @ <thead><tr>
527 @ <th> Name
528 @ <th> Age
529 @ <th> Size
530 @ <th> User
531 @ <th> SHA1
532 if( g.perm.Admin ){
533 @ <th> rcvid
534 }
535 @ </tr></thead>
536 @ <tbody>
537
--- src/unversioned.c
+++ src/unversioned.c
@@ -119,11 +119,11 @@
119
120 db_prepare(&ins,
121 "REPLACE INTO unversioned(name,rcvid,mtime,hash,sz,encoding,content)"
122 " VALUES(:name,:rcvid,:mtime,:hash,:sz,:encoding,:content)"
123 );
124 hname_hash(pContent, 0, &hash);
125 blob_compress(pContent, &compressed);
126 db_bind_text(&ins, ":name", zUVFile);
127 db_bind_int(&ins, ":rcvid", g.rcvid);
128 db_bind_int64(&ins, ":mtime", mtime);
129 db_bind_text(&ins, ":hash", blob_str(&hash));
@@ -143,11 +143,11 @@
143 }
144
145
146 /*
147 ** Check the status of unversioned file zName. "mtime" and "zHash" are the
148 ** time of last change and hash of a copy of this file on a remote
149 ** server. Return an integer status code as follows:
150 **
151 ** 0: zName does not exist in the unversioned table.
152 ** 1: zName exists and should be replaced by the mtime/zHash remote.
153 ** 2: zName exists and is the same as zHash but has a older mtime
@@ -526,11 +526,11 @@
526 @ <thead><tr>
527 @ <th> Name
528 @ <th> Age
529 @ <th> Size
530 @ <th> User
531 @ <th> Hash
532 if( g.perm.Admin ){
533 @ <th> rcvid
534 }
535 @ </tr></thead>
536 @ <tbody>
537

Keyboard Shortcuts

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