[darcs-users] Which commands can change output of darcs query contents for a particular hash?

Robin Green greenrd at greenrd.org
Mon Jul 6 03:33:13 UTC 2009

I have concerns about gitit, which is wiki software which can be
configured to use darcs as a backend, not caching pages correctly. I
guess this would be an issue for any darcs repository browser which
tried to do caching. The basic algorithm gitit uses for rendering pages
is this (ignoring a known race condition which is not relevant to my

0. If a specific revision was not requested, find the most recent hash
where the file in question was changed, by doing this:

darcs changes --xml-output --maxchanges=1 filename

and extracting the hash attribute from the output of that command.

1. Look up the filename and the hash in the cache (which is a
bounded-size, in-memory cache).

2. If a pre-rendered page was found in the cache, use that and we are

3. Get the requested revision of the page by running:

darcs query contents [possibly with an option to select a hash]

4. Parse and render the page, by applying various transformations

5. Store the rendered page in the cache

However, I know that darcs' patch theory allows patches to be
reordered. This could mean that the output of darcs query contents
"--match=hash foo" could vary over time - or have I misunderstood? Then,
if that's the case, which commands might potentially cause this output
to change? i.e. could a push into the repository cause this to happen?
Or would it require some other command, such as obliterate? (It's fairly
obvious to me that obliterate could cause this to happen, because you
could obliterate an earlier change to a different part of the same
file. Right?)

I want to make sure that, even if the actual repository history is
being "rewritten" due to patch reordering, the users can at least *see*
a representation of how the history *currently* looks, rather than
being stuck with some cached version of some revisions and some
up-to-date version of some other revisions, which could lead to
inconsistencies such as the same textual change appearing to happen


More information about the darcs-users mailing list