Reputation: 1456
I work with another developer in the same working copy (I know that is a bad idea), we usually do updated of individual files, and now we have files in some revision and others in another. How can I see a list of files with their respectives revision numbers? (The working copy is in a linux box, and we're using svn command line.
Thanks in advance for any help
Upvotes: 8
Views: 29124
Reputation: 8896
svn -R list --verbose
It will give output like this
109 authorname 3818 Nov 20 2012 JSON/xyz.json
Upvotes: 5
Reputation: 638
svn info -R . | egrep "^Path:|^Revision:" | paste - -
Which means
Produces output like this:
Path: Tools/xmlvalidator Revision: 69114
Path: Tools/xmlvalidator/main.c Revision: 69114
Upvotes: 3
Reputation: 2613
Same program in php:
svn info -R > tmp_info && php versions.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";
}
Upvotes: 0
Reputation: 1456
Finally I used combined solution using the command posted by Dmitry Yudakov and a 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() );
}
Upvotes: 0
Reputation: 30832
The svnversion command may be what you need as it will show the range of revisions in the working copy.
Upvotes: 2
Reputation: 15734
Try this in your working copy
svn info *
or
svn info -R *
to see all files and directories recursively
You may type svn help info
to see other options
Upvotes: 9