monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Setting up syncs & read/write permissions on Window


From: Ken MacDonald
Subject: Re: [Monotone-devel] Setting up syncs & read/write permissions on Windows
Date: Fri, 27 Apr 2007 09:51:31 -0400

On 4/26/07, Nathaniel Smith <address@hidden> wrote:
Windows does have a concept of a home directory!  Sort of.  Very sort
of.  The current logic, which we stole from Qt, is:
  check to see if user has HOME envvar set (I think this is mostly for
    cygwin users and the like)
  check to see if user has USERPROFILE envvar set (I think most people
    do)
  check to see if user has HOMEDRIVE & HOMEPATH envvars set
  check to see if user has SystemDrive envvar set
  just use "c:" as home directory
These are all official ways to do this, and there's actually another
way that we don't try...

Probably you can see what ~ means to monotone by running
  echo %USERPROFILE%
though.

The conf dir is actually much simpler, we just check for the envvar
APPDATA, which is standard.  You can see it just the same way:
  echo %APPDATA%
Though here we _do_ fall back on the magic win32 api call if the
envvar is not set (SHGetFolderPath(NULL, CSIDL_APPDATA, ...), of
course!)

This is all just in win32/fs.cc in the source:
  
http://viewmtn.angrygoats.net/revision/file/386bd5fab3b55635765c1f0bc3beddbe970afc8d/win32/fs.cc

Hi Nathaniel,
Very Cool. Using this reply as fuel, I was able to find out quite a
bit more about Windows envvars than I knew before. %USERPROFILE% and
%APPDATA% appears to indeed be the main responsible parties in my
case; what I didn't know is that there are quite a batch of  "hidden"
envvars - those two among them - that do NOT show up in the control
panel when you look at the envvars there. I found a pretty nice list
at:

http://kennethhunt.com/archives/000933.html

but Google brought up a bunch of similar ones if that one goes missing
someday. Anyway, this explains a bunch of behavior, not just for mtn,
but other Windows apps.

Maybe it should just be a relative path, in fact...

  mtn db init --db=beth.mtn

That rather eliminates the issue :-).

-- Nathaniel

That approach works quite well for several things in the doc; there
are still a few that are quite different on Win vs. u*x, besides 'cat'
<--> 'type'. I wasn't able to get the ssh 'password saving' thing from
the tutorial going, as Windows doesn't appear to have an 'ssh-add' or
'ssh-agent' command to utilize the 'id_monotone' file described there.
Also, using the command from the tutorial "mtn ssh_agent_export
~/.ssh/id_monotone" resulted in no file being created. I figured maybe
the '.ssh' directory didn't exist, so tried "mtn ssh_agent_export
~/id_monotone", and it still failed silently. Finally, trying "mtn
ssh_agent_export id_monotone" it created id_monotone in a local
directory, but it seems that it's perhaps a bug that "mtn
ssh_agent_export" doesn't seem to honor translating "~" to some
representation of a home directory as "mtn db init" does. Or maybe
it's a bug that "db init" works - I'd be happy getting a "hey, I don't
understand ~/beth.mtn - you're on Windows, remember?" message :-) but
having inconsistent usage between commands is confusing.
Thanks again for the info,
Ken




reply via email to

[Prev in Thread] Current Thread [Next in Thread]