Fossil

Check-in [bd65092f]
Login

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

Overview
Comment:Merge stripping end-of-line change from "roy-export" branch
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | jn-export
Files: files | file ages | folders
SHA1: bd65092f33dac9abea0efd9df78072ceda7a8868
User & Date: jan.nijtmans 2017-02-22 09:49:06
Context
2017-04-03
11:33
Use the (existing) 'T' card in stead of an (incompatible) 'C' card, to store GIT's Tag comment. Closed-Leaf check-in: f2e075b9 user: jan.nijtmans tags: roy-export
2017-02-22
09:49
Merge stripping end-of-line change from "roy-export" branch Closed-Leaf check-in: bd65092f user: jan.nijtmans tags: jn-export
2017-02-21
22:18
Cast strlen to int to avoid a compiler error and to be consitent elsewhere. check-in: 7a93cd88 user: roy.marples tags: roy-export
2017-02-13
10:37
Same as "roy-export", but use tag value in stead of comment for storing comment related to tags. (Not actually tested with GIT yet!) check-in: cb1fb96f user: jan.nijtmans tags: jn-export
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/import.c.

219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
...
606
607
608
609
610
611
612
613
614
615
616
617
618
619



620
621
622
623
624
625
626
    blob_zero(&record);
    blob_appendf(&record, "D %s\n", gg.zDate);
    blob_appendf(&record, "T +sym-%F%F%F %s", gimport.zTagPre, gg.zTag,
        gimport.zTagSuf, gg.zFrom);
    if( gg.zComment ){
      blob_appendf(&record, " %F", gg.zComment);
    }
    blob_appendf(&record, "U %F\n", gg.zUser);
    md5sum_blob(&record, &cksum);
    blob_appendf(&record, "Z %b\n", &cksum);
    fast_insert_content(&record, 0, 0, 1);
    blob_reset(&cksum);
  }
  import_reset(0);
}
................................................................................
      if( gg.nData ){
        int got;
        gg.aData = fossil_malloc( gg.nData+1 );
        got = fread(gg.aData, 1, gg.nData, pIn);
        if( got!=gg.nData ){
          fossil_fatal("short read: got %d of %d bytes", got, gg.nData);
        }
	/* Strip trailing newline, it's appended to the comment. */
	if( gg.aData[got-1] == '\n' )
	  gg.aData[got-1] = '\0';
        else
          gg.aData[got] = '\0';
        if( gg.zComment==0 &&
            (gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){



          gg.zComment = gg.aData;
          gg.aData = 0;
          gg.nData = 0;
        }
      }
    }else
    if( strncmp(zLine, "author ", 7)==0 ){







|







 







<
<
<
<
|


>
>
>







219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
...
606
607
608
609
610
611
612




613
614
615
616
617
618
619
620
621
622
623
624
625
    blob_zero(&record);
    blob_appendf(&record, "D %s\n", gg.zDate);
    blob_appendf(&record, "T +sym-%F%F%F %s", gimport.zTagPre, gg.zTag,
        gimport.zTagSuf, gg.zFrom);
    if( gg.zComment ){
      blob_appendf(&record, " %F", gg.zComment);
    }
    blob_appendf(&record, "\nU %F\n", gg.zUser);
    md5sum_blob(&record, &cksum);
    blob_appendf(&record, "Z %b\n", &cksum);
    fast_insert_content(&record, 0, 0, 1);
    blob_reset(&cksum);
  }
  import_reset(0);
}
................................................................................
      if( gg.nData ){
        int got;
        gg.aData = fossil_malloc( gg.nData+1 );
        got = fread(gg.aData, 1, gg.nData, pIn);
        if( got!=gg.nData ){
          fossil_fatal("short read: got %d of %d bytes", got, gg.nData);
        }




        gg.aData[got] = '\0';
        if( gg.zComment==0 &&
            (gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){
	  /* Strip trailing newline, it's appended to the comment. */
	  if( gg.aData[got-1] == '\n' )
	    gg.aData[got-1] = '\0';
          gg.zComment = gg.aData;
          gg.aData = 0;
          gg.nData = 0;
        }
      }
    }else
    if( strncmp(zLine, "author ", 7)==0 ){