Fossil

Check-in [4db129c9]
Login

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

Overview
Comment:Changes to file browser to be more direct and describing what is seen in the union of all files from all versions. Add hyperlinks to tip and trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4db129c9250ead78387dd4b760213149e75321ed
User & Date: drh 2010-03-08 14:12:28
Context
2010-03-08
14:18
Make the File menu option default to showing only the files in tip. check-in: 599e6abf user: drh tags: trunk, release
14:12
Changes to file browser to be more direct and describing what is seen in the union of all files from all versions. Add hyperlinks to tip and trunk. check-in: 4db129c9 user: drh tags: trunk
13:18
Get skins working again. They were busted by check-in [5476e50d659] (which was backed out using the new --backout option to merge.) Also add an unused query parameter to the style.css to force a reload of the CSS when the skin changes. check-in: b22e5a9e user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/browse.c.

111
112
113
114
115
116
117

118
119
120
121
122
123
124
...
131
132
133
134
135
136
137

138
139
140
141
142

143
144
145
146
147
148
149
150
151
152
153
154
155
156

157
158
159



160
161
162


163










164
165
166
167
168
169
170
  int nCol, nRow;
  int cnt, i;
  char *zPrefix;
  Stmt q;
  const char *zCI = P("ci");
  int rid = 0;
  Blob content;

  Manifest m;
  const char *zSubdirLink;

  login_check_credentials();
  if( !g.okHistory ){ login_needed(); return; }
  style_header("File List");
  sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0,
................................................................................
  if( zCI && (rid = name_to_rid(zCI))!=0 && content_get(rid, &content) ){
    if( !manifest_parse(&m, &content) || m.type!=CFTYPE_MANIFEST ){
      zCI = 0;
    }
  }

  /* Compute the title of the page */  

  if( zD ){
    Blob title;

    blob_zero(&title);
    blob_appendf(&title, "Files in directory ");

    hyperlinked_path(zD, &title);
    @ <h2>%s(blob_str(&title))
    blob_reset(&title);
    zPrefix = mprintf("%h/", zD);
  }else{
    @ <h2>Files in the top-level directory
    zPrefix = "";
  }
  if( zCI ){
    char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
    char zShort[20];
    memcpy(zShort, zUuid, 10);
    zShort[10] = 0;
    @ of check-in [<a href="vinfo?name=%T(zUuid)">%s(zShort)</a>]</h2>

    zSubdirLink = mprintf("%s/dir?ci=%s&name=%T", g.zBaseURL, zUuid, zPrefix);
    if( zD ){
      style_submenu_element("Top", "Top", "%s/dir?ci=%s", g.zBaseURL, zUuid);



    }
  }else{
    @ </h2>


    zSubdirLink = mprintf("%s/dir?name=%T", g.zBaseURL, zPrefix);










  }

  /* Compute the temporary table "localfiles" containing the names
  ** of all files and subdirectories in the zD[] directory.  
  **
  ** Subdirectory names begin with "/".  This causes them to sort
  ** first and it also gives us an easy way to distinguish files







>







 







>

<
<
<
<
>
|
<
<


|







|
>



>
>
>


<
>
>

>
>
>
>
>
>
>
>
>
>







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
...
132
133
134
135
136
137
138
139
140




141
142


143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162

163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
  int nCol, nRow;
  int cnt, i;
  char *zPrefix;
  Stmt q;
  const char *zCI = P("ci");
  int rid = 0;
  Blob content;
  Blob dirname;
  Manifest m;
  const char *zSubdirLink;

  login_check_credentials();
  if( !g.okHistory ){ login_needed(); return; }
  style_header("File List");
  sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0,
................................................................................
  if( zCI && (rid = name_to_rid(zCI))!=0 && content_get(rid, &content) ){
    if( !manifest_parse(&m, &content) || m.type!=CFTYPE_MANIFEST ){
      zCI = 0;
    }
  }

  /* Compute the title of the page */  
  blob_zero(&dirname);
  if( zD ){




    blob_append(&dirname, "in directory ", -1);
    hyperlinked_path(zD, &dirname);


    zPrefix = mprintf("%h/", zD);
  }else{
    blob_append(&dirname, "in the top-level directory", -1);
    zPrefix = "";
  }
  if( zCI ){
    char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
    char zShort[20];
    memcpy(zShort, zUuid, 10);
    zShort[10] = 0;
    @ <h2>Files of check-in [<a href="vinfo?name=%T(zUuid)">%s(zShort)</a>]
    @ %s(blob_str(&dirname))</h2>
    zSubdirLink = mprintf("%s/dir?ci=%s&name=%T", g.zBaseURL, zUuid, zPrefix);
    if( zD ){
      style_submenu_element("Top", "Top", "%s/dir?ci=%s", g.zBaseURL, zUuid);
      style_submenu_element("All", "All", "%s/dir?name=%t", g.zBaseURL, zD);
    }else{
      style_submenu_element("All", "All", "%s/dir", g.zBaseURL);
    }
  }else{

    @ <h2>The union of all files from all check-ins
    @ %s(blob_str(&dirname))</h2>
    zSubdirLink = mprintf("%s/dir?name=%T", g.zBaseURL, zPrefix);
    if( zD ){
      style_submenu_element("Top", "Top", "%s/dir", g.zBaseURL);
      style_submenu_element("Tip", "Tip", "%s/dir?name=%t&ci=tip",
                            g.zBaseURL, zD);
      style_submenu_element("Trunk", "Trunk", "%s/dir?name=%t&ci=trunk",
                             g.zBaseURL,zD);
    }else{
      style_submenu_element("Tip", "Tip", "%s/dir?ci=tip", g.zBaseURL);
      style_submenu_element("Trunk", "Trunk", "%s/dir?ci=trunk", g.zBaseURL);
    }
  }

  /* Compute the temporary table "localfiles" containing the names
  ** of all files and subdirectories in the zD[] directory.  
  **
  ** Subdirectory names begin with "/".  This causes them to sort
  ** first and it also gives us an easy way to distinguish files

Changes to src/name.c.

138
139
140
141
142
143
144


145
146
147
148
149
150
151
...
181
182
183
184
185
186
187









188
189
190
191
192
193
194
**
** If the input string is of the form:
**
**      tag:date
**
** Then return the UUID of the oldest check-in with that tag that is
** not older than 'date'.


**
** Memory to hold the returned string comes from malloc() and needs to
** be freed by the caller.
*/
char *tag_to_uuid(const char *zTag){
  char *zUuid = 
    db_text(0,
................................................................................
          "   AND blob.rid=event.objid "
          "   AND event.mtime<=julianday(%Q %s)"
          " ORDER BY event.mtime DESC ",
          zTagBase, zDate, (useUtc ? "" : ",'utc'")
        );
        break;
      }









    }
  }
  return zUuid;
}

/*
** Convert a date/time string into a UUID.







>
>







 







>
>
>
>
>
>
>
>
>







138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
...
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
**
** If the input string is of the form:
**
**      tag:date
**
** Then return the UUID of the oldest check-in with that tag that is
** not older than 'date'.
**
** An input of "tip" returns the most recent check-in.
**
** Memory to hold the returned string comes from malloc() and needs to
** be freed by the caller.
*/
char *tag_to_uuid(const char *zTag){
  char *zUuid = 
    db_text(0,
................................................................................
          "   AND blob.rid=event.objid "
          "   AND event.mtime<=julianday(%Q %s)"
          " ORDER BY event.mtime DESC ",
          zTagBase, zDate, (useUtc ? "" : ",'utc'")
        );
        break;
      }
    }
    if( zUuid==0 && strcmp(zTag, "tip")==0 ){
      zUuid = db_text(0,
        "SELECT blob.uuid"
        "  FROM event, blob"
        " WHERE event.type='ci'"
        "   AND blob.rid=event.objid"
        " ORDER BY event.mtime DESC"
      );
    }
  }
  return zUuid;
}

/*
** Convert a date/time string into a UUID.