How can I see the version number of each file in a working copy of SVN?

I work with another developer in the same working copy (I know this is a bad idea), we usually update individual files, and now we have files in some version and others in another. How can I view a list of files with their review numbers? (The working copy is in the linux window, and we use the svn command line.

Thank you in advance for your help.

+5
source share
5 answers

Finally, I used a combined solution using the command sent by Dmitry Yudakov and the litle script in js-rhino. Now I can find all the files with a different revision number, doing something like:

svn info -R > tmp_info rhino read-svn.js | grep -v 295

/* The script */ 
lines = readFile("tmp_info").split("\n");  
lines.pop();
String.prototype.trim = function() {
  return this.replace(/^\s+|\s+$/g,"");
}
var idx = 0;
var files = [];
files[0] = {};
var line;
for (i in lines) {
  line = lines[i].toString();
  if(line.length) { 
    key = line.split(':')[0];
    if(key == 'Name' || key == 'Revision' || key == 'Path')
      files[idx][key] = line.split(':')[1];
  } else {
    idx++;
    files[idx] = {};
  }
}

print( 'files : ' + files.length + "\n");
for (i = 0; i< files.length ; i++) {
  var file = files[i];
  if(typeof(file.Name) !== "undefined")
    print(" REVISION: " + file.Revision.trim() + ' -  ' + file.Path.trim() +'/' + file.Name.trim() );
}
0

svn info *

svn info -R *

svn help info,

+6

svn info -R . | egrep "^Path:|^Revision:" | paste - -

  • ,
  • , ":" ":"
  • Path/Revision

:

Path: Tools/xmlvalidator    Revision: 69114
Path: Tools/xmlvalidator/main.c Revision: 69114
+2
+1

php:

svn info -R > tmp_info && & && & php version.php

<?php
$lines = explode("\n",file_get_contents("tmp_info"));
array_pop($lines);

$idx = 0;
$files = array();
$files[] = array();

foreach($lines as $i => $line) {
  if(!empty($line)) { 
    $spl = explode(':',$line);
    $key = $spl[0];
    if($key == 'Name' || $key == 'Revision' || $key == 'Path')
      $files[$idx][$key] = $spl[1];
  } else {
    $idx++;
    $files[$idx] = array();
  }
}


echo  'files : ' . count($files) . "\n";
foreach($files as $file) {
  if(isset($file["Name"]))
    echo " REVISION: " . trim($file["Revision"]) . ' -  ' . trim($file["Path"]) .'/' . trim($file["Name"]) . "\n";
}
0

All Articles