monotone-devel
[Top][All Lists]
Advanced

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

[Monotone-devel] auto-before and auto-after commands?


From: graydon hoare
Subject: [Monotone-devel] auto-before and auto-after commands?
Date: 04 Oct 2003 12:23:38 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

hi,

I've been writing up a little CVS -> monotone phrasebook recently, and
have noticed that several CVS commands do 2-3 monotone commands.

   cvs co ..               monotone fetch ..
                           monotone co ..

   cvs update              monotone fetch
                           monotone merge
                           monotone update

   cvs commit              monotone commit
                           monotone post


now, I like that these commands are separate, because imho they do
importantly different things, which I often want to do at different
*times*. on the other hand, it might confuse or annoy users that they
have to type 3 commands in order to do an update, and it might
actually bite someone that they failed to post after committing. so I
was thinking -- especially for these two important commands 'update'
and 'commit' -- perhaps of adding a lua hook to control whether
monotone automatically runs the 'associated' commands:

function fetch_before_update(branchname)
  return (execute("/sbin/ifconfig | grep eth0") == 0)
end

function merge_before_update(branchname)
  return true
end

function post_after_commit(branchname)
  return (execute("/sbin/ifconfig | grep eth0") == 0)
end

unfortunately, I'm not sure where this ends. for example, I commonly
like to post the results of a merge immediately after I've done it,
even if I'm about to use it in an update. I also tend to like to
post before fetching, to make sure I'm not accumulating stuff. should
these get hooks too?

function post_after_merge(branchname)
  return true
end

function post_before_fetch(branchname)
  return true
end

what do you think?

-graydon





reply via email to

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