Fossil

Check-in [70b82e8c]
Login

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

Overview
Comment:Fix indentation.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dg-timestamps
Files: files | file ages | folders
SHA1:70b82e8cc5ce90c77de55114d4c08389d4f9ded6
User & Date: dg 2013-12-22 20:38:12
Context
2014-01-13
23:41
Honor timezones in imports from git. check-in: 1aef260f user: drh tags: trunk
2013-12-22
20:38
Fix indentation. Closed-Leaf check-in: 70b82e8c user: dg tags: dg-timestamps
2013-12-20
17:05
Honour timezones in git fast-import dump timestamps. check-in: 10f9673a user: dg tags: dg-timestamps
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/import.c.

573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
    if( memcmp(zLine, "mark ", 5)==0 ){
      trim_newline(&zLine[5]);
      fossil_free(gg.zMark);
      gg.zMark = fossil_strdup(&zLine[5]);
    }else
    if( memcmp(zLine, "tagger ", 7)==0 || memcmp(zLine, "committer ",10)==0 ){
      sqlite3_int64 secSince1970;
	  int hastz;
	  char tzdir;
	  int tz;
      for(i=0; zLine[i] && zLine[i]!='<'; i++){}
      if( zLine[i]==0 ) goto malformed_line;
      z = &zLine[i+1];
      for(i=i+1; zLine[i] && zLine[i]!='>'; i++){}
      if( zLine[i]==0 ) goto malformed_line;
      zLine[i] = 0;
      fossil_free(gg.zUser);
      gg.zUser = fossil_strdup(z);
      secSince1970 = 0;

	  /* We don't use sscanf here because of int64 portability issues. */
      for(i=i+2; fossil_isdigit(zLine[i]); i++){
        secSince1970 = secSince1970*10 + zLine[i] - '0';
      }

      /* Read in optional timezone modifier (we don't know if it's strictly
	   * optional, but better to be sure). */
      tzdir = '+';
	  tz = 0;
	  hastz = sscanf(&zLine[i], " %c%d", &tzdir, &tz);
	  if ((hastz == 1) || (hastz > 2)) goto malformed_line;
	  secSince1970 += ((tzdir == '-') ? -1 : 1) *
	    ((tz/100)*3600 + (tz%100)*60);

      fossil_free(gg.zDate);
      gg.zDate = db_text(0, "SELECT datetime(%lld, 'unixepoch')", secSince1970);
      gg.zDate[10] = 'T';
    }else
    if( memcmp(zLine, "from ", 5)==0 ){
      trim_newline(&zLine[5]);







|
|
|










|





|

|
|
|
|
|







573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
    if( memcmp(zLine, "mark ", 5)==0 ){
      trim_newline(&zLine[5]);
      fossil_free(gg.zMark);
      gg.zMark = fossil_strdup(&zLine[5]);
    }else
    if( memcmp(zLine, "tagger ", 7)==0 || memcmp(zLine, "committer ",10)==0 ){
      sqlite3_int64 secSince1970;
      int hastz;
      char tzdir;
      int tz;
      for(i=0; zLine[i] && zLine[i]!='<'; i++){}
      if( zLine[i]==0 ) goto malformed_line;
      z = &zLine[i+1];
      for(i=i+1; zLine[i] && zLine[i]!='>'; i++){}
      if( zLine[i]==0 ) goto malformed_line;
      zLine[i] = 0;
      fossil_free(gg.zUser);
      gg.zUser = fossil_strdup(z);
      secSince1970 = 0;

      /* We don't use sscanf here because of int64 portability issues. */
      for(i=i+2; fossil_isdigit(zLine[i]); i++){
        secSince1970 = secSince1970*10 + zLine[i] - '0';
      }

      /* Read in optional timezone modifier (we don't know if it's strictly
       * optional, but better to be sure). */
      tzdir = '+';
      tz = 0;
      hastz = sscanf(&zLine[i], " %c%d", &tzdir, &tz);
      if ((hastz == 1) || (hastz > 2)) goto malformed_line;
      secSince1970 += ((tzdir == '-') ? -1 : 1) *
        ((tz/100)*3600 + (tz%100)*60);

      fossil_free(gg.zDate);
      gg.zDate = db_text(0, "SELECT datetime(%lld, 'unixepoch')", secSince1970);
      gg.zDate[10] = 'T';
    }else
    if( memcmp(zLine, "from ", 5)==0 ){
      trim_newline(&zLine[5]);