Fossil

Check-in [433a3c9a]
Login

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

Overview
Comment:Write incremental file lists for fast-export.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:433a3c9a7826e55d8d36cde3dc8453bd537f117e
User & Date: joerg 2011-07-21 13:53:23
Context
2011-07-21
15:50
Avoid parsing manifests if a parent exists. Now the only case left using deleteall is when no parent exists. check-in: bc8d368b user: joerg tags: trunk
13:53
Write incremental file lists for fast-export. check-in: 433a3c9a user: joerg tags: trunk
2011-07-20
20:05
Fix the realclean target on windows makefiles to delete mkversion.exe not version.exe. Ticket [5947ace466c571d] check-in: 3ade7789 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/export.c.

146
147
148
149
150
151
152

153
154
155
156
157
158
159
...
162
163
164
165
166
167
168

169
170
171

172
173
174

175
176
177
178
179
180
181
182
183



















184
185
186
187
188
189
190
    const char *zComment = db_column_text(&q, 2);
    const char *zUser = db_column_text(&q, 3);
    const char *zBranch = db_column_text(&q, 4);
    char *zBr;
    Manifest *p;
    ManifestFile *pFile;
    const char *zFromType;


    bag_insert(&vers, ckinId);
    if( zBranch==0 ) zBranch = "trunk";
    zBr = mprintf("%s", zBranch);
    for(i=0; zBr[i]; i++){
      if( !fossil_isalnum(zBr[i]) ) zBr[i] = '_';
    }
................................................................................
    printf("committer");
    print_person(zUser);
    printf(" %s +0000\n", zSecondsSince1970);
    if( zComment==0 ) zComment = "null comment";
    printf("data %d\n%s\n", (int)strlen(zComment), zComment);
    p = manifest_get(ckinId, CFTYPE_ANY);
    zFromType = "from";

    for(i=0; i<p->nParent; i++){
      int pid = fast_uuid_to_rid(p->azParent[i]);
      if( pid==0 || !bag_find(&vers, pid) ) continue;

      printf("%s :%d\n", zFromType, fast_uuid_to_rid(p->azParent[i])+firstCkin);
      zFromType = "merge";
    }

    printf("deleteall\n");
    manifest_file_rewind(p);
    while( (pFile=manifest_file_next(p, 0))!=0 ){
      int fid = fast_uuid_to_rid(pFile->zUuid);
      const char *zPerm = "100644";
      if( fid==0 ) continue;
      if( pFile->zPerm && strstr(pFile->zPerm,"x") ) zPerm = "100755";
      if( !bag_find(&blobs, fid) ) continue;
      printf("M %s :%d %s\n", zPerm, fid, pFile->zName);



















    }
    manifest_cache_insert(p);
    printf("\n");
  }
  db_finalize(&q);
  bag_clear(&blobs);
  manifest_cache_clear();







>







 







>



>



>
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
...
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
    const char *zComment = db_column_text(&q, 2);
    const char *zUser = db_column_text(&q, 3);
    const char *zBranch = db_column_text(&q, 4);
    char *zBr;
    Manifest *p;
    ManifestFile *pFile;
    const char *zFromType;
    int parent;

    bag_insert(&vers, ckinId);
    if( zBranch==0 ) zBranch = "trunk";
    zBr = mprintf("%s", zBranch);
    for(i=0; zBr[i]; i++){
      if( !fossil_isalnum(zBr[i]) ) zBr[i] = '_';
    }
................................................................................
    printf("committer");
    print_person(zUser);
    printf(" %s +0000\n", zSecondsSince1970);
    if( zComment==0 ) zComment = "null comment";
    printf("data %d\n%s\n", (int)strlen(zComment), zComment);
    p = manifest_get(ckinId, CFTYPE_ANY);
    zFromType = "from";
    parent = 0;
    for(i=0; i<p->nParent; i++){
      int pid = fast_uuid_to_rid(p->azParent[i]);
      if( pid==0 || !bag_find(&vers, pid) ) continue;
      if( i==0) parent = pid;
      printf("%s :%d\n", zFromType, fast_uuid_to_rid(p->azParent[i])+firstCkin);
      zFromType = "merge";
    }
    if( parent==0 ) {
      printf("deleteall\n");
      manifest_file_rewind(p);
      while( (pFile=manifest_file_next(p, 0))!=0 ){
        int fid = fast_uuid_to_rid(pFile->zUuid);
        const char *zPerm = "100644";
        if( fid==0 ) continue;
        if( pFile->zPerm && strstr(pFile->zPerm,"x") ) zPerm = "100755";
        if( !bag_find(&blobs, fid) ) continue;
        printf("M %s :%d %s\n", zPerm, fid, pFile->zName);
      }
    }else{
      Stmt q2;
      db_prepare(&q2,
        "SELECT filename.name, mlink.fid, mlink.mperm FROM mlink"
        " JOIN filename ON filename.fnid=mlink.fnid"
        " WHERE mlink.mid=%d",
        parent
      );
      while( db_step(&q2)==SQLITE_ROW ){
        const char *zName = db_column_text(&q2,0);
        int zNew = db_column_int(&q2,1);
        int mPerm = db_column_int(&q2,2);
        if( zNew==0)
           printf("D %s\n", zName);
        else
           printf("M %s :%d %s\n", mPerm ? "100755" : "100644", zNew, zName);
      }
      db_finalize(&q2);
    }
    manifest_cache_insert(p);
    printf("\n");
  }
  db_finalize(&q);
  bag_clear(&blobs);
  manifest_cache_clear();