Re: Usher pattern matching (was Re: [Monotone-devel] Usher crashes)

2006-05-14 Thread Jeronimo Pellegrini
On Sat, May 13, 2006 at 11:19:19PM -0500, Timothy Brownawell wrote:
 On Sat, 2006-05-13 at 23:29 -0300, Jeronimo Pellegrini wrote:
  And even if I try to make it match against pattern, it fails,
  because of the way operator== works for struct prefix. Is this
  intentional? Shouldn't it also do partial matches?
 
 It should, and I think now it does.

Yes! It works now. :-)

 As you can probably tell, this hasn't exactly had extensive testing
 since being reorganized. ;-p

That's OK -- we're testing it.
Thanks for writing usher -- it's very useful!

J.


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


[Monotone-devel] Using get_branch_key (so usher can start servers)?

2006-05-14 Thread Jeronimo Pellegrini
Hi.
I was trying to configure usher today and everything works fine now
until the moment when usher will start mtn serve. The problem is
that mtn is always requiring a -k option in the command line:

$ mtn serve main.mtn
mtn: misuse: you have multiple private keys
mtn: misuse: pick one to use for signatures by adding '-kkeyname' to your 
command

But I did include this in my ~/.monotone/monotonerc:

function get_branch_key (branchname)
  return my_key_is_here
end

And I need to use -k my_key_is_here anyway. How should I use the 
get_branch_key hook? I think I did something wrong somewhere...

Thanks,
J.


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


[Monotone-devel] mtn db info doesn't work for empty databases?

2006-05-14 Thread Jeronimo Pellegrini
Hi.

If I run db info on a database that had no commits yet, monotone
fails with the (not very informative) message:

mtn: error: wanted 1 rows got 0 in query: SELECT node FROM 
next_roster_node_number

Would it be possible to get a better message? Or maybe the command could
work for empty databases too?

J.


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] Using get_branch_key (so usher can start servers)?

2006-05-14 Thread Timothy Brownawell
On Sun, 2006-05-14 at 08:12 -0300, Jeronimo Pellegrini wrote:
 Hi.
 I was trying to configure usher today and everything works fine now
 until the moment when usher will start mtn serve. The problem is
 that mtn is always requiring a -k option in the command line:
 
 $ mtn serve main.mtn
 mtn: misuse: you have multiple private keys
 mtn: misuse: pick one to use for signatures by adding '-kkeyname' to your 
 command
 
 But I did include this in my ~/.monotone/monotonerc:
 
 function get_branch_key (branchname)
   return my_key_is_here
 end
 
 And I need to use -k my_key_is_here anyway. How should I use the 
 get_branch_key hook? I think I did something wrong somewhere...

That hook isn't used for netsync. It's used for commands that can take a
--branch argument.

Tim




___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] Using get_branch_key (so usher can start servers)?

2006-05-14 Thread Jeronimo Pellegrini
On Sun, May 14, 2006 at 01:49:43PM -0500, Timothy Brownawell wrote:
 On Sun, 2006-05-14 at 08:12 -0300, Jeronimo Pellegrini wrote:
  function get_branch_key (branchname)
return my_key_is_here
  end
  
  And I need to use -k my_key_is_here anyway. How should I use the 
  get_branch_key hook? I think I did something wrong somewhere...
 
 That hook isn't used for netsync. It's used for commands that can take a
 --branch argument.

And how can I tell usher what key monoone should use? I suppose I should have
only one key in ~/.monotone so I can use usher?

J.



___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] Using get_branch_key (so usher can start servers)?

2006-05-14 Thread Timothy Brownawell
On Sun, 2006-05-14 at 21:05 -0300, Jeronimo Pellegrini wrote:
 On Sun, May 14, 2006 at 01:49:43PM -0500, Timothy Brownawell wrote:
  On Sun, 2006-05-14 at 08:12 -0300, Jeronimo Pellegrini wrote:
   function get_branch_key (branchname)
 return my_key_is_here
   end
   
   And I need to use -k my_key_is_here anyway. How should I use the 
   get_branch_key hook? I think I did something wrong somewhere...
  
  That hook isn't used for netsync. It's used for commands that can take a
  --branch argument.
 
 And how can I tell usher what key monoone should use? I suppose I should have
 only one key in ~/.monotone so I can use usher?

Umm... pull the latest version and put
   monotone mtn -k my_key
in the config file? (The -a and -l options are also moved to the config
file now, as listenaddr and adminaddr.)

Tim




___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] Using get_branch_key (so usher can start servers)?

2006-05-14 Thread Jeronimo Pellegrini
On Sun, May 14, 2006 at 11:28:49PM -0300, Jeronimo Pellegrini wrote:
 On Sun, May 14, 2006 at 07:32:50PM -0500, Timothy Brownawell wrote:
  On Sun, 2006-05-14 at 21:05 -0300, Jeronimo Pellegrini wrote:
   And how can I tell usher what key monoone should use? I suppose I should 
   have
   only one key in ~/.monotone so I can use usher?
  
  Umm... pull the latest version and put
 monotone mtn -k my_key
  in the config file? (The -a and -l options are also moved to the config
  file now, as listenaddr and adminaddr.)
 
 Hey... It works! 8-)
 Thanks a lot!

However...

It seems that the first server in the file is matched, always.

With this:


userpass jp -
adminaddr 127.0.0.1:1
monotone mtn -k

server phd
host localhost
pattern   info.aleph0.phd.*
local -d /home/jeronimo/monotone/phd.db *

server main
host localhost
pattern info.aleph0.*
local -d /home/jeronimo/monotone/main.db *

server zat
host localhost
pattern zat.*
local -d /home/jeronimo/monotone/zat.db *
==

I tried to push a branch named zat.portuguese, and the server matched
was the first one (phd.db got a new branch, and phd.log had the usual
netsync messages).

I thought that usher would only match the last one (the only one that
matches!)

J.


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] Using get_branch_key (so usher can start servers)?

2006-05-14 Thread Timothy Brownawell
On Sun, 2006-05-14 at 23:37 -0300, Jeronimo Pellegrini wrote:
 On Sun, May 14, 2006 at 11:28:49PM -0300, Jeronimo Pellegrini wrote:
  On Sun, May 14, 2006 at 07:32:50PM -0500, Timothy Brownawell wrote:
   On Sun, 2006-05-14 at 21:05 -0300, Jeronimo Pellegrini wrote:
And how can I tell usher what key monoone should use? I suppose I 
should have
only one key in ~/.monotone so I can use usher?
   
   Umm... pull the latest version and put
  monotone mtn -k my_key
   in the config file? (The -a and -l options are also moved to the config
   file now, as listenaddr and adminaddr.)
  
  Hey... It works! 8-)
  Thanks a lot!
 
 However...
 
 It seems that the first server in the file is matched, always.
 
 With this:
 
 
 userpass jp -
 adminaddr 127.0.0.1:1
 monotone mtn -k
 
 server phd
 host localhost
 pattern   info.aleph0.phd.*
 local -d /home/jeronimo/monotone/phd.db *
 
 server main
 host localhost
 pattern info.aleph0.*
 local -d /home/jeronimo/monotone/main.db *
 
 server zat
 host localhost
 pattern zat.*
 local -d /home/jeronimo/monotone/zat.db *
 ==
 
 I tried to push a branch named zat.portuguese, and the server matched
 was the first one (phd.db got a new branch, and phd.log had the usual
 netsync messages).
 
 I thought that usher would only match the last one (the only one that
 matches!)

What was the command line for the client?

Tim




___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] Using get_branch_key (so usher can start servers)?

2006-05-14 Thread Timothy Brownawell
On Sun, 2006-05-14 at 22:03 -0500, Timothy Brownawell wrote:
 What was the command line for the client?

Or, um, the default host and include pattern (from ls vars), if those
weren't on the command line.

Tim




___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel