[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Re: Re: TortoiseSVN missing support of Revision update on Commit

From: Ryan Hathaway <rghathaway_at_starkcountyohio.gov>
Date: Wed, 25 Mar 2015 11:14:26 -0400

This works, and I use it in some projects.

You should make careful note, that it is the FILE revision of EACH file that is substituted in, and NOT the GLOBAL REVISION/current HEAD revision. This means that if file a.txt has keyword expansion turned on for $Revision$, and was last commited to SVN in Revision 4, it will substitute a 4 into the $Revision$ keyword area in a.txt until a.txt is changed by some other commit, even though the global revision of the repo goes up with every commit and your file still exists in higher-numbered revisions, the revision of your file remains 4.

This means if you include the value in some header in many files, you will likely have different revisions inserted into those different files, unless they were all committed in a single svn transaction.

I turn on keyword expansion for .cs files, and paste this common svn keyword expansion header at the top of every .cs file in some of my C# development projects:

/* $URL: https://redacted.servername:8443/redacted.path/redacted.filename.cs $
 * $Id: redacted.filename 28 2014-07-25 15:32:49Z redacted.username$
 * $Rev: 28 $
 * $Date: 2014-07-25 11:32:49 -0400 (Fri, 25 Jul 2014) $
 * $Author: redacted.username $
 */

Thank you,

-Ryan

Ryan Hathaway

Programmer Analyst

Office of Alan Harold, Auditor
Stark County Ohio
110 Central Plaza S
Canton, OH 44702

330-451-1414

***Please note: My email address has changed to rghathaway_at_starkcountyohio.gov ***

>>> Ben Fritz <fritzophrenic_at_gmail.com> 03/25/15 9:59 AM >>>

On Wed, Mar 25, 2015 at 4:21 AM, Milan Tortoise <milan.vukoslavcevic_at_gmail.com> wrote:
>
> - You wrote:
> >> You must make sure that you *only* enable keyword substitution for your
> source files.
>
> I am working in big project I would not like to experiment a lot but
> to find clear example how it works, otherwise I have even bigger
> problem. If there is no examples I believe that TortoiseSVN does not
> support it (no one realy tested it).

It works just fine, I use it on a few files where I distribute them
internally without version control, and want to know what version
someone has if they find problems. YOU are probably better off capturing
the overall revision or tag of the working copy you test from rather
than embedding it in every file, but here is how to get it working
(details at
http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.keywords.html):

1. Set the svn:keywords property, on the files you want to embed the
   revision number in (and ONLY on those files), to include the value
   "Revision". TortoiseSVN even gives you a nice checkbox dialog for
   standard properties like this. If you want to get really crazy you
   can even specify your own properties in the "advanced" editor; see
   the custom keywords section in
   http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.keywords.html.
   I don't usually like to get really crazy.
2. In the files where you want to embed the revision number, insert text
   "$Revision$" in a comment somewhere, then save and commit.
3. SVN now automatically substitutes this special text to include the
   revision number on every commit, update, or export.

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3108355

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2015-03-25 16:16:12 CET

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.