get svn version

Discussion in 'Java' started by Alessandro Rossi, Jun 6, 2005.

  1. Hi,
    Does anybody can help me in this problem?
    I have a java project under subversion (I access it from eclipse by
    subclipse). I would like that every time I commit some changes (and so
    the version number increase) a properties file should be modified with
    the actual version number.

    Is it possible?
    Thank you
    Alessandro Rossi
     
    Alessandro Rossi, Jun 6, 2005
    #1
    1. Advertising

  2. Alessandro Rossi wrote:
    > Hi,
    > Does anybody can help me in this problem?
    > I have a java project under subversion (I access it from eclipse by
    > subclipse). I would like that every time I commit some changes (and so
    > the version number increase) a properties file should be modified with
    > the actual version number.


    In your build system, e.g. in "make", during build time (not earlier),
    embed the output of svnversion into a String of a dynamically created
    small class source code - probably only holding the string as a public
    final static member. Do not place this generated file under version control.


    /Thomas

    --
    The comp.lang.java.gui FAQ:
    ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
     
    Thomas Weidenfeller, Jun 6, 2005
    #2
    1. Advertising

  3. Alessandro Rossi schrieb:

    > Does anybody can help me in this problem?
    > I have a java project under subversion (I access it from eclipse by
    > subclipse). I would like that every time I commit some changes (and so
    > the version number increase) a properties file should be modified with
    > the actual version number.


    You are looking for subversion properties:
    http://svnbook.red-bean.com/en/1.0/ch07s02.html

    Jan
     
    Jan Peter Stotz, Jun 6, 2005
    #3
  4. I'm sorry, but I am a newbie...:)
    I don't know if I'm missing but I've found that exist the availability
    to execute scripts in certain events, like post-commit.tmpl. Here there
    are 2 parameters: The repository path and the actual version number.
    That's ok for me, but I haven't understand which language I have to use
    in these files (python or whatever...)

    Thank you
    Alessandro Rossi
     
    Alessandro Rossi, Jun 6, 2005
    #4
  5. I'm sorry...I'm a newbie...
    I found that exists post-commit.tmpl where it can be execute
    "operations" after that commit has been executed.
    I tried to modify this file, following the instructions, so I renamed
    in post-commit.exe, but I don't know how to add the code I need to
    write in a properties file the actual version number.

    Thank you
    Alessandro Rossi
     
    Alessandro Rossi, Jun 6, 2005
    #5
  6. Alessandro Rossi

    bugbear Guest

    Thomas Weidenfeller wrote:
    > Alessandro Rossi wrote:
    >
    >> Hi,
    >> Does anybody can help me in this problem?
    >> I have a java project under subversion (I access it from eclipse by
    >> subclipse). I would like that every time I commit some changes (and so
    >> the version number increase) a properties file should be modified with
    >> the actual version number.

    >
    >
    > In your build system, e.g. in "make", during build time (not earlier),
    > embed the output of svnversion into a String of a dynamically created
    > small class source code - probably only holding the string as a public
    > final static member. Do not place this generated file under version
    > control.


    Heh. In general, *never* place generated files under
    version control.

    BugBear (generalising)
     
    bugbear, Jun 6, 2005
    #6
  7. Hi, I tried this way:
    I created a post-commit.bat where I wrote:
    C:\java\jdk1.5.0\bin\java it.mypackage.PostCommitSVN %1 %2

    If I execute this .bat file from a command windows this works properly,
    but if I commit changes from the working copy to the svn repository,
    this do nothing...
    But I noticed that, if I rename post-commit.bat to post-commit.exe,
    when I commit changes, it gives me an error that the post-commit is not
    a valid executable file, so, I think, the file is well recognized...but
    with .bat extension doesn't happen nothing...

    Who can help me?
    thank you
    Alessandro Rossi
     
    Alessandro Rossi, Jun 6, 2005
    #7
  8. Hi,
    I have now the following problem:
    When a user commit some changes to a repository, after the commit I
    execute the post-commit.exe and i see that the second parameter
    (repository) is the repository path (c:\svn\repository), but, how can I
    know from which branch the version has been increased? e.g. how can I
    know if the actual version (version 51) has been created by changes of
    branch 1.1 or branch 1.5?

    thank you
    Alessandro Rossi
     
    Alessandro Rossi, Jun 7, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. V Green
    Replies:
    0
    Views:
    902
    V Green
    Feb 5, 2008
  2. PA Bear [MS MVP]
    Replies:
    0
    Views:
    1,017
    PA Bear [MS MVP]
    Feb 5, 2008
  3. MowGreen [MVP]
    Replies:
    5
    Views:
    2,060
    PA Bear [MS MVP]
    Feb 9, 2008
  4. Andrea Crotti

    getting svn tag in version

    Andrea Crotti, Nov 25, 2011, in forum: Python
    Replies:
    1
    Views:
    157
    Irmen de Jong
    Nov 25, 2011
  5. Aung Thet Naing

    Python version and svn

    Aung Thet Naing, Dec 13, 2012, in forum: Python
    Replies:
    2
    Views:
    137
    Ned Deily
    Dec 13, 2012
Loading...

Share This Page