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: Nathaniel Smith
Subject: Re: [Monotone-devel] Setting up syncs & read/write permissions on Windows
Date: Thu, 26 Apr 2007 19:06:02 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

On Thu, Apr 26, 2007 at 06:13:45PM -0400, Ken MacDonald wrote:
> >Well, the thing is that Windows users in general have no real knowledge
> >what a "home directory" is and where it is located at all.
> 
> Probably from the day when these boxes only ran MS-DOS; who needed a
> home dir if you only have 1 user?
> 
> But monotone apparently figures it out for you "on the fly". The first
> day I followed a bit of the tutorial (on my windows box) I entered the
> command as described in the tutorial:
> 
> mtn db init --db=~/beth.mtn
> 
> which is not a valid pathname in native windows-speak.
> 
> mtn apparently either guessed (or obtained from a windows service)
> that I really meant:
> 
> mtn db init --db="C:\Documents and Settings\<username>.<WORKGROUP>\beth.mtn"
> 
> because that's what it did. It would be useful if it *told* me
> somewhere where I should expect things to be created on Windows,
> either as output from the "mtn db init..." command, or in the doc
> somewhere. Or both.

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

> >tries to hide such "malicious overinformation" more and more with every
> >reincarnation of Windows (ever wondered why your desktop is the root
> >node in the Windows explorer, obviously its physically located somewhere
> >in your $HOMEDIR?). While I surely think this is an issue for Windows
> >users, I don't think its monotone's responsibility to clarify how they
> >can/should use their chosen operating system and where the standard
> >paths are located. Call me biased, but looking back at my Windows time
> >just makes me shuddering.
> 
> While I appreciate your horror of Windows (me too!!!) I suspect that
> you would entice more folks to use/contribute to monotone (seems to be
> a goal of this group, yes?) if you made it less daunting, especially
> in the initial try-out phase. Example doc could look like:
> 
> Now we create a database:
> 
> mtn db init --db=~/beth.mtn
> 
> Windows:
> 
> mtn db init --db=C:\my_db_dir\beth.mtn
> 
> in the few places that could use it.

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

  mtn db init --db=beth.mtn

That rather eliminates the issue :-).

-- Nathaniel

-- 
Damn the Solar System.  Bad light; planets too distant; pestered with
comets; feeble contrivance; could make a better one myself.
  -- Lord Jeffrey




reply via email to

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