Fossil

Check-in [872f6a45]
Login

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

Overview
Comment:fixed error on dir page with unknown checkins
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wolfgangFormat2CSS_2
Files: files | file ages | folders
SHA1:872f6a45e3338b77ed10ec49598343ff2ae7741d
User & Date: wolfgang 2010-09-27 15:44:09
Original Comment: fixed error on dir page with unknown checkins
References
2010-09-29
12:48
Better handling of /dir pages with unknown checkins. Rework of check-in [872f6a45e3338b77ed10ec49598343ff2ae7741d] for ticket [cc4cd990165317f38618f5b784befd3e9ff3fe61]. check-in: e01f7e6d user: drh tags: wolfgangFormat2CSS_2
2010-09-27
15:45 Ticket [cc4cd990] dir browser crashes on unknown checkin name status still Open with 2 other changes artifact: 665e0c54 user: wolfgang
Context
2010-09-27
15:56
length of short checkin uuid for dir page restored to 10 check-in: b72065df user: wolfgang tags: wolfgangFormat2CSS_2
15:44
fixed error on dir page with unknown checkins. Ticket [cc4cd99016531]. check-in: 872f6a45 user: wolfgang tags: wolfgangFormat2CSS_2
12:35
corrected dependency for page_index.h in PellesC-Make check-in: f8b8e530 user: wolfgang tags: wolfgangFormat2CSS_2
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/browse.c.

104
105
106
107
108
109
110

111
112
113
114
115
116
117
...
124
125
126
127
128
129
130







131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
  int mxLen;
  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; }
................................................................................

  /* If a specific check-in is requested, fetch and parse it. */
  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&amp;name=%T", g.zTop, zUuid, zPrefix);
    if( zD ){
      style_submenu_element("Top", "Top", "%s/dir?ci=%S", g.zTop, zUuid);
      style_submenu_element("All", "All", "%s/dir?name=%t", g.zTop, zD);







>







 







>
>
>
>
>
>
>












<

|







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
125
126
127
128
129
130
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
  int mxLen;
  int nCol, nRow;
  int cnt, i;
  char *zPrefix;
  Stmt q;
  const char *zCI = P("ci");
  int rid = 0;
  char *zUuid = 0;
  Blob content;
  Blob dirname;
  Manifest m;
  const char *zSubdirLink;

  login_check_credentials();
  if( !g.okHistory ){ login_needed(); return; }
................................................................................

  /* If a specific check-in is requested, fetch and parse it. */
  if( zCI && (rid = name_to_rid(zCI))!=0 && content_get(rid, &content) ){
    if( !manifest_parse(&m, &content) || m.type!=CFTYPE_MANIFEST ){
      zCI = 0;
    }
  }
  /* check existing checkin */
  if (zCI){
    zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
    if (!zUuid){
      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 zShort[20];
    memcpy(zShort, zUuid, 1);
    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&amp;name=%T", g.zTop, zUuid, zPrefix);
    if( zD ){
      style_submenu_element("Top", "Top", "%s/dir?ci=%S", g.zTop, zUuid);
      style_submenu_element("All", "All", "%s/dir?name=%t", g.zTop, zD);