如何在Subversion儲存庫歷史記錄中查找文件? (How Do I Find a File in a Subversion Repository History?)


問題描述

如何在 Subversion 存儲庫歷史記錄中查找文件? (How Do I Find a File in a Subversion Repository History?)

是否可以通過 Subversion 存儲庫的歷史來查找特定名稱的文件(更好的是讓它們進行通配符搜索)?

我想看看一個 .bat 文件在過去的某個時間點已提交到存儲庫,但在以後的更新中已被刪除。甚至每次修訂時都轉儲文件歷史記錄也可以,因為我可以 grep 輸出。我查看了手冊,但找不到一個好的方法。

每個提交的日誌都是描述性的,所以我不能只查看日誌消息來查看進行了哪些修改。我想 Subversion 確實有辦法檢索這個?


參考解法

方法 1:

TortoiseSVN can search the logs very easily, and on my system I can enter ".plg" in the search box and find all adds, modifies, and deletes for those files.

Without Tortoise, the only way I can think of doing that would be to grep the full logs or parse the logs and do your own searching for 'A' and 'D' indicators on the file you are looking for (use svn log ‑‑verbose to get file paths).

svn log ‑‑verbose | grep .bat

方法 2:

I assume you are using the SVN command line client. Give TortoiseSVN a try. Its "Show Log" dialog allows searching for comments, filenames and authors.

http://tortoisesvn.net/downloads

PS: Windows only.

方法 3:

TortoiseSVN is completely sweet. I can't imagine dealing with Subversion without it.

Also, as a long shot, if you're using Eclipse I'd recommend the Subclipse plug‑in.

方法 4:

Personally I'd use

svnadmin dump ‑r1:HEAD /path/to/repo/

Pipe it into less and search or grep with some context.

方法 5:

svn log ‑v .bat

(by kaybenlerollcrashmstrIshmaeelOwenPhilip ReynoldsDinakar)

參考文件

  1. How Do I Find a File in a Subversion Repository History? (CC BY‑SA 2.5/3.0/4.0)

#repository #svn






相關問題

開發代碼時如何使用 Internet Subversion 存儲庫? (How to use an Internet Subversion respository when developing code?)

在線庫報告的錯誤 (Online repository for reported bugs)

如何在Subversion儲存庫歷史記錄中查找文件? (How Do I Find a File in a Subversion Repository History?)

如何從 Nexus Professional 遷移到 Nexus OSS (How to migrate from Nexus Professional to Nexus OSS)

如何查看存儲庫? (How to see repositories?)

將遠程 github 存儲庫中的更改合併到本地存儲庫 (Merge changes from remote github repository to your local repository)

如何為 Xcode 項目設置 Git 存儲庫? (How to set up a Git repository for an Xcode project?)

如何簽入從不同存儲庫簽出的代碼 (How to check in code which is checked out from different repository)

如何使 Hg/Git 成為遠程倉庫? (How to make Hg/Git a remote repo?)

繼承是一種“is-a”關係;總結“界面”關係的好方法是什麼?——總結其他關係? (inheritance is an 'is-a' relationship; What is a good way to summarize the 'interface' relationship? -- Summarizing other relationships?)

存儲庫模式問題 (Repository Pattern Question)

為 Mac 和 Windows 設置 React Native 代碼庫 (setting up react native code repository for Mac & Windows)







留言討論