标签云

微信群

扫码加入我们

WeChat QR Code


Balloon If you are using TortoiseSVN, you can use the packaged SubWCRev program. It queries a working copy and tells you just the highest revision number. Admittedly, this seems to be a client-side approach to a server-side problem, but since it's a nice command line program, you should be able to capture its output for use fairly easily.

2019年01月23日18分37秒

If you're not using TortoiseSVN for SubWCRev like I said here, you can use svnversion which does the same thing.

2019年01月23日18分37秒

[stackoverflow.com/questions/29802/… [1]: stackoverflow.com/questions/29802/…

2019年01月23日18分37秒

If you're not using CruiseControl.Net then check out my answer (shameless plug!) - stackoverflow.com/questions/163/… ;o)

2019年01月23日18分37秒

link is broken saint_groceon

2019年01月23日18分37秒

You need to make sure that the Files are having the svn:keywords Attribute set as well, otherwise $Id$ etc. are not auto-replaced. See this page. (Scroll down to svn:keywords)

2019年01月23日18分37秒

I've just tried this by using $Rev$ and it works - to an extent. The problem is that it appears to only update the keyword when the file it appears in is changed. This means that if changes are made to the project which don't affect the file with the $Rev$ in it (in my case, my ASP.NET master page), the project will have a higher revision than gets displayed to the user. Does anybody have any thoughts on this? Is there a way to get SVN to always update the keywords in the file?

1970年01月01日00分03秒

Won't this just insert the revision number of the last change to that particular file? I tried setting up a two-file repository and changed one, and tried both export and checkout, and the other file stayed at 1 in both cases.

2019年01月23日18分37秒

You're right, you need to use a different mechanism.

2019年01月23日18分37秒

lassevk is correct, this only changes when the file itself changes.

2019年01月23日18分37秒

Sounds great, Link broken though!

2019年01月23日18分37秒

Fixed! thanks for letting me know :o)

2019年01月23日18分37秒

This was a great solution for us to automate displaying a versioning based on our SVN revisions. One advantage is that it doesn't require a call to your SVN server.

2019年01月23日18分37秒

link is broken, or site is down

2019年01月23日18分37秒

Thanks cacho, fixed - it was a server fault [sic] ;o)

2019年01月23日18分37秒