Fossil SCM
Change the --sha1sum options on "fossil commit" and "fossil status" to be --hash, since it is no longer restricted to a single hash algorithm.
Commit
1f61b2dc88ebca720f26ab116b1d3248ce6c7075
Parent
1c8768b0deed45e…
2 files changed
+9
-9
+2
-2
+9
-9
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -412,11 +412,11 @@ | ||
| 412 | 412 | ** |
| 413 | 413 | ** General options: |
| 414 | 414 | ** --abs-paths Display absolute pathnames. |
| 415 | 415 | ** --rel-paths Display pathnames relative to the current working |
| 416 | 416 | ** directory. |
| 417 | -** --sha1sum Verify file status using SHA1 hashing rather than | |
| 417 | +** --hash Verify file status using hashing rather than | |
| 418 | 418 | ** relying on file mtimes. |
| 419 | 419 | ** --case-sensitive <BOOL> Override case-sensitive setting. |
| 420 | 420 | ** --dotfiles Include unmanaged files beginning with a dot. |
| 421 | 421 | ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns. |
| 422 | 422 | ** --no-dir-symlinks Disables support for directory symlinks. |
| @@ -464,11 +464,11 @@ | ||
| 464 | 464 | {"no-merge", C_MERGE }, {"no-classify", C_CLASSIFY }, |
| 465 | 465 | }; |
| 466 | 466 | |
| 467 | 467 | Blob report = BLOB_INITIALIZER; |
| 468 | 468 | enum {CHANGES, STATUS} command = *g.argv[1]=='s' ? STATUS : CHANGES; |
| 469 | - int useSha1sum = find_option("sha1sum", 0, 0)!=0; | |
| 469 | + int useHash = find_option("hash", 0, 0)!=0; | |
| 470 | 470 | int showHdr = command==CHANGES && find_option("header", 0, 0); |
| 471 | 471 | int verboseFlag = command==CHANGES && find_option("verbose", "v", 0); |
| 472 | 472 | const char *zIgnoreFlag = find_option("ignore", 0, 1); |
| 473 | 473 | unsigned scanFlags = 0; |
| 474 | 474 | unsigned flags = 0; |
| @@ -528,11 +528,11 @@ | ||
| 528 | 528 | |
| 529 | 529 | /* We should be done with options. */ |
| 530 | 530 | verify_all_options(); |
| 531 | 531 | |
| 532 | 532 | /* Check for changed files. */ |
| 533 | - vfile_check_signature(vid, useSha1sum ? CKSIG_SHA1 : 0); | |
| 533 | + vfile_check_signature(vid, useHash ? CKSIG_HASH : 0); | |
| 534 | 534 | |
| 535 | 535 | /* Search for unmanaged files if requested. */ |
| 536 | 536 | if( flags & C_EXTRA ){ |
| 537 | 537 | Glob *pIgnore = glob_create(zIgnoreFlag); |
| 538 | 538 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| @@ -1985,12 +1985,12 @@ | ||
| 1985 | 1985 | ** The --private option creates a private check-in that is never synced. |
| 1986 | 1986 | ** Children of private check-ins are automatically private. |
| 1987 | 1987 | ** |
| 1988 | 1988 | ** The --tag option applies the symbolic tag name to the check-in. |
| 1989 | 1989 | ** |
| 1990 | -** The --sha1sum option detects edited files by computing each file's | |
| 1991 | -** SHA1 hash rather than just checking for changes to its size or mtime. | |
| 1990 | +** The --hash option detects edited files by computing each file's | |
| 1991 | +** artifact hash rather than just checking for changes to its size or mtime. | |
| 1992 | 1992 | ** |
| 1993 | 1993 | ** Options: |
| 1994 | 1994 | ** --allow-conflict allow unresolved merge conflicts |
| 1995 | 1995 | ** --allow-empty allow a commit with no changes |
| 1996 | 1996 | ** --allow-fork allow the commit to fork |
| @@ -2010,11 +2010,11 @@ | ||
| 2010 | 2010 | ** input and assumes an answer of 'No' for every |
| 2011 | 2011 | ** question. |
| 2012 | 2012 | ** --no-warnings omit all warnings about file contents |
| 2013 | 2013 | ** --nosign do not attempt to sign this commit with gpg |
| 2014 | 2014 | ** --private do not sync changes and their descendants |
| 2015 | -** --sha1sum verify file status using SHA1 hashing rather | |
| 2015 | +** --hash verify file status using hashing rather | |
| 2016 | 2016 | ** than relying on file mtimes |
| 2017 | 2017 | ** --tag TAG-NAME assign given tag TAG-NAME to the check-in |
| 2018 | 2018 | ** --date-override DATETIME DATE to use instead of 'now' |
| 2019 | 2019 | ** --user-override USER USER to use instead of the current default |
| 2020 | 2020 | ** |
| @@ -2033,11 +2033,11 @@ | ||
| 2033 | 2033 | int nvid; /* Blob-id of the new check-in */ |
| 2034 | 2034 | Blob comment; /* Check-in comment */ |
| 2035 | 2035 | const char *zComment; /* Check-in comment */ |
| 2036 | 2036 | Stmt q; /* Various queries */ |
| 2037 | 2037 | char *zUuid; /* UUID of the new check-in */ |
| 2038 | - int useSha1sum = 0; /* True to verify file status using SHA1 hashing */ | |
| 2038 | + int useHash = 0; /* True to verify file status using SHA1 hashing */ | |
| 2039 | 2039 | int noSign = 0; /* True to omit signing the manifest using GPG */ |
| 2040 | 2040 | int isAMerge = 0; /* True if checking in a merge */ |
| 2041 | 2041 | int noWarningFlag = 0; /* True if skipping all warnings */ |
| 2042 | 2042 | int noPrompt = 0; /* True if skipping all prompts */ |
| 2043 | 2043 | int forceFlag = 0; /* Undocumented: Disables all checks */ |
| @@ -2068,11 +2068,11 @@ | ||
| 2068 | 2068 | Blob ans; |
| 2069 | 2069 | char cReply; |
| 2070 | 2070 | |
| 2071 | 2071 | memset(&sCiInfo, 0, sizeof(sCiInfo)); |
| 2072 | 2072 | url_proxy_options(); |
| 2073 | - useSha1sum = find_option("sha1sum", 0, 0)!=0; | |
| 2073 | + useHash = find_option("hash", 0, 0)!=0; | |
| 2074 | 2074 | noSign = find_option("nosign",0,0)!=0; |
| 2075 | 2075 | forceDelta = find_option("delta",0,0)!=0; |
| 2076 | 2076 | forceBaseline = find_option("baseline",0,0)!=0; |
| 2077 | 2077 | if( forceDelta && forceBaseline ){ |
| 2078 | 2078 | fossil_fatal("cannot use --delta and --baseline together"); |
| @@ -2232,11 +2232,11 @@ | ||
| 2232 | 2232 | */ |
| 2233 | 2233 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 2234 | 2234 | fossil_fatal("no such user: %s", g.zLogin); |
| 2235 | 2235 | } |
| 2236 | 2236 | |
| 2237 | - hasChanges = unsaved_changes(useSha1sum ? CKSIG_SHA1 : 0); | |
| 2237 | + hasChanges = unsaved_changes(useHash ? CKSIG_HASH : 0); | |
| 2238 | 2238 | db_begin_transaction(); |
| 2239 | 2239 | db_record_repository_filename(0); |
| 2240 | 2240 | if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){ |
| 2241 | 2241 | fossil_fatal("nothing has changed; use --allow-empty to override"); |
| 2242 | 2242 | } |
| 2243 | 2243 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -412,11 +412,11 @@ | |
| 412 | ** |
| 413 | ** General options: |
| 414 | ** --abs-paths Display absolute pathnames. |
| 415 | ** --rel-paths Display pathnames relative to the current working |
| 416 | ** directory. |
| 417 | ** --sha1sum Verify file status using SHA1 hashing rather than |
| 418 | ** relying on file mtimes. |
| 419 | ** --case-sensitive <BOOL> Override case-sensitive setting. |
| 420 | ** --dotfiles Include unmanaged files beginning with a dot. |
| 421 | ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns. |
| 422 | ** --no-dir-symlinks Disables support for directory symlinks. |
| @@ -464,11 +464,11 @@ | |
| 464 | {"no-merge", C_MERGE }, {"no-classify", C_CLASSIFY }, |
| 465 | }; |
| 466 | |
| 467 | Blob report = BLOB_INITIALIZER; |
| 468 | enum {CHANGES, STATUS} command = *g.argv[1]=='s' ? STATUS : CHANGES; |
| 469 | int useSha1sum = find_option("sha1sum", 0, 0)!=0; |
| 470 | int showHdr = command==CHANGES && find_option("header", 0, 0); |
| 471 | int verboseFlag = command==CHANGES && find_option("verbose", "v", 0); |
| 472 | const char *zIgnoreFlag = find_option("ignore", 0, 1); |
| 473 | unsigned scanFlags = 0; |
| 474 | unsigned flags = 0; |
| @@ -528,11 +528,11 @@ | |
| 528 | |
| 529 | /* We should be done with options. */ |
| 530 | verify_all_options(); |
| 531 | |
| 532 | /* Check for changed files. */ |
| 533 | vfile_check_signature(vid, useSha1sum ? CKSIG_SHA1 : 0); |
| 534 | |
| 535 | /* Search for unmanaged files if requested. */ |
| 536 | if( flags & C_EXTRA ){ |
| 537 | Glob *pIgnore = glob_create(zIgnoreFlag); |
| 538 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| @@ -1985,12 +1985,12 @@ | |
| 1985 | ** The --private option creates a private check-in that is never synced. |
| 1986 | ** Children of private check-ins are automatically private. |
| 1987 | ** |
| 1988 | ** The --tag option applies the symbolic tag name to the check-in. |
| 1989 | ** |
| 1990 | ** The --sha1sum option detects edited files by computing each file's |
| 1991 | ** SHA1 hash rather than just checking for changes to its size or mtime. |
| 1992 | ** |
| 1993 | ** Options: |
| 1994 | ** --allow-conflict allow unresolved merge conflicts |
| 1995 | ** --allow-empty allow a commit with no changes |
| 1996 | ** --allow-fork allow the commit to fork |
| @@ -2010,11 +2010,11 @@ | |
| 2010 | ** input and assumes an answer of 'No' for every |
| 2011 | ** question. |
| 2012 | ** --no-warnings omit all warnings about file contents |
| 2013 | ** --nosign do not attempt to sign this commit with gpg |
| 2014 | ** --private do not sync changes and their descendants |
| 2015 | ** --sha1sum verify file status using SHA1 hashing rather |
| 2016 | ** than relying on file mtimes |
| 2017 | ** --tag TAG-NAME assign given tag TAG-NAME to the check-in |
| 2018 | ** --date-override DATETIME DATE to use instead of 'now' |
| 2019 | ** --user-override USER USER to use instead of the current default |
| 2020 | ** |
| @@ -2033,11 +2033,11 @@ | |
| 2033 | int nvid; /* Blob-id of the new check-in */ |
| 2034 | Blob comment; /* Check-in comment */ |
| 2035 | const char *zComment; /* Check-in comment */ |
| 2036 | Stmt q; /* Various queries */ |
| 2037 | char *zUuid; /* UUID of the new check-in */ |
| 2038 | int useSha1sum = 0; /* True to verify file status using SHA1 hashing */ |
| 2039 | int noSign = 0; /* True to omit signing the manifest using GPG */ |
| 2040 | int isAMerge = 0; /* True if checking in a merge */ |
| 2041 | int noWarningFlag = 0; /* True if skipping all warnings */ |
| 2042 | int noPrompt = 0; /* True if skipping all prompts */ |
| 2043 | int forceFlag = 0; /* Undocumented: Disables all checks */ |
| @@ -2068,11 +2068,11 @@ | |
| 2068 | Blob ans; |
| 2069 | char cReply; |
| 2070 | |
| 2071 | memset(&sCiInfo, 0, sizeof(sCiInfo)); |
| 2072 | url_proxy_options(); |
| 2073 | useSha1sum = find_option("sha1sum", 0, 0)!=0; |
| 2074 | noSign = find_option("nosign",0,0)!=0; |
| 2075 | forceDelta = find_option("delta",0,0)!=0; |
| 2076 | forceBaseline = find_option("baseline",0,0)!=0; |
| 2077 | if( forceDelta && forceBaseline ){ |
| 2078 | fossil_fatal("cannot use --delta and --baseline together"); |
| @@ -2232,11 +2232,11 @@ | |
| 2232 | */ |
| 2233 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 2234 | fossil_fatal("no such user: %s", g.zLogin); |
| 2235 | } |
| 2236 | |
| 2237 | hasChanges = unsaved_changes(useSha1sum ? CKSIG_SHA1 : 0); |
| 2238 | db_begin_transaction(); |
| 2239 | db_record_repository_filename(0); |
| 2240 | if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){ |
| 2241 | fossil_fatal("nothing has changed; use --allow-empty to override"); |
| 2242 | } |
| 2243 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -412,11 +412,11 @@ | |
| 412 | ** |
| 413 | ** General options: |
| 414 | ** --abs-paths Display absolute pathnames. |
| 415 | ** --rel-paths Display pathnames relative to the current working |
| 416 | ** directory. |
| 417 | ** --hash Verify file status using hashing rather than |
| 418 | ** relying on file mtimes. |
| 419 | ** --case-sensitive <BOOL> Override case-sensitive setting. |
| 420 | ** --dotfiles Include unmanaged files beginning with a dot. |
| 421 | ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns. |
| 422 | ** --no-dir-symlinks Disables support for directory symlinks. |
| @@ -464,11 +464,11 @@ | |
| 464 | {"no-merge", C_MERGE }, {"no-classify", C_CLASSIFY }, |
| 465 | }; |
| 466 | |
| 467 | Blob report = BLOB_INITIALIZER; |
| 468 | enum {CHANGES, STATUS} command = *g.argv[1]=='s' ? STATUS : CHANGES; |
| 469 | int useHash = find_option("hash", 0, 0)!=0; |
| 470 | int showHdr = command==CHANGES && find_option("header", 0, 0); |
| 471 | int verboseFlag = command==CHANGES && find_option("verbose", "v", 0); |
| 472 | const char *zIgnoreFlag = find_option("ignore", 0, 1); |
| 473 | unsigned scanFlags = 0; |
| 474 | unsigned flags = 0; |
| @@ -528,11 +528,11 @@ | |
| 528 | |
| 529 | /* We should be done with options. */ |
| 530 | verify_all_options(); |
| 531 | |
| 532 | /* Check for changed files. */ |
| 533 | vfile_check_signature(vid, useHash ? CKSIG_HASH : 0); |
| 534 | |
| 535 | /* Search for unmanaged files if requested. */ |
| 536 | if( flags & C_EXTRA ){ |
| 537 | Glob *pIgnore = glob_create(zIgnoreFlag); |
| 538 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| @@ -1985,12 +1985,12 @@ | |
| 1985 | ** The --private option creates a private check-in that is never synced. |
| 1986 | ** Children of private check-ins are automatically private. |
| 1987 | ** |
| 1988 | ** The --tag option applies the symbolic tag name to the check-in. |
| 1989 | ** |
| 1990 | ** The --hash option detects edited files by computing each file's |
| 1991 | ** artifact hash rather than just checking for changes to its size or mtime. |
| 1992 | ** |
| 1993 | ** Options: |
| 1994 | ** --allow-conflict allow unresolved merge conflicts |
| 1995 | ** --allow-empty allow a commit with no changes |
| 1996 | ** --allow-fork allow the commit to fork |
| @@ -2010,11 +2010,11 @@ | |
| 2010 | ** input and assumes an answer of 'No' for every |
| 2011 | ** question. |
| 2012 | ** --no-warnings omit all warnings about file contents |
| 2013 | ** --nosign do not attempt to sign this commit with gpg |
| 2014 | ** --private do not sync changes and their descendants |
| 2015 | ** --hash verify file status using hashing rather |
| 2016 | ** than relying on file mtimes |
| 2017 | ** --tag TAG-NAME assign given tag TAG-NAME to the check-in |
| 2018 | ** --date-override DATETIME DATE to use instead of 'now' |
| 2019 | ** --user-override USER USER to use instead of the current default |
| 2020 | ** |
| @@ -2033,11 +2033,11 @@ | |
| 2033 | int nvid; /* Blob-id of the new check-in */ |
| 2034 | Blob comment; /* Check-in comment */ |
| 2035 | const char *zComment; /* Check-in comment */ |
| 2036 | Stmt q; /* Various queries */ |
| 2037 | char *zUuid; /* UUID of the new check-in */ |
| 2038 | int useHash = 0; /* True to verify file status using SHA1 hashing */ |
| 2039 | int noSign = 0; /* True to omit signing the manifest using GPG */ |
| 2040 | int isAMerge = 0; /* True if checking in a merge */ |
| 2041 | int noWarningFlag = 0; /* True if skipping all warnings */ |
| 2042 | int noPrompt = 0; /* True if skipping all prompts */ |
| 2043 | int forceFlag = 0; /* Undocumented: Disables all checks */ |
| @@ -2068,11 +2068,11 @@ | |
| 2068 | Blob ans; |
| 2069 | char cReply; |
| 2070 | |
| 2071 | memset(&sCiInfo, 0, sizeof(sCiInfo)); |
| 2072 | url_proxy_options(); |
| 2073 | useHash = find_option("hash", 0, 0)!=0; |
| 2074 | noSign = find_option("nosign",0,0)!=0; |
| 2075 | forceDelta = find_option("delta",0,0)!=0; |
| 2076 | forceBaseline = find_option("baseline",0,0)!=0; |
| 2077 | if( forceDelta && forceBaseline ){ |
| 2078 | fossil_fatal("cannot use --delta and --baseline together"); |
| @@ -2232,11 +2232,11 @@ | |
| 2232 | */ |
| 2233 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 2234 | fossil_fatal("no such user: %s", g.zLogin); |
| 2235 | } |
| 2236 | |
| 2237 | hasChanges = unsaved_changes(useHash ? CKSIG_HASH : 0); |
| 2238 | db_begin_transaction(); |
| 2239 | db_record_repository_filename(0); |
| 2240 | if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){ |
| 2241 | fossil_fatal("nothing has changed; use --allow-empty to override"); |
| 2242 | } |
| 2243 |
+2
-2
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -130,11 +130,11 @@ | ||
| 130 | 130 | /* |
| 131 | 131 | ** The cksigFlags parameter to vfile_check_signature() is an OR-ed |
| 132 | 132 | ** combination of the following bits: |
| 133 | 133 | */ |
| 134 | 134 | #define CKSIG_ENOTFILE 0x001 /* non-file FS objects throw an error */ |
| 135 | -#define CKSIG_SHA1 0x002 /* Verify file content using sha1sum */ | |
| 135 | +#define CKSIG_HASH 0x002 /* Verify file content using hashing */ | |
| 136 | 136 | #define CKSIG_SETMTIME 0x004 /* Set mtime to last check-out time */ |
| 137 | 137 | |
| 138 | 138 | #endif /* INTERFACE */ |
| 139 | 139 | |
| 140 | 140 | /* |
| @@ -172,11 +172,11 @@ | ||
| 172 | 172 | */ |
| 173 | 173 | void vfile_check_signature(int vid, unsigned int cksigFlags){ |
| 174 | 174 | int nErr = 0; |
| 175 | 175 | Stmt q; |
| 176 | 176 | Blob fileCksum, origCksum; |
| 177 | - int useMtime = (cksigFlags & CKSIG_SHA1)==0 | |
| 177 | + int useMtime = (cksigFlags & CKSIG_HASH)==0 | |
| 178 | 178 | && db_get_boolean("mtime-changes", 1); |
| 179 | 179 | |
| 180 | 180 | db_begin_transaction(); |
| 181 | 181 | db_prepare(&q, "SELECT id, %Q || pathname," |
| 182 | 182 | " vfile.mrid, deleted, chnged, uuid, size, mtime," |
| 183 | 183 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -130,11 +130,11 @@ | |
| 130 | /* |
| 131 | ** The cksigFlags parameter to vfile_check_signature() is an OR-ed |
| 132 | ** combination of the following bits: |
| 133 | */ |
| 134 | #define CKSIG_ENOTFILE 0x001 /* non-file FS objects throw an error */ |
| 135 | #define CKSIG_SHA1 0x002 /* Verify file content using sha1sum */ |
| 136 | #define CKSIG_SETMTIME 0x004 /* Set mtime to last check-out time */ |
| 137 | |
| 138 | #endif /* INTERFACE */ |
| 139 | |
| 140 | /* |
| @@ -172,11 +172,11 @@ | |
| 172 | */ |
| 173 | void vfile_check_signature(int vid, unsigned int cksigFlags){ |
| 174 | int nErr = 0; |
| 175 | Stmt q; |
| 176 | Blob fileCksum, origCksum; |
| 177 | int useMtime = (cksigFlags & CKSIG_SHA1)==0 |
| 178 | && db_get_boolean("mtime-changes", 1); |
| 179 | |
| 180 | db_begin_transaction(); |
| 181 | db_prepare(&q, "SELECT id, %Q || pathname," |
| 182 | " vfile.mrid, deleted, chnged, uuid, size, mtime," |
| 183 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -130,11 +130,11 @@ | |
| 130 | /* |
| 131 | ** The cksigFlags parameter to vfile_check_signature() is an OR-ed |
| 132 | ** combination of the following bits: |
| 133 | */ |
| 134 | #define CKSIG_ENOTFILE 0x001 /* non-file FS objects throw an error */ |
| 135 | #define CKSIG_HASH 0x002 /* Verify file content using hashing */ |
| 136 | #define CKSIG_SETMTIME 0x004 /* Set mtime to last check-out time */ |
| 137 | |
| 138 | #endif /* INTERFACE */ |
| 139 | |
| 140 | /* |
| @@ -172,11 +172,11 @@ | |
| 172 | */ |
| 173 | void vfile_check_signature(int vid, unsigned int cksigFlags){ |
| 174 | int nErr = 0; |
| 175 | Stmt q; |
| 176 | Blob fileCksum, origCksum; |
| 177 | int useMtime = (cksigFlags & CKSIG_HASH)==0 |
| 178 | && db_get_boolean("mtime-changes", 1); |
| 179 | |
| 180 | db_begin_transaction(); |
| 181 | db_prepare(&q, "SELECT id, %Q || pathname," |
| 182 | " vfile.mrid, deleted, chnged, uuid, size, mtime," |
| 183 |