Fossil

Check-in [46675ed219]
Login

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

Overview
Comment:Remove access check from [fossil add] to make it match [fossil addremove] which waits until [fossil commit] to check for readability. This makes it possible to use [fossil add] to add symlinks to nonexistent/unreadable files and (not like this is useful) to add zero-length files for which the user does not have read permission. [fossil addremove] has always had these capabilities, but it has the drawback of adding and removing everything it can, not allowing the user to limit its scope.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 46675ed219ff5e563255cc8803130ec640bd80c9
User & Date: andygoth 2015-05-15 02:25:28.066
Original Comment: Remove access check from [fossil add] to make it match [fossil addremove] which waits until [fossil commit] to check for readability. This makes it possible to use [fossil add] to add symlinks to nonexistent files and (not like this is useful) to add zero-length files for which the user does not have read permission. [fossil addremove] has always had these capabilities, but it has the drawback of adding and removing everything it can, not allowing the user to limit its scope.
References
2015-05-15
02:29
Update changelog to document [46675ed2]. check-in: 2ec8327aa4 user: andygoth tags: trunk
Context
2015-05-15
02:29
Update changelog to document [46675ed2]. check-in: 2ec8327aa4 user: andygoth tags: trunk
02:25
Remove access check from [fossil add] to make it match [fossil addremove] which waits until [fossil commit] to check for readability. This makes it possible to use [fossil add] to add symlinks to nonexistent/unreadable files and (not like this is useful) to add zero-length files for which the user does not have read permission. [fossil addremove] has always had these capabilities, but it has the drawback of adding and removing everything it can, not allowing the user to limit its scope. check-in: 46675ed219 user: andygoth tags: trunk
02:11
Add missing comment describing how settings are read while opening a checkout. check-in: f7f6ea818a user: andygoth tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/add.c.
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
    file_canonical_name(g.argv[i], &fullName, 0);
    zName = blob_str(&fullName);
    isDir = file_wd_isdir(zName);
    if( isDir==1 ){
      vfile_scan(&fullName, nRoot-1, scanFlags, pClean, pIgnore);
    }else if( isDir==0 ){
      fossil_warning("not found: %s", zName);
    }else if( file_access(zName, R_OK) ){
      fossil_fatal("cannot open %s", zName);
    }else{
      char *zTreeName = &zName[nRoot];
      if( !forceFlag && glob_match(pIgnore, zTreeName) ){
        Blob ans;
        char cReply;
        char *prompt = mprintf("file \"%s\" matches \"ignore-glob\".  "
                               "Add it (a=all/y/N)? ", zTreeName);







<
<







315
316
317
318
319
320
321


322
323
324
325
326
327
328
    file_canonical_name(g.argv[i], &fullName, 0);
    zName = blob_str(&fullName);
    isDir = file_wd_isdir(zName);
    if( isDir==1 ){
      vfile_scan(&fullName, nRoot-1, scanFlags, pClean, pIgnore);
    }else if( isDir==0 ){
      fossil_warning("not found: %s", zName);


    }else{
      char *zTreeName = &zName[nRoot];
      if( !forceFlag && glob_match(pIgnore, zTreeName) ){
        Blob ans;
        char cReply;
        char *prompt = mprintf("file \"%s\" matches \"ignore-glob\".  "
                               "Add it (a=all/y/N)? ", zTreeName);