Search code examples
fossil

How to remove a repository in Fossil?


Yepp, I'm quite new to Fossil…

During my experiments I've faced a problem: fossil all info command lists all and every repos ever touched here including those removed/deleted/dropped/erased/got-rid-of quite obviously failing like that

************* /home/jno/src/dropped-repo.fossil *****************************************
SQLITE_CANTOPEN: cannot open file at line 36667 of [0c55d17973]
SQLITE_CANTOPEN: os_unix.c:36667: (21) open(/home/jno/src/dropped-repo.fossil) - 
fossil: [/home/jno/src/dropped-repo.fossil]: unable to open database file

Yes, the --dontstop flag makes the life a bit easier, but does not fix the things.

So, the question is: how to properly remove a repository?

The only way I found so far is:

  • fossil close it
  • remove the repo file itself
  • run sqlite3 ~/.fossil and delete from global_config where name='…' on all mentions of that repo.

This looks ugly.

I see a new/init command to create a repo, but I see no way to remove it.

PS. The recipie from Fossil: "not a valid repository" - deleted repository (just rm ~/.fossil) looks an overkill.


Solution

  • For the fossil all command to ignore a certain (past or present) repository, you should use fossil all ignore.

    In short:

    • fossil close closes a working directory (by deleting the .fslckout file)
    • rm /home/jno/src/dropped-repo.fossil actually deletes the repository (only do this if you really want to throw away the entire repository, including all versions)
    • fossil all ignore /home/jno/src/dropped-repo.fossil removes the repository from the list of repositories that's used by the fossil all command.