Platforms: Django
The Darcsforge Patch Tracker serves as the cornerstone of Darcs integration. It provides a data model for storing useful information about a patch and simple templates for show basic chronological listings of Darcs patches. For simple projects the Patch Tracker alone may feel sufficient in showing the progress of the project.
The Darcsforge Patch Tracker stores its data in a relational database. Patches added to the Patch Tracker are assumed to be unchanging and idempotent (ie, no amend-records) and so can be useful pieces of data to relate other Darcsforge entities to in the database and can serve as more easily scale-able caches of patch data, as relational database clustering is a more commonly optimized problem than darcs optimization.
The process of taking patch information and either correlating with an existing database Patch or creating a new Patch in the database to represent it is referred to as patch marshalling and is handled by a simple convenience function on Patch’s default manager:
from darcsforge.patches.models import Patch
patch = Patch.objects.marshal(patch_info)
The patch_info should in most circumstances be a dictionary output from a darcsforge.darcs.DarcsRepository parser.
Note
The marshaller requires full summary data in the case that an existing Patch cannot be found in the database. In the worst case marshalling partial Patch information can leave Patches in the database that need to be deleted and re-marshalled to gain the full data, which may cause other data integrity issues in the process.
The suggested route to taking care of this is to set up a pull/apply posthook as the first marshaller a Patch should ever encounter.