Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 231 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting SVN repository rev number

#1
Is there some `svn` or `svnadmin` command that will display the revision of a local repo? I'd like to be able to have a Windows batch or PowerShell script that would let me zip up the repo and name it with the rev to email.

The best I can figure out is just to find the highest file in `[reporoot]\db\revs\0`, but it seems kind of clunky and I don't know if it is reliable.
Reply

#2
svnversion is the command you want. Run <code>svnversion --help</code> for an explanation of the output.
Reply

#3
You can also use `svn info` which has the advantage that you don't need to run it somewhere inside the working copy (or provide a path to a working copy) -- you can pass it a URL to the repo and it displays various information about the repository including the latest revision number. `svnversion` in contrast would show the last revision number of the working copy, but this doesn't need to be identical to the revision of the repository.

Furthermore, `svn info` shows more details about the repository than `svnversion`. This might be a pro or a con, depending on your use.
Reply

#4
(Edit) `svnversion` is not so good because it relates to the working copy, not to the repository.

`svn info` also relates to the working copy.

=> `svnlook youngest REPOS_PATH` should do it. See also [svn redbook.][1]


[1]:

[To see links please register here]

Reply

#5
Try the VisualSVN Powershell Commands:

Get-Command -Module VisualSVN

Get-SvnRepository will give you a list of repositories and the Revision numbers. The reference is at

[To see links please register here]

Reply

#6
The previous responses might not work with all versions of subversion, not sure if the older versions of subversion support xml parsed output. Can substitute "Revision" for another info property.

#this do an info split by new line split by : then get the second parameter where first parameter is equal to Revision
$svnRevision = (svn info "somedirectoryorurl" ) | %{$_ -split '#'} | Where-Object {($_ -split ":")[0] -eq "Revision"} | %{($_ -split ":")[1].Trim()}

Reply

#7
function Get-SvnRevision($dir)
{
([xml](svn info $dir --xml)).info.entry.revision
}

[PowerShell, Subversion One Liner][1]


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through