Changes On Branch dead-end
Not logged in

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

Changes In Branch dead-end Excluding Merge-Ins

This is equivalent to a diff from 2f58d48cab to 1761fee055

2010-02-08
16:08
Alternative fix for ticket [9ff56ae8a6]. check-in: 3cc4cd55d8 user: drh tags: trunk
14:20
Added better error message when trying to remove a directory. Closed-Leaf check-in: 1761fee055 user: jeremy_c tags: dead-end
2010-02-06
20:20
fixed [9ff56ae8a6] - "fossil sha" crash check-in: 4027ad4b7e user: ron tags: dead-end
17:25
Windows only: remove duplicate code from sqlite3.c in db.c check-in: 2f58d48cab user: ron tags: trunk
12:14
Fix double-free of zCopy in date_to_uuid(). Ticket [dc2b2503031] check-in: 01a769a9fa user: drh tags: trunk

Changes to src/add.c.

     5      5   ** modify it under the terms of the GNU General Public
     6      6   ** License version 2 as published by the Free Software Foundation.
     7      7   **
     8      8   ** This program is distributed in the hope that it will be useful,
     9      9   ** but WITHOUT ANY WARRANTY; without even the implied warranty of
    10     10   ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11     11   ** General Public License for more details.
    12         -** 
           12  +**
    13     13   ** You should have received a copy of the GNU General Public
    14     14   ** License along with this library; if not, write to the
    15     15   ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16     16   ** Boston, MA  02111-1307, USA.
    17     17   **
    18     18   ** Author contact information:
    19     19   **   drh@hwaci.com
................................................................................
    30     30   #include <dirent.h>
    31     31   
    32     32   /*
    33     33   ** Set to true if files whose names begin with "." should be
    34     34   ** included when processing a recursive "add" command.
    35     35   */
    36     36   static int includeDotFiles = 0;
    37         -    
           37  +
    38     38   /*
    39     39   ** Add a single file
    40     40   */
    41     41   static void add_one_file(const char *zName, int vid, Blob *pOmit){
    42     42     Blob pathname;
    43     43     const char *zPath;
    44         -      
           44  +
    45     45     file_tree_name(zName, &pathname, 1);
    46     46     zPath = blob_str(&pathname);
    47     47     if( strcmp(zPath, "manifest")==0
    48     48      || strcmp(zPath, "_FOSSIL_")==0
    49     49      || strcmp(zPath, "manifest.uuid")==0
    50     50      || blob_compare(&pathname, pOmit)==0
    51     51     ){
................................................................................
   124    124   }
   125    125   
   126    126   /*
   127    127   ** COMMAND: add
   128    128   **
   129    129   ** Usage: %fossil add FILE...
   130    130   **
   131         -** Make arrangements to add one or more files to the current checkout 
          131  +** Make arrangements to add one or more files to the current checkout
   132    132   ** at the next commit.
   133    133   **
   134    134   ** When adding files recursively, filenames that begin with "." are
   135    135   ** excluded by default.  To include such files, add the "--dotfiles"
   136    136   ** option to the command-line.
   137    137   */
   138    138   void add_cmd(void){
................................................................................
   199    199     if( vid==0 ){
   200    200       fossil_panic("no checkout to remove from");
   201    201     }
   202    202     db_begin_transaction();
   203    203     for(i=2; i<g.argc; i++){
   204    204       char *zName;
   205    205       char *zPath;
          206  +    int isDir;
   206    207       Blob pathname;
   207    208   
   208    209       zName = mprintf("%/", g.argv[i]);
          210  +    isDir = file_isdir(zName);
          211  +    if( isDir==1 ){
          212  +      fossil_fatal("cannot remove directories. Please remove individual files instead.");
          213  +	}
   209    214       file_tree_name(zName, &pathname, 1);
   210    215       zPath = blob_str(&pathname);
   211    216       if( !db_exists(
   212    217                "SELECT 1 FROM vfile WHERE pathname=%Q AND NOT deleted", zPath) ){
   213    218         fossil_fatal("not in the repository: %s", zName);
   214    219       }else{
   215    220         db_multi_exec("UPDATE vfile SET deleted=1 WHERE pathname=%Q", zPath);
................................................................................
   219    224       free(zName);
   220    225     }
   221    226     db_multi_exec("DELETE FROM vfile WHERE deleted AND rid=0");
   222    227     db_end_transaction(0);
   223    228   }
   224    229   
   225    230   /*
   226         -** Rename a single file.  
          231  +** Rename a single file.
   227    232   **
   228    233   ** The original name of the file is zOrig.  The new filename is zNew.
   229    234   */
   230    235   static void mv_one_file(int vid, const char *zOrig, const char *zNew){
   231    236     printf("RENAME %s %s\n", zOrig, zNew);
   232    237     db_multi_exec(
   233    238       "UPDATE vfile SET pathname='%s' WHERE pathname='%s' AND vid=%d",

Changes to src/sha1.c.

   609    609     Blob cksum;
   610    610     
   611    611     for(i=2; i<g.argc; i++){
   612    612       if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){
   613    613         blob_read_from_channel(&in, stdin, -1);
   614    614         sha1sum_blob(&in, &cksum);
   615    615       }else{
          616  +	  if (access(g.argv[i], R_OK)) {
          617  +		  fossil_fatal("cannot open %s", g.argv[i]);
          618  +	  }
   616    619         sha1sum_file(g.argv[i], &cksum);
   617    620       }
   618    621       printf("%s  %s\n", blob_str(&cksum), g.argv[i]);
   619    622       blob_reset(&cksum);
   620    623     }
   621    624   }