hg 恢复strip删除的版本
2017-04-21 00:00
106 查看
11th April 2016
Filed under: Best Practices, Featured
Comments: Comments Off on Recovering stripped files when using Mercurial
If you accidentally strip a patch and do not have a backup for it, you can still recover your files using Mercurial. To recover your files:
Open a Microsoft Windows Command Prompt window.
Navigate to the project folder where you stripped the files.
Run the dir
Navigate to the .hg folder where Mercurial stores all relevant project files.
Run the dir command again.
Navigate to the strip-backup folder where Mercurial stores the backup bundles of stripped patches.
Run the dir command again. Multiple files display in the directory that use the <hash>-hg format. They are the backup bundles of stripped patches.
![](https://community.nexj.com/wp-content/uploads/2016/04/post1-970x618.png)
Use Windows Explorer to find the required file. Open the strip-backup folder in Windows Explorer, and sort by Date modified descending. Unless the necessary backup bundle is already known, NexJ recommends that you restore the bundles in reverse chronological order starting from the most recent bundle.
![](https://community.nexj.com/wp-content/uploads/2016/04/post2-970x546.png)
Navigate back to the project folder.
To restore a bundle, run hg unbundle .hg\strip-backup\<bundle_file_name>. The hg executable can be found in <NexJ_Studio_installation_folder>\plugins\
nexj.oss.hgbinaries_win32_<version>\os\win32. You may want to add it to the PATH environment variable to make it accessible globally.
![](https://community.nexj.com/wp-content/uploads/2016/04/post3-970x618.png)
Synchronize the project in NexJ Studio to see the restored patch. If the restored patch is not the one needed, then continue restoring the patches in reverse chronological order until the required patch is retrieved.
![](https://community.nexj.com/wp-content/uploads/2016/04/post4-970x164.png)
Note: You may restore the backup bundles in any order, instead of using reverse chronological order. However, it may not be safe to do so. You may end up attempting to restore a backup bundle, which has a dependency on another backup bundle that has not been restored. In this case, you will get an error.
![](https://community.nexj.com/wp-content/uploads/2016/04/post5-970x618.png)
Filed under: Best Practices, Featured
Comments: Comments Off on Recovering stripped files when using Mercurial
If you accidentally strip a patch and do not have a backup for it, you can still recover your files using Mercurial. To recover your files:
Open a Microsoft Windows Command Prompt window.
Navigate to the project folder where you stripped the files.
Run the dir
Navigate to the .hg folder where Mercurial stores all relevant project files.
Run the dir command again.
Navigate to the strip-backup folder where Mercurial stores the backup bundles of stripped patches.
Run the dir command again. Multiple files display in the directory that use the <hash>-hg format. They are the backup bundles of stripped patches.
![](https://community.nexj.com/wp-content/uploads/2016/04/post1-970x618.png)
Use Windows Explorer to find the required file. Open the strip-backup folder in Windows Explorer, and sort by Date modified descending. Unless the necessary backup bundle is already known, NexJ recommends that you restore the bundles in reverse chronological order starting from the most recent bundle.
![](https://community.nexj.com/wp-content/uploads/2016/04/post2-970x546.png)
Navigate back to the project folder.
To restore a bundle, run hg unbundle .hg\strip-backup\<bundle_file_name>. The hg executable can be found in <NexJ_Studio_installation_folder>\plugins\
nexj.oss.hgbinaries_win32_<version>\os\win32. You may want to add it to the PATH environment variable to make it accessible globally.
![](https://community.nexj.com/wp-content/uploads/2016/04/post3-970x618.png)
Synchronize the project in NexJ Studio to see the restored patch. If the restored patch is not the one needed, then continue restoring the patches in reverse chronological order until the required patch is retrieved.
![](https://community.nexj.com/wp-content/uploads/2016/04/post4-970x164.png)
Note: You may restore the backup bundles in any order, instead of using reverse chronological order. However, it may not be safe to do so. You may end up attempting to restore a backup bundle, which has a dependency on another backup bundle that has not been restored. In this case, you will get an error.
![](https://community.nexj.com/wp-content/uploads/2016/04/post5-970x618.png)
相关文章推荐
- 学习SVN版本控制与恢复删除
- MyEclipse 更新后返回上一个版本(恢复删除文件功能)
- 学习SVN版本控制与恢复删除
- Eclipse中恢复已删除文件和还原到先前版本
- TortoiseHg + Mercurial 配置MqExtension实现删除分支(Strip the reversion)
- 学习SVN版本控制与恢复删除
- Eclipse中恢复已删除文件和还原到先前版本
- C#.NET 大型企业信息化系统集成快速开发平台 4.2 版本 - 所有的基础数据都可以恢复删除
- 学习SVN版本控制与恢复删除
- 学习SVN版本控制与恢复删除
- 关于 maven 私服删除版本恢复的问题
- Eclipse中恢复已删除文件和还原到先前版本
- 关于 maven 私服删除版本恢复的问题
- 贝壳一键还原2.0 Windows版本发布+采用磁盘快照技术+支持系统热备份+启动器安装工具+支持安装热键+恢复误删除文件工具
- paip.版本控件svn删除文件或目录后的恢复
- 怎么样确保大型企业版本的安全自动发布机制和系统?被物理删除后快速分钟级完全恢复系统!
- Eclipse中恢复已删除文件和还原到先前版本
- SVN版本控制与恢复删除
- 关闭SQL SERVER用户进程,防止因为用户正在使用数据库,导致数据库恢复或删除失败
- 在SQL200中误删除了一个表如何恢复