monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] [ANNOUNCE] monotone 0.32 released


From: Thomas Moschny
Subject: Re: [Monotone-devel] [ANNOUNCE] monotone 0.32 released
Date: Sat, 6 Jan 2007 18:33:23 +0100
User-agent: KMail/1.9.5

On Wednesday 27 December 2006 23:02, Richard Levitte - VMS Whacker wrote:
> 0.32 release.
>
>         Changes
>
>         - "mtn serve" no longer takes patterns on the command line.
>           Use the permissions hooks instead.

This causes problems when using the ssh:// protocol for syncing, and the 
remote side runs monotone < 0.32. In order to solve this temporarily (until 
the other side is updated to 0.32), one can restore the old version of the 
get_netsync_connect_command lua hook that included the branch patterns on the 
mtn commandline to be executed via ssh.

Attached is a lua sniplet made by Ronny (r0nny) Pfannschmidt that overrides 
the get_netsync_connect_command() and use_transport_auth() hooks. By 
introducing an ssh-old:// protocol, it allows connecting to both, sites 
running 0.32, and sites running a version < 0.32. Thanks r0nny for figuring 
out the details!

Regards,
Thomas
function get_netsync_connect_command(uri, args)
   
   local argv = nil
   local s = uri["scheme"]

   if (s == "ssh" or s == "ssh-old") 
      and uri["host"]
      and uri["path"] then
      
      argv = { "ssh" }
      if uri["user"] then
         table.insert(argv, "-l")
         table.insert(argv, uri["user"])
      end
      if uri["port"] then
         table.insert(argv, "-p")
         table.insert(argv, uri["port"])
      end
      
      -- ssh://host/~/dir/file.mtn or
      -- ssh://host/~user/dir/file.mtn should be home-relative
      if string.find(uri["path"], "^/~") then
         uri["path"] = string.sub(uri["path"], 2)
      end
      
      table.insert(argv, uri["host"])
   end
   
   if s == "file" and uri["path"] then
      argv = { }
   end
   
   if argv then
      
      table.insert(argv, get_mtn_command(uri["host"]))
      
      if args["debug"] then
         table.insert(argv, "--debug")
      else
         table.insert(argv, "--quiet")
      end
      
      table.insert(argv, "--db")
      table.insert(argv, uri["path"])
      table.insert(argv, "serve")
      table.insert(argv, "--stdio")
      table.insert(argv, "--no-transport-auth")

      if  s == "ssh-old" then
         if args["include"] then
            local include = "'" .. args["include"] .. "'"
            table.insert(argv, include)
         end
         
         if args["exclude"] then
            table.insert(argv, "--exclude")
            local exclude = "'" .. args["exclude"] .. "'"
            table.insert(argv, exclude)
         end
      end
      
   end
   return argv
end


function use_transport_auth(uri)
   local s = uri["scheme"]
   if s == "ssh" or s == "ssh-old" or s == "file" then
      return false
   else
      return true
   end
end

reply via email to

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