2

SVN working copy has mixed revisions in the general case. Is there a way to list all its revision numbers?

For example, for the following working copy:

file01   (revision 1)
file02   (revision 2)
file02.2 (revision 2)
file03   (revision 3)

The list of the revisions would be 1, 2, 3.

svnversion comes close, but not close enough:

$ svnversion
1:3
bahrep
  • 29,961
  • 12
  • 103
  • 150
Ilya Kurnosov
  • 3,180
  • 3
  • 23
  • 37
  • Related: http://stackoverflow.com/questions/3443647/how-can-i-see-the-revision-number-of-each-file-in-a-svn-working-copy. – Ilya Kurnosov Sep 29 '15 at 21:58
  • I don't get why `svn status` or `svn status -v` does not work for you. Or does it? – bahrep Sep 29 '15 at 22:35
  • @bahrep `svn status` simply gives empty output, no revision numbers at all. `svn status -v` is way too... verbose. I don't see any additional flags to make it output just a list of unique revision numbers. – Ilya Kurnosov Sep 30 '15 at 06:59

1 Answers1

0

Using svn info, awk and sed, this

svn info -R | awk '/Revision/ {print $2;}' | sort -u

produces the following if invoked in the working directory root:

1
2
3

Such multi-line output can further be transformed into single-line form using techniques from Bash turning multi-line string into single comma-separated question. E.g.

svn info -R | awk '/Revision/ {print $2;}' | sort -u | paste -s -d,

produces 1,2,3.

Community
  • 1
  • 1
Ilya Kurnosov
  • 3,180
  • 3
  • 23
  • 37