Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
353 views
in Technique[技术] by (71.8m points)

tfsbuild - Where is TFS 2010 Team Build Revision $(Rev:.r) Stored?

TFS 2010 exposes a "Build Number Format" property, which contains $(BuildNumberDefinitionName) and $(Rev:.r) variables (among other things). Two and a half parts to my question:

  1. What are all the available variables that can be used here?

  2. Where does the value for $(Rev:.r) come from (where is it stored)?

    a. Can it be reset or changed?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

http://www.richardmaxwell.name/blog/2011/5/5/force-tfs-build-revision-to-a-specifc-value.html

Anytime you change your Build Number in a TFS build, the revision resets to 1, which is what it should do, most of the time. But sometimes, you want to start at revision 100, maybe recreating a deleted build definition, or just wanting to maintain the old revision into a new branch. It took me a lucky accident to discover how this is possible. You must replace the dynamic revision with a hard coded one, build, and then change it back. Out of frustration I eventually tried this:

Build Number Format: 1.0.0.100

This gave me the build I wanted, and then changed it back to this:

Build Number Format: 1.0.0$(Rev:.r)

This picked up my last value, starting future build at 1.0.0.101, instead of incrementing the last version that it had used, 1.0.0.2. So I was able to skip builds 1 through 99 and start at revision 100 in my build number.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...