English 中文(简体)
Mercurial, 检查一个文件的某一版本是否在历史中存在过吗?
原标题:Mercurial, check if a particular version of a file has existed in the history before?

为了略为详细地阐述标题问题,是否有办法让Mercurial通过存储库历史搜索某个特定版本的文件,并显示包含该版本的所有修订(或仅是最新修订)?

例如,让我们说,目前的工作修订是 < code> 300 和一个文件被恢复到较早的版本( 例如, 修订版 < code> 200 ) 。 我不知道这个 - 我所能轻易看到的是新文件与 < code> 300 版本“ 有何不同 ” 。 我怎样才能找出它可能被恢复到的所有可能的修改?

如果Mercurial无法按本地做, 是否有另一个工具可以做? (TotoisHG? )

最佳回答

我不认为 / em > 可以用任何 hg s 内嵌功能实现, 但是您可以通过明智的 xargs 和 md5sum 应用程序获得类似功能 :

hg log --template "{rev}\n" | xargs -I "{}" /bin/bash -c  echo $(hg cat -r {} <filename> | md5sum) {} 

这将为您提供一份 md5 校验和列表, 并附有校验编号, 当您排序时, 它会为您提供文件的修改共享版本 。

问题回答

暂无回答




相关问题
Can I clone part of a Mercurial repository?

Is it possible to clone part of a Mercurial repository? Let s say the repository is quite large, or contains multiple projects, or multiple branches. Can I clone only part of the repository? E.g. in ...

Sync files in Two Different Repos using HG

I ve got a problem when I try to sync files in two different repos. What I want to do is: I ve got 2 repos A and B, and they share some common files, suppose they lie in A/docs/common/ and B/docs/...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

git for mercurial like git-svn

Hello is there a tool for git that allow to work with mercurial repositories F.e. for svn there is a git-svn package, that allows to clone/commit/update from svn and work in a git way.. So is there ...

Useful Mercurial Hooks [closed]

What are some useful Mercurial hooks that you have come across? A few example hooks are located in the Mercurial book: acl bugzilla notify check for whitespace I personally don t find these very ...