Hi,
The patch fixes the problem that fossil doesn't recognize sha3 marks
file. eg.
first do
$ mkdir .marks
$ git fast-export --all --export-marks=.marks/git | fossil import
--export-marks .marks/fossil --git repo.fossil
then
$ git fast-export --all --import-marks=.marks/git
--export-marks=.marks/git | fossil import --import-marks .marks/fossil
--export-marks .marks/fossil --git --incremental repo.fossil
Index: src/export.c
==================================================================
--- src/export.c
+++ src/export.c
@@ -35,16 +35,16 @@
** and fossil commits.
** -git_name: This is the mark name that identifies the commit to git.
** It will always begin with a ':'.
** -rid: The unique object ID that identifies this commit within the
** repository database.
-** -uuid: The SHA-1 of artifact corresponding to rid.
+** -uuid: The SHA-1/SHA-3 of artifact corresponding to rid.
*/
struct mark_t{
char *name;
int rid;
- char uuid[41];
+ char uuid[65];
};
#endif
/*
** Output a "committer" record for the given user.
@@ -340,22 +340,23 @@
}else{
mark->name = fossil_strdup(cur_tok);
}
cur_tok = strtok(NULL, "\n");
- if( !cur_tok || strlen(cur_tok)!=40 ){
+ if( !cur_tok || (strlen(cur_tok)!=40 && strlen(cur_tok)!=64) ){
free(mark->name);
- fossil_trace("Invalid SHA-1 in marks file: %s\n", cur_tok);
+ fossil_trace(
+ "Invalid SHA-1/SHA-3 in marks file: %d %s\n", strlen(cur_tok),
cur_tok);
return -1;
}else{
sqlite3_snprintf(sizeof(mark->uuid), mark->uuid, "%s", cur_tok);
}
/* make sure that rid corresponds to UUID */
if( fast_uuid_to_rid(mark->uuid)!=mark->rid ){
free(mark->name);
- fossil_trace("Non-existent SHA-1 in marks file: %s\n", mark->uuid);
+ fossil_trace("Non-existent SHA-1/SHA-3 in marks file: %s\n",
mark->uuid);
return -1;
}
/* insert a cross-ref into the 'xmark' table */
insert_commit_xref(mark->rid, mark->name, mark->uuid);
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users