monotone-devel
[Top][All Lists]
Advanced

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

[Monotone-devel] dir containing db.mtn as uri


From: Roland McGrath
Subject: [Monotone-devel] dir containing db.mtn as uri
Date: Wed, 13 Feb 2008 17:28:46 -0800 (PST)

[I'm not on the list, so please keep me CC'd on replies.]

How would folks feel about a change something like the patch below?

This treats a directory name in --db as if it were directory/db.mtn if that
file exists.  The motivation for this is to facilitate using a URI like:

        ssh://mtn.foo.com/mtn/project

This is what every other SCM's URIs look like (replace mtn with git, hg, etc).
Right now, I have to use:

        ssh://mtn.foo.com/mtn/project/db.mtn

The journal files and such mean that for separating each project into its
own db with user file permissions controlling access by accounts on the
same ssh server, each db really has to live in its own directory with the
right project's permission settings.  So I can't just use /mtn/project as
the name of the db file itself.

Obviously this could be done by a front-end forced ssh command that
rewrites the mtn command to be run.  But I think it should be made as
simple as possible to set this sort of thing up, and it helps a lot for the
canonical setup to match what people already do for git.

This patch is surely not the cleanest way to do this, but it seems to work.
I'd be glad for a different implementation of the same idea by someone 
who actually understands the code.


Thanks,
Roland


============================================================
--- database.cc d36a920b633f8d14a1b06756d0eb0e569c1dd608
+++ database.cc c017e01150f759311c50d85807d0aa7b33a3de74
@@ -3460,6 +3460,14 @@ database::check_db_exists()
                                 "That is actually a workspace.  Did you mean: 
\n"
                                 "%s") % filename % database_option );
           }
+
+        system_path inside = filename / "db.mtn";
+        if (get_path_status(inside) == path::file)
+          {
+            filename = inside;
+            return;
+          }
+
         N(false, F("%s is a directory, not a database") % filename);
       }
       break;




reply via email to

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