Fossil

Check-in [ffd61eed]
Login

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

Overview
Comment:fix manifest creation bugs
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | svn-import
Files: files | file ages | folders
SHA1:ffd61eedf5a1e8f7761322da2985a499eddeb88f
User & Date: baruch 2014-10-21 12:18:23
Context
2014-10-21
12:32
prepare for svn branch importing check-in: bb1d7835 user: baruch tags: svn-import
12:18
fix manifest creation bugs check-in: ffd61eed user: baruch tags: svn-import
09:27
merge trunk check-in: 154abe4d user: baruch tags: svn-import
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/import.c.

881
882
883
884
885
886
887

888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
...
912
913
914
915
916
917
918
919
920
921




922
923
924
925
926
927
928
  return 1;
}

static void svn_create_manifests(){
  Blob manifest;
  Stmt qRev;
  Stmt qFiles;


  blob_zero(&manifest);
  db_prepare(&qRev, "SELECT trev, tuser, tmsg, ttime FROM xrevisions"
                    " ORDER BY trev");
  db_prepare(&qFiles, "SELECT tpath, uuid, tperm"
                      " FROM xfiles JOIN blob ON xfiles.trid=blob.rid"
                      " WHERE trev=:rev ORDER BY tpath");
  while( db_step(&qRev)==SQLITE_ROW ){
    int rev = db_column_int(&qRev, 0);
    const char *zUser = db_column_text(&qRev, 1);
    const char *zMsg = db_column_text(&qRev, 2);
    const char *zTime = db_column_text(&qRev, 3);
    int parentRid = 0;
    Blob mcksum;
    blob_reset(&manifest);
    if( zMsg ){
      blob_appendf(&manifest, "C %F\n", zMsg);
    }else{
      blob_append(&manifest, "C (no\\scomment)\n", 16);
    }
................................................................................
      const char *zUuid = db_column_text(&qFiles, 1);
      const char *zPerm = db_column_text(&qFiles, 2);
      blob_appendf(&manifest, "F %F %s %s\n", zFile, zUuid, zPerm);
    }
    db_reset(&qFiles);
    if( parentRid>0 ){
      const char *zParent;
      zParent = db_text(0, "SELECT uuid FROM blob WEHRE rid=%d", parentRid);
      blob_appendf(&manifest, "P %s", zParent);
      fossil_free(zParent);




    }
    if( zUser ){
      blob_appendf(&manifest, "U %F\n", zUser);
    }else{
      const char *zUserOvrd = find_option("user-override",0,1);
      blob_appendf(&manifest, "U %F\n",
        zUserOvrd ? zUserOvrd : login_name());







>












<







 







|
|

>
>
>
>







881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900

901
902
903
904
905
906
907
...
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
  return 1;
}

static void svn_create_manifests(){
  Blob manifest;
  Stmt qRev;
  Stmt qFiles;
  int parentRid = 0;

  blob_zero(&manifest);
  db_prepare(&qRev, "SELECT trev, tuser, tmsg, ttime FROM xrevisions"
                    " ORDER BY trev");
  db_prepare(&qFiles, "SELECT tpath, uuid, tperm"
                      " FROM xfiles JOIN blob ON xfiles.trid=blob.rid"
                      " WHERE trev=:rev ORDER BY tpath");
  while( db_step(&qRev)==SQLITE_ROW ){
    int rev = db_column_int(&qRev, 0);
    const char *zUser = db_column_text(&qRev, 1);
    const char *zMsg = db_column_text(&qRev, 2);
    const char *zTime = db_column_text(&qRev, 3);

    Blob mcksum;
    blob_reset(&manifest);
    if( zMsg ){
      blob_appendf(&manifest, "C %F\n", zMsg);
    }else{
      blob_append(&manifest, "C (no\\scomment)\n", 16);
    }
................................................................................
      const char *zUuid = db_column_text(&qFiles, 1);
      const char *zPerm = db_column_text(&qFiles, 2);
      blob_appendf(&manifest, "F %F %s %s\n", zFile, zUuid, zPerm);
    }
    db_reset(&qFiles);
    if( parentRid>0 ){
      const char *zParent;
      zParent = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", parentRid);
      blob_appendf(&manifest, "P %s\n", zParent);
      fossil_free(zParent);
    }else{
      blob_appendf(&manifest, "R d41d8cd98f00b204e9800998ecf8427e\n");
      blob_appendf(&manifest, "T *branch * trunk\n");
      blob_appendf(&manifest, "T *sym-trunk *\n");
    }
    if( zUser ){
      blob_appendf(&manifest, "U %F\n", zUser);
    }else{
      const char *zUserOvrd = find_option("user-override",0,1);
      blob_appendf(&manifest, "U %F\n",
        zUserOvrd ? zUserOvrd : login_name());

Changes to src/manifest.c.

592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
...
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
        p->aField[i].zValue = zValue;
        if( i>0 && fossil_strcmp(p->aField[i-1].zName, zName)>=0 ){
          SYNTAX("incorrect J-card sort order");
        }
        break;
      }


      /*
      **    K <uuid>
      **
      ** A K-line gives the UUID for the ticket which this control file
      ** is amending.
      */
      case 'K': {
................................................................................
        p->zWiki = x.z;
        x.z += size;
        if( x.z[0]!='\n' ) SYNTAX("W-card content no \\n terminated");
        x.z[0] = 0;
        x.z++;
        break;
      }


      /*
      **     Z <md5sum>
      **
      ** MD5 checksum on this control file.  The checksum is over all
      ** lines (other than PGP-signature lines) prior to the current
      ** line.  This must be the last record.







<







 







<







592
593
594
595
596
597
598

599
600
601
602
603
604
605
...
837
838
839
840
841
842
843

844
845
846
847
848
849
850
        p->aField[i].zValue = zValue;
        if( i>0 && fossil_strcmp(p->aField[i-1].zName, zName)>=0 ){
          SYNTAX("incorrect J-card sort order");
        }
        break;
      }


      /*
      **    K <uuid>
      **
      ** A K-line gives the UUID for the ticket which this control file
      ** is amending.
      */
      case 'K': {
................................................................................
        p->zWiki = x.z;
        x.z += size;
        if( x.z[0]!='\n' ) SYNTAX("W-card content no \\n terminated");
        x.z[0] = 0;
        x.z++;
        break;
      }


      /*
      **     Z <md5sum>
      **
      ** MD5 checksum on this control file.  The checksum is over all
      ** lines (other than PGP-signature lines) prior to the current
      ** line.  This must be the last record.