On Fri, Nov 7, 2008 at 1:15 PM, Rich Hickey <[EMAIL PROTECTED]> wrote: > > > > On Nov 7, 1:02 pm, "Graham Fawcett" <[EMAIL PROTECTED]> wrote: >> On Fri, Nov 7, 2008 at 11:46 AM, vdm <[EMAIL PROTECTED]> wrote: >> >> > Is there a way to make Clojure print the svn revision it was compiled >> > from? A standard or idiomatic way to do this (print clojure--svn-rev) >> > would help when trying to isolate whether observed behaviour is >> > happening on old or current code. >> >> Hi, as far as I know, no. But I agree it would be great to have, and >> is certainly possible to do. >> >> If Rich would be willing to add this to boot.clj, >> >> (defn clojure-svn-revision [] >> (if-let rev (re-find #"Rev: (\d+) \$" "$Rev$") >> (second rev) >> "unknown")) >> >> and then do this, >> >> svn propset svn:keywords "Revision" boot.clj >> svn commit boot.clj >> >> ...then (clojure-svn-revision) ought to return the revision number as >> a string. >> > > This works by making $Rev$ magic in some way?
Yes, exactly. See http://svnbook.red-bean.com/en/1.1/ch07s02.html in the "keywords" section. Best, Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---