如何查看SVN工作副本中每个文件的修订号? [英] How can I see the revision number of each file in a SVN working copy?

查看:101
本文介绍了如何查看SVN工作副本中每个文件的修订号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一工作副本中与另一位开发人员一起工作(我知道这是一个坏主意),我们通常会更新单个文件,现在我们拥有某个修订版本的文件,而另一个修订版本中的文件. 如何查看带有各自修订号的文件列表? (工作副本位于linux框中,我们正在使用svn命令行.

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.

在此先感谢您的帮助

推荐答案

最后,我使用了Dmitry Yudakov发布的命令和js-rhino中的litle脚本的组合解决方案.现在,我可以找到所有具有不同修订版本号的文件,例如:

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信息-R> tmp_info犀牛read-svn.js | grep -v 295

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() );
}

这篇关于如何查看SVN工作副本中每个文件的修订号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆