what is the command to see the revision of individual files under a folder in svn?

StackOverflow https://stackoverflow.com/questions/17473325

  •  02-06-2022
  •  | 
  •  

سؤال

I happen to have different revision of files (svn) under a folder. Is there any command to show what is the revision of each of the files I have? I know I can do a svn st -uq but that only shows the files that are different from the server, and I would like to know the revisions independent if there is a newer version or not.

هل كانت مفيدة؟

المحلول 2

svn ls -v URL|PATH

>svn ls -v http://mayorat.ursinecorner.ru:8088/svn/Hello/trunk/
     36 lazybadg              янв 09 11:45 ./
     34 lazybadg           42 мар 24  2012 Dr?p?r.ma?ar.sv?nskan.man.eller.smalensk?n.txt
     32 lazybadg           88 дек 27  2011 Hello.de.txt
     33 lazybadg           82 фев 28  2012 Hello.en.txt
     36 lazybadg           88 янв 09 11:45 Hello.eo.txt
     35 lazybadg           90 янв 09 11:35 Hello.fr.txt

First column in output is file-revision

نصائح أخرى

You can use svn info for this purpose. The following command prints information for each file in the current directory - including the revision your are looking for:

svn info --depth files | grep '^Path: \|^Revision: '

If you want to format the output, I recommend using the option --xml and piping the output to script that parses the XML and prints the fields in a readable manner. The following listing contains a simple example how that can be done in Python:

#! /usr/bin/env python3
import sys, lxml.etree
document = lxml.etree.parse(sys.stdin.buffer)
for entry in document.xpath('//entry[@kind="file"]'):
    print(entry.xpath('string(@path)'), entry.xpath('string(@revision)'))
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top