monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Keyword substitution?


From: Brian Campbell
Subject: Re: [Monotone-devel] Keyword substitution?
Date: Wed, 27 Jul 2005 15:20:21 -0400

How can you insert revision IDs into a file when the revision ID is based on the SHA-1 hash of the file? Inserting the revision ID into the file will change the contents of that file, which changes its SHA-1 hash, which gives it a new revision.

I suppose, if you really felt that keyword substitution was a good idea (I don't), you could always store a canonical form of each keyword (for instance $Rev$), and have it substituted on checkout, and canonicalized on commits, like we do if you turn on line ending conversion. That seems a little odd, though, and I'm just not convinced that keywords are a good idea.

For the case that was brought up earlier to support keywords, that of distributing files outside of monotone and being able to refer to what revision of the files you're using, there are several solutions. The main one would be to track version numbers in a traditional way, assigning a version number to various releases of your software and adding a tag in monotone so you can find the revision that corresponds to that particular version. If you need a finer granularity than that, you can always just get the SHA-1 hash of the file, and use "monotone cat file <id>" to get that version of the file out of monotone. Maybe we should have a command to find out what revisions a particular file ID appears in.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]