Re: [fossil-users] cgi.c

2010-05-25 Thread Rüdiger Härtel
Hi!

If you want to debug a child process then you have to tell gdb to do so. See 
this website:

http://www.delorie.com/gnu/docs/gdb/gdb_26.html

Ruediger


Am Mittwoch 12 Mai 2010 17:41:00 schrieb zacht...@cis-partners.com:
> I don't understand how the fossil web server is interacting with the child
>  processes that it launches.  I see the code in cgi.c that does the
>  launching, but I don't see how the child processes actually know what it
>  is they should be doing.
> 
> if( select( listener+1, &readfds, 0, 0, &delay) ){
>   lenaddr = sizeof(inaddr);
>   connection = accept(listener, (struct sockaddr*)&inaddr,
> (socklen_t*) &lenaddr);
>   if( connection>=0 ){
> child = fork();
> if( child!=0 ){
>   if( child>0 ) nchildren++;
>   close(connection);
> }else{
>   close(0);
>   dup(connection);
>   close(1);
>   dup(connection);
>   if( !g.fHttpTrace && !g.fSqlTrace ){
> close(2);
> dup(connection);
>   }
>   close(connection);
>   return 0;
> }
>   }
> }
> 
> Furthermore, I am trying to debug some web functions that I have written
>  using ddd, but that is monitoring only the server process.  Does anyone
>  have some advice on how I might debug my web functions?
> 
> Thanks.
> 
> ___
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
> 
___
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] cgi.c

2010-05-25 Thread zachtodd
Hey,

Thanks for the link.  I eventually came around to the same technique in ddd, 
putting a sleep call in the function that the child executes, using ps to find 
the parent process id, and then attaching to the child with ddd.



___
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] cgi.c

2010-05-25 Thread Richard Hipp
The debugging technique I normally use is to run the "fossil http" command
directly from the debugger.  The HTTP request can be either manually typed
in, or redirected from a file.

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


[fossil-users] ignore list

2010-05-25 Thread zachtodd
I am thinking about taking a stab at implementing an ignore-list feature 
similar to git's .gitignore to prevent pesky and unwanted files from making it 
into commits.  If this feature already exists in Fossil I have overlooked it.  

My initial plan is to have a list of patterns contained within a versioned 
file.  When an add is done, Fossil will check to see if the ignore-list file 
exists, and if so subsequently check each file to be added against that list.

Any thoughts on this?

___
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] ignore list

2010-05-25 Thread Richard Hipp
On Tue, May 25, 2010 at 8:40 AM,  wrote:

> I am thinking about taking a stab at implementing an ignore-list feature
> similar to git's .gitignore to prevent pesky and unwanted files from making
> it into commits.  If this feature already exists in Fossil I have overlooked
> it.
>
> My initial plan is to have a list of patterns contained within a versioned
> file.  When an add is done, Fossil will check to see if the ignore-list file
> exists, and if so subsequently check each file to be added against that
> list.
>
> Any thoughts on this?
>

See the "ignore-glob" setting.



>
> ___
> 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] ignore list

2010-05-25 Thread Jeremy Cowgar

On 5/25/2010 8:43 AM, Richard Hipp wrote:


On Tue, May 25, 2010 at 8:40 AM, > wrote:


I am thinking about taking a stab at implementing an ignore-list
feature similar to git's .gitignore to prevent pesky and unwanted
files from making it into commits.  If this feature already exists
in Fossil I have overlooked it.

See the "ignore-glob" setting.


I placed this setting in the Web Admin page once it was added. You can 
find it in Admin > Behavior


Jeremy

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


[fossil-users] Patch to not show files not added to repository in /doc/ckout

2010-05-25 Thread Michal Suchanek
Hello

Since fossil happily serves files not added to repository in
/doc/ckout I fixed the issue locally to make /doc/ckout match /doc/tip
after the changes are committed.

The issue is reported as 0e5d75657f

I do not understand the fossil source well enough to make changes with
confidence but since this is only for reading stuff it should not
break anything unrelated. Also it would be nice to add meaningful
messages for the other cases when fetching a doc page fails.

I tried the patch and it works for me.

Thanks

Michal
Index: src/doc.c
===
--- src/doc.c
+++ src/doc.c
@@ -330,10 +330,11 @@
   int vid = 0;  /* Artifact of baseline */
   int rid = 0;  /* Artifact of file */
   int i;/* Loop counter */
   Blob filebody;/* Content of the documentation file */
   char zBaseline[UUID_SIZE+1];  /* Baseline UUID */
+  char * reason = "document not present in the repository";
 
   login_check_credentials();
   if( !g.okRead ){ login_needed(); return; }
   zName = PD("name", "tip/index.wiki");
   for(i=0; zName[i] && zName[i]!='/'; i++){}
@@ -343,10 +344,11 @@
   memcpy(zBaseline, zName, i);
   zBaseline[i] = 0;
   zName += i;
   while( zName[0]=='/' ){ zName++; }
   if( !file_is_simple_pathname(zName) ){
+reason = "filename contains illegal characters";
 goto doc_not_found;
   }
   if( strcmp(zBaseline,"ckout")==0 && db_open_local()==0 ){
 strcpy(zBaseline,"tip");
   }
@@ -353,14 +355,26 @@
   if( strcmp(zBaseline,"ckout")==0 ){
 /* Read from the local checkout */
 char *zFullpath;
 db_must_be_within_tree();
 zFullpath = mprintf("%s/%s", g.zLocalRoot, zName);
+if( ! db_exists(
+  "SELECT 1 FROM vfile" " WHERE pathname=%Q AND deleted=0 "
+#ifdef __MINGW32__
+  "COLLATE nocase"
+#endif
+  , zName) ) {
+  reason = "file not added to the repository";
+  goto doc_not_found;
+}
+
 if( !file_isfile(zFullpath) ){
+  reason = "file not found";
   goto doc_not_found;
 }
 if( blob_read_from_file(&filebody, zFullpath)<0 ){
+  reason = "cannot read file";
   goto doc_not_found;
 }
   }else{
 db_begin_transaction();
 if( strcmp(zBaseline,"tip")==0 ){
@@ -464,11 +478,11 @@
 
 doc_not_found:
   /* Jump here when unable to locate the document */
   db_end_transaction(0);
   style_header("Document Not Found");
-  @ No such document: %h(PD("name","tip/index.wiki"))
+  @ Error: %h(reason): %h(zName)
   style_footer();
   return;
 }
 
 /*

___
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] Patch to not show files not added to repository in /doc/ckout

2010-05-25 Thread Eric

> Hello
>
> Since fossil happily serves files not added to repository in
> /doc/ckout I fixed the issue locally to make /doc/ckout match /doc/tip
> after the changes are committed.
>
> The issue is reported as 0e5d75657f
>
> I do not understand the fossil source well enough to make changes with
> confidence but since this is only for reading stuff it should not
> break anything unrelated. Also it would be nice to add meaningful
> messages for the other cases when fetching a doc page fails.
>
> I tried the patch and it works for me.
>
> Thanks
>
> Michal

But ckout is only available if the server is running in a local checkout,
otherwise it is silently converted to tip and what you see is the
checked-in version. You don't see uncommitted changes unless you run the
server in a checkout directory tree, which sort-of implies that you are
changing stuff. The main intent was to allow you to see how a set of doc
files is rendered while you are still working on it. See the last
paragraph of

http://www.fossil-scm.org/fossil/doc/tip/www/embeddeddoc.wiki

This is NOT a bug, it is a useful feature.

Regards,

Eric



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


-- 


___
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] Patch to not show files not added to repository in /doc/ckout

2010-05-25 Thread Michal Suchanek
On 25 May 2010 19:59, Eric  wrote:
>
>> Hello
>>
>> Since fossil happily serves files not added to repository in
>> /doc/ckout I fixed the issue locally to make /doc/ckout match /doc/tip
>> after the changes are committed.
>>
>> The issue is reported as 0e5d75657f
>>
>> I do not understand the fossil source well enough to make changes with
>> confidence but since this is only for reading stuff it should not
>> break anything unrelated. Also it would be nice to add meaningful
>> messages for the other cases when fetching a doc page fails.
>>
>> I tried the patch and it works for me.
>>
>> Thanks
>>
>> Michal
>
> But ckout is only available if the server is running in a local checkout,
> otherwise it is silently converted to tip and what you see is the
> checked-in version. You don't see uncommitted changes unless you run the
> server in a checkout directory tree, which sort-of implies that you are
> changing stuff. The main intent was to allow you to see how a set of doc
> files is rendered while you are still working on it. See the last
> paragraph of
>
> http://www.fossil-scm.org/fossil/doc/tip/www/embeddeddoc.wiki
>
> This is NOT a bug, it is a useful feature.
>

This is a bug, it should show uncommited files ONLY when they are
marked to be committed.

Otherwise what you commit differs from this preview of files you are working on.

Thanks

Michal
___
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] Patch to not show files not added to repository in /doc/ckout

2010-05-25 Thread Eric Junkermann

On Tue, May 25, 2010 at 10:10 pm, "Michal Suchanek" 
wrote:
> On 25 May 2010 19:59, Eric  wrote:
>>
...
>>
>> But ckout is only available if the server is running in a local checkout,
>> otherwise it is silently converted to tip and what you see is the
checked-in version. You don't see uncommitted changes unless you run
the server in a checkout directory tree, which sort-of implies that you
are changing stuff. The main intent was to allow you to see how a set
of doc files is rendered while you are still working on it. See the
last paragraph of
>>
>> http://www.fossil-scm.org/fossil/doc/tip/www/embeddeddoc.wiki
>>
>> This is NOT a bug, it is a useful feature.
>>
>
> This is a bug, it should show uncommited files ONLY when they are marked
to be committed.

"marked to be committed"? - do you mean that a "fossil add" has been done?
I might work on something, and want to preview it, only to find later that
it should be included as part of another file (or thrown away entirely as
a bad idea).

>
> Otherwise what you commit differs from this preview of files you are
working on.

Why shouldn't it? All I am doing is looking at a work-in-progress. No-one
else is going to see it. When is this going to cause a problem?

Regards,

Eric



-- 
Eric Junkermann

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