Jump to content

moving from svn to plasticSCM


jonasjnz

Recommended Posts

Hi,

we are considering changing our source control from SVN to plasticSCM, so far everything looks like will be ok, but there is 1 question to which i can't find answer anywhere:

On svn before building the project we embed current revision number into VersionInfo.cs of our project and then build the project, this way we know for sure which version/revision the file is. We archieve this with TortoiseSVN tool called "SubWCRev.exe", this is done automatically in visual studio pre-compile step, so this is fully automated.

How this can be done under plasticSCM?

Can we embed somehow changeset number?

Or what other alternatives are available?

Maybe someone can share how they are handling these scenarios? :)

Link to comment
Share on other sites

Hi!

we are considering changing our source control from SVN to plasticSCM' date=' so far everything looks like will be ok,[/quote']

Cool! I'm very happy to hear this.

but there is 1 question to which i can't find answer anywhere:

On svn before building the project we embed current revision number into VersionInfo.cs of our project and then build the project' date=' this way we know for sure which version/revision the file is. We archieve this with TortoiseSVN tool called "SubWCRev.exe", this is done automatically in visual studio pre-compile step, so this is fully automated.

How this can be done under plasticSCM?

Can we embed somehow changeset number?

Or what other alternatives are available?

Maybe someone can share how they are handling these scenarios? :)

[/quote']

Ok, I guess you need the changeset number to be inserted on your file. You can create a small script for this.

You can use the command cm status and extract the output. Is that ok?

Link to comment
Share on other sites

  • 2 months later...

I've just written a small cmdline tool PlasticWCRev which works identical

PlasticWCRev workspacePath srcFile destFile

Currently it only replaces the info we need but it can easily be extended.

$WCREV$

$WCNOW=%Y$

$WCNOW=%m$

$WCNOW=%d$

WCREV is obtained by running cm status workspacePath and by (dirty) getting cs:###@

We're using it as a pre-build event for our framework using the following build event

PlasticWCRRev "$(ProjectDir)." "$(ProjectDir)My Project\AssemblyInfo.vb.template" "$(ProjectDir)My Project\AssemblyInfo.vb"

Our AssemblyInfo.vb.template is a copy of the original with

<Assembly: AssemblyVersion("$WCNOW=%Y$.$WCNOW=%m$.$WCNOW=%d$.$WCREV$")>

<Assembly: AssemblyFileVersion("$WCNOW=%Y$.$WCNOW=%m$.$WCNOW=%d$.$WCREV$")>

So our framework gets a version of 2011.2.18.706 at the moment

Only problem with our approach (as with svn) is that assemblyinfo.vb is changed after checkin, so we set this file to be ignored.

Link to comment
Share on other sites

  • 4 years later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...