我可以搜索Netbeans的本地历史吗? [英] Can I search Netbeans' local history?

查看:112
本文介绍了我可以搜索Netbeans的本地历史吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Netbeans项目中文件之一的先前版本中,我编写了后来删除的代码,现在我想检索它.但是现在,当我手动转到以前的版本时,找不到该文件,因为此文件的本地历史记录中有很多版本,而且我不记得是什么时候才编写此代码的.

In one of the previous versions of one of my file in a Netbeans project I wrote code that I later removed, and now I want to retrieve it. However now I can't find it when I manually go to previous versions, as I have many versions in the local history of this file, and I don;t remember when exactly I wrote this code.

有没有办法在此文件的本地历史记录上进行搜索?

Is there a way to run a search on the local history of this file?

我在此答案中看到,本地历史记录保存在该路径中

I saw in this answer that the local history is kept in this path

<HOME>/.netbeans/<NB_VERSION>/var/filehistory,其中HOME是我的用户家,而NB_VERSION是NetBeans的版本(例如7.0).

<HOME>/.netbeans/<NB_VERSION>/var/filehistory where HOME is my user home and NB_VERSION is the version of NetBeans (e.g. 7.0).

我尝试在该目录上运行AgentRansack,但无济于事.

I tried running AgentRansack on that directory, but to no avail.

推荐答案

我最近不得不解决此问题并解决了.如上所述,Netbeans将本地历史文件存储在您的用户目录中.该文件夹内有编号目录.根据文件夹的修改日期很容易猜出您需要哪个文件夹(如果您知道上次查看的时间,那么这对您没有多大帮助).在侧面,编号文件夹是另一个带有哈希名称的文件夹,并且在该文件夹的内部是一组文件:数据文件和编号文件.可以使用二进制文件读取器读取数据文件,如果以ascii模式查看,则将显示此历史记录所属的文件名.带编号的文件实际上是zip文件,并且其中包含文件的完整版本.只需解压缩它们,然后使用文本编辑器打开它们(如果它们是纯文本文件)即可.

I recently had to solve this problem and figured it out. Netbeans stores local history files in your user directory as mentioned above. Inside that folder are numbered directories. It's pretty easy to guess which one you need based on the modification date of the folder (if you know when you last looked at it, so that doesn't help you much). In side the numbered folders is another folder with a hashed name, and inside of that folder is a set of files: a data file, and numbered files. The data file can be read with a binary file reader, and if viewed in ascii mode will show the filename that this history belongs to. The numbered files are actually zip files and they have full versions of the file in them. Just unzip those and open with a text editor if they are plain text files.

希望这对您有所帮助,但我意识到现在可能为时已晚.我必须弄清楚这一点,因为我已经使用netbeans打开了一个远程文件(该文件与项目无关),并且由于该文件没有项目而无法返回本地历史记录.但是,通过读取数据文件,我可以在本地历史记录中看到它,而我只是猜想其他文件由于在二进制查看器中以"PK"开头而被压缩.一旦把所有这些放在一起,我就可以自由回家了.

Hope this helps you out, but I realize its probably too late now. I had to figure this out because I had opened a remote file with netbeans (a file that was not associated with a project), and couldn't get back into the Local History because the file didn't have a project. However I could see it in the Local history by reading the data file, and I just guessed that the other files were zipped by the fact that they started with "PK" in the binary viewer. Once I put it all together I was home free.

这篇关于我可以搜索Netbeans的本地历史吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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