Fossil

Check-in [051cd382]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add the "FossilOrigin-Name:" footer on all exported comments.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | mirror-cmd
Files: files | file ages | folders
SHA3-256: 051cd3825ed507b2498e2e7e626bda6eea15d3b8ab3918ac2e19521735b1c7b5
User & Date: drh 2019-03-15 20:01:38.609
Context
2019-03-15
21:36
Do the export within a transaction for performance. Record a complete two-way map of Git and Fossil names in the mirror.mmark table. ... (check-in: c4f9b177 user: drh tags: mirror-cmd)
20:01
Add the "FossilOrigin-Name:" footer on all exported comments. ... (check-in: 051cd382 user: drh tags: mirror-cmd)
16:38
Rename "fossil mirror" to "fossil git export". Deprecate the "fossil export" command. ... (check-in: 2faec6b7 user: drh tags: mirror-cmd)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/export.c.
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
  Manifest *pMan;       /* The check-in to be output */
  int i;                /* Loop counter */
  int iParent;          /* Which immediate ancestor is primary.  -1 for none */
  Stmt q;               /* An SQL query */
  char *zBranch;        /* The branch of the check-in */
  int iMark;            /* The mark for the check-in */
  Blob sql;             /* String of SQL for part of the query */
  char *zCom;           /* The check-in comment */

  pMan = manifest_get(rid, CFTYPE_MANIFEST, 0);
  if( pMan==0 ){
    /* Must be a phantom.  Return without doing anything, and in particular
    ** without creating a mark for this check-in. */
    return;
  }







|







1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
  Manifest *pMan;       /* The check-in to be output */
  int i;                /* Loop counter */
  int iParent;          /* Which immediate ancestor is primary.  -1 for none */
  Stmt q;               /* An SQL query */
  char *zBranch;        /* The branch of the check-in */
  int iMark;            /* The mark for the check-in */
  Blob sql;             /* String of SQL for part of the query */
  Blob comment;         /* The comment text for the check-in */

  pMan = manifest_get(rid, CFTYPE_MANIFEST, 0);
  if( pMan==0 ){
    /* Must be a phantom.  Return without doing anything, and in particular
    ** without creating a mark for this check-in. */
    return;
  }
1067
1068
1069
1070
1071
1072
1073
1074

1075


1076

1077
1078
1079
1080
1081
1082
1083
  fossil_free(zBranch);
  iMark = gitmirror_find_mark(zUuid, 1);
  fprintf(xCmd, "mark :%d\n", iMark);
  fprintf(xCmd, "committer %s <%s@noemail.net> %lld +0000\n",
     pMan->zUser, pMan->zUser, 
     (sqlite3_int64)((pMan->rDate-2440587.5)*86400.0)
  );
  zCom = pMan->zComment;

  if( zCom==0 ) zCom = "(no comment)";


  fprintf(xCmd, "data %d\n%s\n", (int)strlen(zCom), zCom);

  iParent = -1;  /* Which ancestor is the primary parent */
  for(i=0; i<pMan->nParent; i++){
    int iOther = gitmirror_find_mark(pMan->azParent[i], 0);
    if( iOther==0 ) continue;
    if( iParent<0 ){
      iParent = i;
      fprintf(xCmd, "from :%d\n", iOther);







|
>
|
>
>
|
>







1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
  fossil_free(zBranch);
  iMark = gitmirror_find_mark(zUuid, 1);
  fprintf(xCmd, "mark :%d\n", iMark);
  fprintf(xCmd, "committer %s <%s@noemail.net> %lld +0000\n",
     pMan->zUser, pMan->zUser, 
     (sqlite3_int64)((pMan->rDate-2440587.5)*86400.0)
  );
  blob_init(&comment, pMan->zComment, -1);
  if( blob_size(&comment)==0 ){
    blob_append(&comment, "(no comment)", -1);
  }
  blob_appendf(&comment, "\n\nFossilOrigin-Name: %s", zUuid);
  fprintf(xCmd, "data %d\n%s\n", blob_size(&comment), blob_str(&comment));
  blob_reset(&comment);
  iParent = -1;  /* Which ancestor is the primary parent */
  for(i=0; i<pMan->nParent; i++){
    int iOther = gitmirror_find_mark(pMan->azParent[i], 0);
    if( iOther==0 ) continue;
    if( iParent<0 ){
      iParent = i;
      fprintf(xCmd, "from :%d\n", iOther);