1

I'm using FossilSCM as my only solution for control version and tickets. So far, so good. Its self contained and minimalist approach suit my needs. But I would like to start to make some analysis on the projects history and development and a good soruce for that are the projects timelines. I could go with some html parsing trying to convert the Fossil timeline output to something else, but I would like if there is any option to export that info in other structured format (e.g JSON or similar). Web search has not produce any useful finding on that issue. Any pointers to a solution?

Thanks,

Offray

Offray
  • 505
  • 1
  • 4
  • 15

2 Answers2

1

Have you tried fossil json timeline branch trunk?

fossil help json
Usage: fossil json SUBCOMMAND ?OPTIONS?

In CLI mode, the -R REPO common option is supported. Due to limitations
in the argument dispatching code, any -FLAGS must come after the final
sub- (or subsub-) command.

The commands include:

  anonymousPassword
  artifact
  branch
  cap
  config
  diff
  dir
  g
  login
  logout
  query
  rebuild
  report
  resultCodes
  stat
  tag
  timeline
  user
  version (alias: HAI)
  whoami
  wiki

Run 'fossil json' without any subcommand to see the full list (but be
aware that some listed might not yet be fully implemented).

Compile json when you build from source: ./configure --json

Registered User
  • 255
  • 4
  • 12
  • Thanks for pointing me in the right direction. The problem was that the current version of fossil comes without json support enabled. Soon I will post a response about what I did following your advice. – Offray Jun 01 '15 at 22:57
0

The key for having this working is to enable json support in fossil by compiling it from sources. Current version have it disabled, so looking for any clue on it in command line help got me nothing originally. Thanks to user 2612611 for the initial clue about it. Here is the procedure I followed:

  1. Go to https://www.fossil-scm.org/download.html and download the source tarball package.
  2. Uncompress the previous package.
  3. Go to the folder where you uncompressed the package (lets call it /uncompress-folder
  4. Run ./configure --json
  5. Run make.
  6. Optional: Put your newly created fossil binary in your path or where the last one was installed (something like sudo mv /uncompress-folder/fossil /usr/bin/fossil.
  7. Open the fossil repository that you want to export its history and launch the fossil web interface (fossil ui).
  8. Go to http://localhost:8080/json/timeline/checkin?limit=0 ,where http://localhost:8080 is your local machine interface for fossil ui, and json/timeline/checkin?limit=0 is the json API call saying: json export of timeline (/json/timeline) chekins (/checkin) for all history (?limit=0). If instead of the 0 at the end of the url you put another integer you will have the last n checkins.

    From command prompt you should be able to get the same result by running fossil json timeline checkin --limit=0 > timeline.json stored on the file timeline.json, instead of the web browser but in local test it didn't work.

API is still a moving target, but you can find documentation on this excellent project at [1] and a demo interface to test the parameters at [2]

[1] https://docs.google.com/document/d/1fXViveNhDbiXgCuE7QDXQOKeFzf2qNUkBEgiUvoqFN4/view?pli=1#

[2] http://fossil.wanderinghorse.net/repos/fossil-sgb/json/

Community
  • 1
  • 1
Offray
  • 505
  • 1
  • 4
  • 15