[CMake] Version embedding - how to cause a command when make is run?

David Cole david.cole at kitware.com
Fri Oct 5 13:47:25 EDT 2007


Looks to me like the output of "svn status -u" will give you something like...
Status against revision:   1234
... when everything is up to date with respect to "svn info".

And it will give something like...
     *    1001   FileAtPrevRevision.cxx
Status against revision:   1234
... when there is a file stuck at a previous revision.

So... revising my original statement slightly:
If the output of "svn status -u" is a single line matching "^Status
against revision:" then you can trust the output of svn info as
meaning : this is a build against this revision without any known
deviations from the revision.

Svn list : correct me if I'm wrong. :-)


HTH,
David


On 10/5/07, David Cole <david.cole at kitware.com> wrote:
> How about "svn status -u" or a filtered version of "svn status -v" ....?
>
> On 10/5/07, Atwood, Robert C <r.atwood at imperial.ac.uk> wrote:
> > I hope its okay to copy this to Subversion list, as it has veered away
> > from cmake  ...
> >
> > Alan said (on Cmake list):
> >
> > > take a concrete but simple example, suppose you have five
> > > files which all
> > > have 3 possibilities (1,2,3) for the revision number. IOW,
> > > each file changed
> > > for each revision. Then using svn update --revision you can
> > > create 3^5 = 243
> > > different combinations of revision numbers for the various
> > > source files in
> > > your source tree, and svnversion will identify all such
> > > different source
> > > trees identically.
> >
> > I expected that sort of thing with CVS, I thought it worked differently
> > in SVN where the number is more related to the whole project than the
> > individual file. But I stand corrected.
> >
> > An actual test demonstrates that you are correct, svnversion 0:6 is
> > displayed if one of the files is back-updated to 4, and no special flag
> > is specified in svnversion output. See console log below.
> >
> >
> > David said (on Cmake list):
> >
> > >also verify that "svn status" gives you *empty*
> > >output.
> >
> > Actually ,   'svn status' also produces empty output in this case (where
> > a file has been back-updated)  So it is not obvious that there's any
> > difference, as Alan suggested orignally.
> >
> > Thanks for the headsup!
> > Robert
> >
> >
> > [rcatwood testproj]$ svnversion
> > 0:6
> > [rcatwood testproj]$ cat *
> > $Id: FileA.txt 6 2007-10-05 15:50:26Z rcatwood $
> > This is file A. Third (after propset) revision.
> > $Id: FileB.txt 6 2007-10-05 15:50:26Z rcatwood $
> > This is file B. Third (after propset) revision.
> > $Id: FileC.txt 6 2007-10-05 15:50:26Z rcatwood $
> > This is file C. Third (after propset) revision.
> > $Id: FileD.txt 6 2007-10-05 15:50:26Z rcatwood $
> > This is file D. Third (after propset) revision.
> > $Id: FileE.txt 6 2007-10-05 15:50:26Z rcatwood $
> > This is file E. Third (after propset) revision.
> > [rcatwood testproj]$
> > [rcatwood testproj]$ svn up -r 4 FileC.txt
> > U    FileC.txt
> > Updated to revision 4.
> > [rcatwood testproj]$ svnversion
> > 0:6
> > [rcatwood testproj]$ cat *
> > $Id: FileA.txt 6 2007-10-05 15:50:26Z rcatwood $
> > This is file A. Third (after propset) revision.
> > $Id: FileB.txt 6 2007-10-05 15:50:26Z rcatwood $
> > This is file B. Third (after propset) revision.
> > $Id: FileC.txt 4 2007-10-05 15:49:14Z rcatwood $
> > This is file C. First (after propset) revision.
> > $Id: FileD.txt 6 2007-10-05 15:50:26Z rcatwood $
> > This is file D. Third (after propset) revision.
> > $Id: FileE.txt 6 2007-10-05 15:50:26Z rcatwood $
> > This is file E. Third (after propset) revision.
> > [rcatwood testproj]$
> > [rcatwood testproj]$ svn status
> > [rcatwood testproj]$
> > _______________________________________________
> > CMake mailing list
> > CMake at cmake.org
> > http://www.cmake.org/mailman/listinfo/cmake
> >
>


More information about the CMake mailing list