Fossil

Check-in [9c06ea31]
Login

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

Overview
Comment:Change the "ls" command so that it only shows the filenames by default. To see the extra information about the status of each file, add the -l option. Ex: "fossil ls -l"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9c06ea312083459c5f73298a0eb457d8f8ee3d00
User & Date: drh 2009-12-17 14:27:06
Context
2009-12-17
14:51
Update the "checkin" command so that the template check-in message contains a comment that shows the branch tags that will be associated with the new check-in. check-in: 6df39e37 user: drh tags: trunk
14:27
Change the "ls" command so that it only shows the filenames by default. To see the extra information about the status of each file, add the -l option. Ex: "fossil ls -l" check-in: 9c06ea31 user: drh tags: trunk
14:21
Change the "revert" command so that it will take multiple file arguments and revert each one. check-in: 353297a1 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/checkin.c.

119
120
121
122
123
124
125
126
127
128

129
130
131
132

133

134
135
136
137
138
139
140
...
142
143
144
145
146
147
148


149
150
151
152
153
154
155
156
  }
  changes_cmd();
}

/*
** COMMAND: ls
**
** Usage: %fossil ls
**
** Show the names of all files in the current checkout

*/
void ls_cmd(void){
  int vid;
  Stmt q;



  db_must_be_within_tree();
  vid = db_lget_int("checkout", 0);
  vfile_check_signature(vid);
  db_prepare(&q,
     "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)"
     "  FROM vfile"
     " ORDER BY 1"
................................................................................
  while( db_step(&q)==SQLITE_ROW ){
    const char *zPathname = db_column_text(&q,0);
    int isDeleted = db_column_int(&q, 1);
    int isNew = db_column_int(&q,2)==0;
    int chnged = db_column_int(&q,3);
    int renamed = db_column_int(&q,4);
    char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname);


    if( isNew ){
      printf("ADDED     %s\n", zPathname);
    }else if( access(zFullName, 0) ){
      printf("MISSING   %s\n", zPathname);
    }else if( isDeleted ){
      printf("DELETED   %s\n", zPathname);
    }else if( chnged ){
      printf("EDITED    %s\n", zPathname);







|

|
>




>

>







 







>
>
|







119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
...
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
  }
  changes_cmd();
}

/*
** COMMAND: ls
**
** Usage: %fossil ls [-l]
**
** Show the names of all files in the current checkout.  The -l provides
** extra information about each file.
*/
void ls_cmd(void){
  int vid;
  Stmt q;
  int isBrief;

  isBrief = find_option("l","l", 0)==0;
  db_must_be_within_tree();
  vid = db_lget_int("checkout", 0);
  vfile_check_signature(vid);
  db_prepare(&q,
     "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)"
     "  FROM vfile"
     " ORDER BY 1"
................................................................................
  while( db_step(&q)==SQLITE_ROW ){
    const char *zPathname = db_column_text(&q,0);
    int isDeleted = db_column_int(&q, 1);
    int isNew = db_column_int(&q,2)==0;
    int chnged = db_column_int(&q,3);
    int renamed = db_column_int(&q,4);
    char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname);
    if( isBrief ){
      printf("%s\n", zPathname);
    }else if( isNew ){
      printf("ADDED     %s\n", zPathname);
    }else if( access(zFullName, 0) ){
      printf("MISSING   %s\n", zPathname);
    }else if( isDeleted ){
      printf("DELETED   %s\n", zPathname);
    }else if( chnged ){
      printf("EDITED    %s\n", zPathname);