Lele Gaifax wrote:
Max Battcher ha scritto:
Any good suggestions, then, on how to approach handling the ordering of patches without calling darcs every time?

This is something I spent quite a few time thinking of, for trac+darcs, and the only reasonable thing to do was assuming the underlaying repo won't be subject neither to "unpull" nor "optimize --reorder".


I may take a look at your code to see if it gives me any ideas.

/patch/2006/Feb/17/member-system-upgrade-issue-30/, for the patch with name "Member System Upgrade (Issue 30)")

Uhm, how do you map that URL to a patch?

That last bit ("member-system-upgrade-issue-30"), referred to as the slug (a standard name within the platform I'm using (django), by way of the news industry), is stored in a field on the model class. The marshaller will auto-generate it by a simple URLify function from the name. It does not do any sort of ambiguity checks.

> What if there are two distinct
patches on the same day with the same name?

You'll see the ambiguous patches in the patch log just fine. If you try to browse to the ambiguous address (ie, by clicking the patch name in the log), you will get a simple 404 error with a message to the effect of "Expected 1 object, got 2."

You can disambiguate the patch slugs manually (which, I believe is necessary to build nice, meaningful URLs) from the easy to use Admin site, or even from a Python shell if you desire. You could even build a Python script to do automatic disambiguation, if for instance you have some automated tool that creates lots of ambiguous patches. Or you could leave the ambiguity if you don't mind people seeing that 404 and it isn't really that necessary/useful to see those patch summaries.

--
--Max Battcher--
http://www.worldmaker.net/

_______________________________________________
darcs-users mailing list
[email protected]
http://www.abridgegame.org/mailman/listinfo/darcs-users

Reply via email to