0

I want to keep my linux config in fossil scm system.

Here is what I did at initial stage.

$ cd /
$ fossil new b.fsl
$ fossil open b.fsl
$ fossil add etc/group
$ fossil add boot/grub/menu.lst
$ fossil ci -m 'init commit'

I want do do things like (operate like hg/git).

$ cd etc
$ fossil status group
$ fossil add motd

It will show error message:

fossil: current directory is not within an open checkout

So, my temp dirty solution is

$ cd /
$ fossil status etc/group
$ fossil add etc/motd
$ fossil add /etc/motd # this line will cause problem

For my git/hg experiences, it should work.

$ cd /
$ hg init
$ hg add etc/group boot/grub/menu.lst
$ hg ci -m 'init commit'
$ cd etc
$ hg status group  # it works
$ hg add motd # it works too
Daniel YC Lin
  • 15,050
  • 18
  • 63
  • 96

3 Answers3

2

Before the command

$ fossil new b.fsl

Type the command

$ cd etc

If you want the fossil repo stored in another folder, change the commands

$ fossil new b.fsl
$ fossil open b.fsl

to

$ fossil new path_to_repo/b.fsl
$ fossil open path_to_repo/b.fsl
ravenspoint
  • 19,093
  • 6
  • 57
  • 103
2

All mentioned commands "add" and "status" and all fossil commands related to the checkout must be executed when the current directory is set somewhere inside the directory tree of the checkout.

You can't specify the checkout directory yourself as a command line option.

It seems there is a bug (or intentionally introduced feature) in fossil that prevents it searching for the open checkout file (".fslchkout" or "FOSSIL") up to the root directory. That is why in this case you must be in the root directory when you execute commands on this checkout.

Of course all executions of fossil in this case must be with root privileges. Otherwise, even in the root directory you will get "not within checkout" error.

johnfound
  • 6,857
  • 4
  • 31
  • 60
  • I've specified add stat under opened directory. These command works fine under sub-directory but root. – Daniel YC Lin Feb 02 '13 at 02:10
  • Ah, I got it now. It seems it is a bug in fossil. It simply does not search properly for the file ".fslchkout" which indicates the open checkout, when this file is located in the root directory. – johnfound Feb 02 '13 at 06:14
0

This situation is covered in great detail in the User Guide, which I recommend wholeheartedly.

http://www.fossil-scm.org/schimpf-book/home

In particular, see version 2.0 of the fossilbook.pdf, in section 2, entitled "Single Users", the section starting with:

I have a directory called FOSSIL in which I keep all my repositories, Fossil doesn’t care but it helps me to keep them all in one place so I can back them up.

The first command there shows how to call relative directories:

$ fossil new ../FOSSIL/FossilBook.fossil
PatrickT
  • 10,037
  • 9
  • 76
  • 111