Fossil

Diff
Login

Differences From Artifact [d9c85d3502]:

To Artifact [a738bfcb2d]:


650
651
652
653
654
655
656
657

658
659
660
661

662
663
664
665
666

667
668
669
670
671
672
673
650
651
652
653
654
655
656

657

658


659





660
661
662
663
664
665
666
667







-
+
-

-
-
+
-
-
-
-
-
+







/*
** Create empty directories specified by the empty-dirs setting.
*/
void ensure_empty_dirs_created(int clearDirTable){
  char *zEmptyDirs = db_get("empty-dirs", 0);
  if( zEmptyDirs!=0 ){
    int i;
    Blob dirName;
    Glob *pGlob = glob_create(zEmptyDirs);
    Blob dirsList;

    zEmptyDirs = fossil_strdup(zEmptyDirs);
    for(i=0; zEmptyDirs[i]; i++){
    for(i=0; i<pGlob->nPattern; i++){
      if( zEmptyDirs[i]==',' ) zEmptyDirs[i] = ' ';
    }
    blob_init(&dirsList, zEmptyDirs, -1);
    while( blob_token(&dirsList, &dirName) ){
      char *zDir = blob_str(&dirName);
      const char *zDir = pGlob->azPattern[i];
      char *zPath = mprintf("%s/%s", g.zLocalRoot, zDir);
      switch( file_isdir(zPath, RepoFILE) ){
        case 0: { /* doesn't exist */
          fossil_free(zPath);
          zPath = mprintf("%s/%s/x", g.zLocalRoot, zDir);
          if( file_mkfolder(zPath, RepoFILE, 0, 1)!=0 ) {
            fossil_warning("couldn't create directory %s as "
686
687
688
689
690
691
692
693
694
695
696

697
698
699
700
701
702
703
680
681
682
683
684
685
686

687


688
689
690
691
692
693
694
695







-

-
-
+







        }
        case 2: { /* exists, but isn't a directory */
          fossil_warning("file %s found, but a directory is required "
                         "by empty-dirs setting", zDir);
        }
      }
      fossil_free(zPath);
      blob_reset(&dirName);
    }
    blob_reset(&dirsList);
    fossil_free(zEmptyDirs);
    glob_free(pGlob);
  }
}

/*
** Get the manifest record for a given revision, or the current check-out if
** zRevision is NULL.
*/