From: Pavel Sanda Date: Thu, 25 Jun 2009 22:24:52 +0000 (+0000) Subject: Add some doc about direct svn revision number usage. X-Git-Tag: 2.0.0~6209 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2ebd79adea6144445f5c717382ea651e5501cf3b;p=features.git Add some doc about direct svn revision number usage. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30256 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/doc/Extended.lyx b/lib/doc/Extended.lyx index 09f7d5e802..3cf9a5cb7a 100644 --- a/lib/doc/Extended.lyx +++ b/lib/doc/Extended.lyx @@ -18416,7 +18416,7 @@ svn:needs-lock file svn property \begin_inset Foot -status collapsed +status open \begin_layout Plain Layout http://svnbook.red-bean.com/en/1.2/svn.advanced.locking.html @@ -18558,6 +18558,116 @@ Unset: svn propdel svn:needs-lock "" \end_layout +\begin_layout Subsubsection +Revision Information in Documents +\end_layout + +\begin_layout Standard +Currently there is no way how to provide such kind of information directly + from LyX. + There are possibilities how to activate it with the help of svn features, + but each has its own drawbacks. +\end_layout + +\begin_layout Standard +One possibility is to use svn keywords +\begin_inset Foot +status collapsed + +\begin_layout Plain Layout +http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html +\end_layout + +\end_inset + +. + In short -- you set file keywords property (e.g. + +\family sans +svn propset svn:keywords 'Rev' file.lyx +\family default +) and then paste keyword ERT +\begin_inset Foot +status collapsed + +\begin_layout Plain Layout +This is an easy way how to ensure that LyX won't break the line in the middle + of keyword tag. +\end_layout + +\end_inset + + tag in your document (e.g. + +\begin_inset ERT +status open + +\begin_layout Plain Layout + +$Rev$ +\end_layout + +\end_inset + +). + This way svn client will automatically substitute revision number (e.g. + +\begin_inset ERT +status open + +\begin_layout Plain Layout + +$Rev: 59 $ +\end_layout + +\end_inset + +) after each update and commit. + There are more problems with this approach. + Firstly, the '$' character is used in TeX world for math equations, so + any occurence of math formula +\begin_inset Formula $Rev$ +\end_inset + + become +\begin_inset Formula $Rev:59$ +\end_inset + + in your LyX document. + Similarly for other keywords like Id, Date, Author, etc. + Secondly svn output is dependent on your locales, so its very easy that + svn would produce some problematic strings once Date is used. + Thirdly you get the whole 'Rev: 59' string in your document instead of + the plain number. + Until subversion implements user's custom keywords it will be hard to use + this approach reliably or let LyX to support it directly . +\end_layout + +\begin_layout Standard +The second possibility would be to write your own external-material template + which calls either +\begin_inset Flex CharStyle:Code +status collapsed + +\begin_layout Plain Layout +svnversion +\end_layout + +\end_inset + + utility or parses the output of +\begin_inset Flex CharStyle:Code +status collapsed + +\begin_layout Plain Layout +svn info file.lyx +\end_layout + +\end_inset + + command and returns the result back, when typeseting the document. +\end_layout + \begin_layout Subsection SVN and Windows Environment \end_layout