On 21 Nov 2011, at 01:13, Richard Hipp wrote:

> 
> On Sun, Nov 20, 2011 at 7:56 PM, Chris Peachment <ch...@ononbb.com> wrote:
>> I'm using fossil version 1.20 on Linux for both server and client
>> computers.
>> 
>> I want to use fossil command line instructions to initialise an
>> empty repository. I use:
>> 
>> fossil new test.fossil
>> 
>> but I can not find a command to provide the project-name value to
>> be stored in the config table.
>> 
> There isn't one - or at least not a simple one.  I always configure using the 
> web interface:  just run "fossil ui test.fossil" and manually configure it 
> that way.
> 
> If you definitely, positively must do your configuration from the command 
> line, it can be done using raw SQL.  Probably just a single INSERT statement. 
>  But I'd have to go look up exactly what that INSERT statement would be.  May 
> I suggest:  Configure a dummy repository using "fossil ui" and then look in 
> the CONFIG table of the repository database to see where the project name got 
> inserted.  It should be obvious from there what you need to do to insert that 
> name yourself.


While it seems a bit odd to be contradicting Richard about his own software, 
I've written a simple script to create blank repositories for our clients which 
sets the project name using the "fossil configuration import" command. When 
you're creating lots of repositories, it's very boring and error-prone if you 
don't script everything.

You have to write a configuration file before using the import command, and 
although you're unlikely to want to write it by hand, the format is quite 
simple. There's a snippet of Ruby code below which I think should get you 
started (tip: examine the output of "fossil configuration export" first), email 
me off list if anyone wants the entire repo generating script.

Ben


----------------------------------------------------------------

def config_entry(name, value)
  l = %Q!#{Time.now.to_i} '#{name}' value '#{value}'!
  "config /config #{l.length}\n#{l}\n"
end
File.open("mcr.config.tmp", "w") do |f|
  f.write config_entry('project-name', "#{CLIENT_FULLNAME}")
  f.write config_entry('project-description', "#{CLIENT_FULLNAME} ONEIS 
Plugins")
  f.write config_entry('index-page', "/wiki?name=home")
end
system "fossil configuration -R #{REPO_FILENAME} import mcr.config.tmp"
File.unlink("mcr.config.tmp")


--
http://bens.me.uk/



_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to