Fossil

Check-in [1aef260f]
Login

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

Overview
Comment:Honor timezones in imports from git.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1aef260f4c0a0fc74f45f624eb0cbe92b98bf6e8
User & Date: drh 2014-01-13 23:41:39
References
2014-05-02
08:23
Backout [1aef260f4c0a0fc74f45f624eb0cbe92b98bf6e8|1aef260f4c]: "Honor timezones in imports from git", per ML thread check-in: 77f53423 user: jan.nijtmans tags: trunk
Context
2014-01-14
00:10
Delay activation of ticket hook until after the ticket tables have been rebuilt. check-in: 42316a14 user: mistachkin tags: trunk
00:04
Merge recent fixes from trunk. Closed-Leaf check-in: eff4999d user: mistachkin tags: delay-ticket-hook
2014-01-13
23:41
Honor timezones in imports from git. check-in: 1aef260f user: drh tags: trunk
23:32
Make sure that TH1 variables get removed from the call frame upon being unset. check-in: 1ebe4b02 user: mistachkin tags: trunk
2013-12-22
20:38
Fix indentation. Closed-Leaf check-in: 70b82e8c 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
    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;



      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;


      for(i=i+2; fossil_isdigit(zLine[i]); i++){
        secSince1970 = secSince1970*10 + zLine[i] - '0';
      }










      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]);
      fossil_free(gg.zFromMark);







>
>
>









>
>



>
>
>
>
>
>
>
>
>
>







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
613
    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]);
      fossil_free(gg.zFromMark);