如何找出SVN中包含某行的修订版 [英] How to find out which revision contained a certain line in SVN

查看:36
本文介绍了如何找出SVN中包含某行的修订版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们希望在 SVN 中对该文件的许多修订中跟踪删除该文件中的单个行.

We would like to trace removal of a single line in a certain file amongst the many revisions to that file in SVN.

我尝试查看各种修订版/差异以查看它何时被删除,但无法找到有问题的修订版.我们如何使用 svn 命令执行此操作?

I tried looking at various revisions / diffs to see when it was removed, but was unable to find the offending revision. How do we do this using a svn command?

推荐答案

如果您使用的是 Linux 并且知道要查看哪个文件,您可以使用该 shell 脚本输出该文件的所有修订版本.

If you're on Linux and you know in which file to look you can use that shell script to output all the revision of that file.

#!/bin/bash
svn log "$1" -q | grep -oE r[0-9]+ | xargs -t -n1 -r -d '\n' svn cat "$1" -r

将工作副本文件名或存储库 URL 作为参数传递给此脚本.

Pass a working copy file name or repository URL as a parameter to this script.

如果其他一切都失败了,并且您正在使用 svnadmin dump 进行常规转储,而没有 --incremental 开关,您可以 grep 获取最新转储文件中的文本.

If everything else fail and you're doing regular dumps using svnadmin dump without the --incremental switch you could grep for the text in the latest dump file.

非增量转储包含每个文件的每个修订版的全文.

Non-incremental dumps contain the full text for each revision of every files.

这篇关于如何找出SVN中包含某行的修订版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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