Re: [fossil-users] Direct URL for downloading a file from the repository via CGI interface

2010-03-18 Thread D. Richard Hipp

On Mar 18, 2010, at 3:15 PM, Michael Barrow wrote:

 I'm trying to make a URL with a link to directly download something  
 from the repository. By navigating through the Files interface, I  
 eventually see the Download link and could definitely use this.  
 However, I have a question: what's the purpose of the name=XX at  
 the end of the URL. For example,
 http://server/repo/raw/path1/path2/file.c?name=22


The 22 is a semi-transient rowid on an internal table (semi- 
transient in the sense that it is different on each repository and  
probably changes when you rebuild).  Allowing rowids in this context  
is bad design, it seems to me.  This is something I am working to fix.

You can substitute the 40-character hex artifact ID for the 22  
here - or any unique prefix of the artifact ID.  For example:

 http://server/repo/raw/path1/path2/file.c?name=cfa2bf991fb8

Note that the /path1/path2/file.c part of the URL is currently only  
used to determine the mimetype and suggested filename for the  
download.  That too might change in the future so that the /path1/ 
path2/file.c carries more meaning and plays a bigger role in  
selecting the object to be downloaded.  For example, it should  
probably allow:

 http://server/repo/raw/path1/path2/file.c?name=release

... in order to download the latest version of path1/path2/file.c that  
appears in a check-in tagged with release.  It should, but it  
doesn't.  At least not yet...

D. Richard Hipp
d...@hwaci.com



___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Direct URL for downloading a file from the repository via CGI interface

2010-03-18 Thread Stephan Beal
On Thu, Mar 18, 2010 at 8:31 PM, D. Richard Hipp d...@hwaci.com wrote:

 The 22 is a semi-transient rowid on an internal table (semi-
 transient in the sense that it is different on each repository and
 probably changes when you rebuild).  Allowing rowids in this context
 is bad design, it seems to me.  This is something I am working to fix.


In my experience, sqlite rowids are not transient IFF you explicitly declre
them in the CREATE TABLE code. e.g. here's a snipped i've got lying around:

CREATE TABLE c11n_SQLITE_TBL_N -- c11n_nodes
(
rowid INTEGER PRIMARY KEY AUTOINCREMENT,
pid INTEGER REFERENCES c11n_SQLITE_TBL_N(rowid),
class TEXT,
name TEXT
);



:-?

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users