[darcs-users] fixing trac+darcs

K.S.Sreeram sreeram at tachyontech.net
Thu Jul 27 14:07:32 UTC 2006

Hi Everybody,

TracDarcs is very important for one my projects (http://cspace.in), but
this issue (http://progetti.arstecnica.it/trac+darcs/ticket/1) is a
major blocker. So i've decided to get my hands dirty and i've been
trying to grok the relevant code.

From my initial analysis so far, one critical problem lies in the way
tracdarcs converts darcs changesets into its internal Node & Changeset
structures. This is done in the 'changesets_from_darcschanges' function
in tracdarcs/changeset.py. The code fails to handle the case where a
directory gets renamed. Darcs represents this as a single 'move' patch
for the directory. Tracdarcs fails to apply the move operation to the
contents of the directory.

for example consider the following directory structure.

  - index.html
  - api.html
  - usage.html

Say, the 'docs' directory gets renamed to 'html'. In this case,
tracdarcs doesn't realize that 'docs/index.html' is also renamed to
'html/index.html'. So we end up with an error message like:
"No node found at 'docs/index.html'".

It should be rather easy to change this particular function to fix this
error, but i've only spent a few hours trying to understand the
internals of trac and darcs, and i'm not yet comfortable in changing the
code. So i thought i'll share my findings with others just to know if
i'm going in the right direction or not...

I have a few other questions ...

1) Changeset revision numbering
Trac requires a sequential revision number, but darcs doesn't have any
concept of a revision number. Tracdarcs handles this by assigning
revision numbers sequentially to the changesets listed by 'darcs changes
--reverse'. Is this a valid approach? Is it possible in darcs, for a
patch to get inserted in the middle of the existing changesets? Or is it
possible for the changesets to get reordered somehow?

2) Caching
What is the caching approach followed? I would prefer to cache the
entire revision metadata when run for the first time. On any subsequent
run, a check for newer changesets can be performed, and the revision
cache can be updated if any new changesets are found. Ofcourse, since
only the revision metadata is cached, we need to use darcs to fetch file
contents whenever needed. Is this the approach that is currently followed?

3) 'token replace' patches
Darcs has a special 'token replace' patch type. How do we handle this?
I'm currently planning to ignore this patch type since none of my
repositories have such patches! :)

4) 'merger' patches
'merger' patches are created by darcs during certain types of merges.
None of my repos seem to have this, and i've not gotten around to
creating test repos with such patches. I've not fully understood this
patch type, and if anybody has more insight on how these can be handled,
please let me know.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20060727/d1cd335f/attachment.pgp 

More information about the darcs-users mailing list