Current Subversion revision command

后端 未结 10 2144
日久生厌
日久生厌 2021-01-31 13:05

Is there a Subversion command to show the current revision number?

After svn checkout I want to start a script and need the revision number in a variable.

10条回答
  •  猫巷女王i
    2021-01-31 13:53

    Just used @badcat's answer in a modified version, using subprocess.check_output():

    import subprocess
    revision = subprocess.check_output("svn info | awk '/^Revision:/ {print $2}'", shell=True).strip()
    

    I believe you can also, install and use pysvn if you want to use python to interface with svn.

提交回复
热议问题