« Previous | Next »

Proof of Concept: FileTree and Fossil

28 Feb 2017

While putting up PasswordCrypt on Github, I was working with its local FileTree repository. I found the workflow cumbersome - committing in Pharo causes untracked files and so on as seen by Git, which had to be resolved by hand, followed by 'git commit' and 'git push'. I know that tools like GitFileTree and Iceberg are meant to smoothen the workflow. I also know that I don't know Git well at all.

OTOH, I use multiple computers - a main Linux/Windows workstation, a Mac, and a small laptop for tinkering on the go - and keeping all my mcz files in sync on these computers is getting to be a chore.

I am a fan of Fossil. In addition to being a DVCS a la Git, Fossil comes with a wiki, ticketing system, simple HTTP-based networking to sync repositories, and other good stuff.
This blog's content is managed using Fossil.

However, using Fossil in place of Git to manage FileTree repositories at the directories/files level still requires the 2-step workflow: commit in Pharo, fix up the changes with Fossil, commit in Fossil.

So I wrote a simple integration of FileTree with Fossil.

At the operating system command prompt, init a new Fossil project:

os% mkdir ~/repo
os% cd ~/repo
os% fossil init myproject.fossil
project-id: 3c05c3016eeabf8e87816ee218c6a86d3c87b950
server-id:  ff42bc86dba1a26b1d94b64685f7c09d02581617
admin-user: laptop-user (initial password is "1fe2ff")

Open the repository:

os% mkdir ~/myproject
os% cd ~/myproject
os% fossil open ~/repo/myproject.fossil

In a fresh Pharo 6 image - I used v60411 - install FossilFileTree:

Metacello new 
  baseline: 'FossilFileTree'; 
  repository: 'github://PierceNg/FossilFileTree'; 
  load.

Write code in Pharo. Open Monticello Browser. Add a "fossilfiletree" repository, using ~/myproject as the directory. Save to said repository from within Monticello Browser. Done.

To check what Fossil got, run 'fossil status' in ~/myproject. The last line 'comment: ...' contains the in-Pharo commit message.

And now I get to use Fossil to keep my FileTree repositories in sync among my computers.

Notes:

  • I basically copied GitFileTree's use of OSSubprocess to call the Fossil executable.
  • Tested on Linux with recent Pharo 6 only. I tried to install on a Pharo 5 image, but the installation hung somewhere.
  • The above is all this thing does. For all other Fossil-related operations - clone, sync/push/pull - use Fossil.
  • Not written any test.
Tags: DevOps