Richard, I think you should look into winhttp.c for this issue (tested your 
patch, well no luck). In line 133, I believe we also need to check the 
HTTP_SERVER_HAD_REPOSITORY flag we assigned in main.c: 

- if( (p->flags & HTTP_SERVER_HAD_CHECKOUT)==0 ){ 
+ if( (p->flags & (HTTP_SERVER_HAD_CHECKOUT | HTTP_SERVER_HAD_REPOSITORY))==0 
){ 

Works on my machine (Win7 x64, MSVC 2013,  tip of the trunk [138313df] + your 
patch).


Mike


----- Original Message -----
From: Richard Hipp <[email protected]>
To: Fossil SCM user's discussion <[email protected]>
Sent: Sunday, December 27, 2015 4:31 PM
Subject: Re: [fossil-users] Show current checkout and branch in Web UI

On 12/26/15, Steve Stefanovich <[email protected]> wrote:
>> >> It only works if you start it without a repository name from within
>> >> an open checkout.
>> >
>> > But I do start it from the open checkout directory without arguments,
>> > and it doesn't work ('no such object: current'); tried 1.33 and 1.34,
>> > on
>> Windows.
>>
>> Works for me on Linux.  I'll fire up a windows box and try it there after
>> I finish
>> the other email I was working on....
>
> It definitely doesn't work on Windows. I've tried previously at work with
> Windows 7,  and again at home with windows 8.1:
>

I'm on travel and hence do not have access to a windows development
machine right this moment, so I cannot test the patch below.  Please
try it out for me and let me know if it clears your problem:

Index: src/main.c
==================================================================
--- src/main.c
+++ src/main.c
@@ -2507,13 +2507,13 @@
                             zBrowser, zIpAddr, zInitPage);
     }else{
       zBrowserCmd = mprintf("%s http://localhost:%%d/%s &",
                             zBrowser, zInitPage);
     }
-    if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
     if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
   }
+  if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
   db_close(1);
   if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
     fossil_fatal("unable to listen on TCP socket %d", iPort);
   }
   g.sslNotAvailable = 1;
@@ -2540,13 +2540,13 @@
                             zBrowser, zIpAddr, zInitPage);
     }else{
       zBrowserCmd = mprintf("%s http://localhost:%%d/%s &",
                             zBrowser, zInitPage);
     }
-    if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
     if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
   }
+  if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
   db_close(1);
   if( allowRepoList ){
     flags |= HTTP_SERVER_REPOLIST;
   }
   if( win32_http_service(iPort, zNotFound, zFileGlob, flags) ){


-- 
D. Richard Hipp
[email protected]

_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to