[fossil-users] generating ticket lists as JSON from the command line

2011-04-20 Thread Stephan Beal
Hi, all!

i finally found a good use-case for my sql-to-json tool: the past days
someone has taken the time to file a few tickets in two separate repos of
mine. It was only by accident that i saw them (b/c i like to read my own
timeline page from time to time), and i want to get the info fed to me. i
couldn't find an rss feed for the tickets, but i was able to use this tool
to implement it easily:

http://fossil.wanderinghorse.net/repos/cson/index.cgi/wiki?name=select-to-json

Example:

Copy your favourite ticket report query/queries to a file:

stephan@tiny:~/cvs/fossil/cson$ cat  fossil-tickets.sql
SELECT
  CASE WHEN status IN ('Open','Verified') THEN '#f2dcdc'
   WHEN status='Review' THEN '#e8e8e8'
   WHEN status='Fixed' THEN '#cfe8bd'
   WHEN status='Tested' THEN '#bde5d6'
   WHEN status='Deferred' THEN '#cacae5'
   ELSE '#c8c8c8' END AS 'bgcolor',
  substr(tkt_uuid,1,10) AS '#',
  datetime(tkt_mtime) AS 'mtime',
  type,
  status,
  subsystem,
  title
FROM ticket
WHERE status NOT IN ('Closed')
^D

(or ^Z on Windows, IIRC)

then:

stephan@tiny:~/cvs/fossil$ ./select-to-json -d 'sqlite3:whio.fsl' -S
fossil-tickets.sql
{
columns:[
bgcolor,
#,
mtime,
type,
status,
subsystem,
title
],
rows:[
{
bgcolor:#f2dcdc,
#:cb6afe9640,
mtime:2010-02-16 01:02:45,
type:Reminder,
status:Open,
subsystem:whio_dev,
title:reminder: test subdevice fcntl forwarding
},
...snip...
}

on top of that it is trivial to write a JavaScript app which sorts and shows
me my list of new tickets, and it can be scripted to walk all my repos,
collating the data for me.

If i ever get around to writing such a JS script, i'll post it here.

Happy Hacking!

-- 
- 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


[fossil-users] Opening a repository on webdav

2011-04-20 Thread Tomek Kott
Hi fossil users,

I have the following situation, that seems to be related to
http://www.mail-archive.com/fossil-users@lists.fossil-scm.org/msg03555.html,
but that one doesn't quite seem to work for me. I have am new to fossil, as
I've been using git previously, but like the integration of bugs / wiki /
etc. On git, I can have the working directory (where the files reside) be
separate from the git repository.

My development machine is a Win7 x64 machine. The website application I
develop for I have access to via a webdav connection that is visible as a
mounted drive in explorer. I use cygwin for access to many linux tasks etc.,
and I use a terminal through which I do my fossil work.

So, to the crux of the matter. I set up a new fossil repository (in
~/fossil/) using fossil new site.fossil. I then cd to my mounted drive (cd
/cygdrive/c/htdocs/) and then try to open a local fossil repository via
fossil open ~/fossil/site.fossil The result is the following error:


fossil: SQLITE_ERROR: no such table: vvar
 fossil: no such table: vvar
 REPLACE INTO vvar(name,value)
 VALUES('repository','/cygdrive/c/Users/tkott/fossil/site.fossil')

 If you have recently updated your fossil executable, you might
 need to run fossil all rebuild to bring the repository
 schemas up to date.


This is odd, since I just downloaded and built the fossil executible, and it
is a new repository. If I try the command again, I get:

fossil: SQLITE_ERROR: table vvar already exists
 fossil: table vvar already exists

 If you have recently updated your fossil executable, you might
 need to run fossil all rebuild to bring the repository
 schemas up to date.


Both of these actions create __FOSSIL__, but nothing else happens. If I try
any fossil command, I get fossil: not within an open checkout.

I'm pretty sure I'm missing something simple and not giving enough info, but
does anyone have any hints?

I essentially want to set up a dev environment in which I have two branches,
say trunk and dev so that I can push changes and roll back when
necessary.

Thanks,

Tomek
___
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] Opening a repository on webdav

2011-04-20 Thread Richard Hipp
On Wed, Apr 20, 2011 at 4:00 PM, Tomek Kott tkott.s...@gmail.com wrote:

 Hi fossil users,

 I have the following situation, that seems to be related to
 http://www.mail-archive.com/fossil-users@lists.fossil-scm.org/msg03555.html,
 but that one doesn't quite seem to work for me. I have am new to fossil, as
 I've been using git previously, but like the integration of bugs / wiki /
 etc. On git, I can have the working directory (where the files reside) be
 separate from the git repository.

 My development machine is a Win7 x64 machine. The website application I
 develop for I have access to via a webdav connection that is visible as a
 mounted drive in explorer. I use cygwin for access to many linux tasks etc.,
 and I use a terminal through which I do my fossil work.

 So, to the crux of the matter. I set up a new fossil repository (in
 ~/fossil/) using fossil new site.fossil. I then cd to my mounted drive (cd
 /cygdrive/c/htdocs/) and then try to open a local fossil repository via
 fossil open ~/fossil/site.fossil The result is the following error:


 fossil: SQLITE_ERROR: no such table: vvar
 fossil: no such table: vvar
 REPLACE INTO vvar(name,value)
 VALUES('repository','/cygdrive/c/Users/tkott/fossil/site.fossil')

 If you have recently updated your fossil executable, you might
 need to run fossil all rebuild to bring the repository
 schemas up to date.


 This is odd, since I just downloaded and built the fossil executible, and
 it is a new repository. If I try the command again, I get:

 fossil: SQLITE_ERROR: table vvar already exists
 fossil: table vvar already exists

 If you have recently updated your fossil executable, you might
 need to run fossil all rebuild to bring the repository
 schemas up to date.


 Both of these actions create __FOSSIL__, but nothing else happens. If I try
 any fossil command, I get fossil: not within an open checkout.

 I'm pretty sure I'm missing something simple and not giving enough info,
 but does anyone have any hints?


Probably your hybrid linux+windows+webdev+cygwin system is getting the
underlying SQLite data store confused.  I cannot tell exactly what is
happening, but vvar is a table that should be in the _FOSSIL_ database
file.  Somehow that table is not being created or is not being recognized
after it is created or something.  I'll bet your network filesystem is
somehow to blame.  At least, network filesystems are often the culprit when
these kinds of things come up.  But not having access to your system or an
environment similar to yours, I have no way to debug it.

Background information on the three SQLite database files used by Fossil can
be seen here:

 http://www.fossil-scm.org/fossil/doc/trunk/www/tech_overview.wiki

The _FOSSIL_ file is the checkout database which is created by the fossil
open command.





 I essentially want to set up a dev environment in which I have two
 branches, say trunk and dev so that I can push changes and roll back
 when necessary.

 Thanks,

 Tomek


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




-- 
D. Richard Hipp
d...@sqlite.org
___
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] Opening a repository on webdav

2011-04-20 Thread Lluís Batlle i Rossell
On Wed, Apr 20, 2011 at 04:11:23PM -0400, Richard Hipp wrote:
 On Wed, Apr 20, 2011 at 4:00 PM, Tomek Kott tkott.s...@gmail.com wrote:
 
  So, to the crux of the matter. I set up a new fossil repository (in
  ~/fossil/) using fossil new site.fossil. I then cd to my mounted drive (cd
  /cygdrive/c/htdocs/) and then try to open a local fossil repository via
  fossil open ~/fossil/site.fossil The result is the following error:

I imagine you meant '/cygdrive/not_c/hydocs'.

In any case, I'm not any sure that webDAV supports random access at all. It may
be that it is up to the client whether to give that API to the programs using
the filesystem. Maybe Windows offers read-only random access, but not for
writing. Maybe it is up to the webDAV server.

I imagine fossil requires random access for both reading and writing. Could it
be so? I don't know if there are particular checks about this file capability.

Regards,
Lluís.
___
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] Cloning on IIS

2011-04-20 Thread Tony Perovic
All,

To troubleshoot my cloning problem, I tried running Fossil in CGI mode like 
this:

Set CONTENT_LENGTH=65
Set PATH_INFO=/xfer/xfer
Set REMOTE_USER=tperovic
Set REQUEST_MODE=POST
Set SCRIPT_NAME=/Projects/Test/Test.fossil
Set SERVER_NAME=myserver
Set SERVER_PORT=80
Set SERVER_PORT_SECURE=0
Set SERVER_PROTOCOL=HTTP/1.0
Fossil.exe cgi test.cgi

Also tried:

Set GATEWAY_INTERFACE=CGI/1.1
Fossil.exe test.cgi

Getting this error:

Assertion failed: (pFrom)-xRealloc==blobReallocMalloc || 
(pFrom)-xRealloc==blobReallocStatic, file ./bld/blob_.c, line 379

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I set all the environmental variables that I think it needs. Did I miss any?
Probably looking for those 65 bytes of content on stdin, huh?
What do those 65 bytes contain?

Tony Perovic
Compumation, Inc.

From: Tony Perovic
Sent: Tuesday, April 19, 2011 5:22 PM
To: 'fossil-users@lists.fossil-scm.org'
Subject: Cloning on IIS

Cloning works if I run Fossil in server mode:

Server:  Fossil server myrepository.fossil
Workstation:  Fossil clone 
http://myserver:8080http://myserver:8080/ myclone.fossil

It also works using IIS/CGI if I clone a new, empty repository. However, if I 
try to clone a repository that contains artifacts using IIS/CGI then I get 
errors:

C:\Program Files\Fossil\Fossil.exe: malformed file line.

Comparing the data packets I can see the problem:

Fossil server response:

HTTP/1.0 200 OK
Date: Tue, 19 Apr 2011 20:34:30 GMT
Connection: close
Cache-control: no-cache, no-store
Content-Type: application/x-fossil-uncompressed; charset=utf-8
Content-Length: 793430

: 63 66 69 6C 65 20 65 37 64 34 34 63 34 65 61 64
.
2E4C0: 33 F2 2C F4 AE CC B2 06 00 65 91 08 0D 0A 63 66

Fossil/IIS/CGI response:

Status: 200 OK
Date: Tue, 19 Apr 2011 20:34:30 GMT
Connection: close
Cache-control: no-cache, no-store
Content-Type: application/x-fossil-uncompressed; charset=utf-8
Content-Length: 793430

: 63 66 69 6C 65 20 65 37 64 34 34 63 34 65 61 64
.
2E4C0: 33 F2 2C F4 AE CC B2 06 00 65 91 08 0A 63 66 69

All the 0D/0A pairs got replaced with 0A. Text mode converts \n to \r\n but 
what the hell is converting \r\n to \n ???!?!?!??!

The Perl code that handles CGI requests, in part, looks like this:

$fossil = C:\Program Files\Fossil\Fossil.exe
$cgifile = full path to CGI file
$output = `\$fossil\ \$cgifile\`; # Execute Fossil, capture output

$eoh = index($output,\n\n); # Find end-of-header
$header = substr($output,0,$index); # Just the HTTP header

if ($header =~ m/Content-Type: text/) { # text or binary?
print $output;  # Everything is text mode
}
else {
   print $header\n\n;   # Header is text
   binmode stdout;# The rest is binary
   print substr($output,$eoh + 2);
}

Any chance that Fossil is doing this?

[cid:image001.jpg@01CBFF7F.B8638350]

TONY PEROVIC

tpero...@compumation.commailto:tpero...@compumation.com
www.compumation.com

205 W. Grand Ave., Ste. 121
Bensenville, IL  60106
630-860-1921  Phone
630-860-1928  Fax


inline: image001.jpg___
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] Opening a repository on webdav

2011-04-20 Thread Ron Wilson
On Wed, Apr 20, 2011 at 4:00 PM, Tomek Kott tkott.s...@gmail.com wrote:
 My development machine is a Win7 x64 machine. The website application I
 develop for I have access to via a webdav connection that is visible as a
 mounted drive in explorer. I use cygwin for access to many linux tasks etc.,
 and I use a terminal through which I do my fossil work.

 I essentially want to set up a dev environment in which I have two branches,
 say trunk and dev so that I can push changes and roll back when
 necessary.

I have done something similar in the past, for publishing data to a webserver.

My process was to create a staging area when I was ready for a
release, fetching the files into the staging area much like I would
into a working copy. Once done testing the proposed release in the
staging area, I would copy the staging area to a new folder on the
server. Once the copy was done, I would switch over by running:

  mv data data-prev; mv data-new data

This made for the smoothest transition. However, it was also possible
to just copy from staging to the live website. If a file was still be
written when accessed by the webserver, an incomplete file would be
delivered to the client, so this was not as clean, but it did work.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users