我知道这是一个复杂的场景,但这就是我的情况。我们有文件(*.doc)正在更新并发布到SharePoint。我要他们在水星。我们有一个脚本,可以将这些文件导出到标记为mercurial存储库(克隆)的windows共享中,目的是自动将这些文件推送到中央mercurial存储库中。
文件的初始导出导致这些文件被标记为未版本化。一个简单的
hg add
hg push
将文件移动到所需的中央仓库中。这些文件每晚都会自动导出(覆盖文件)到windows共享。但是mercurial无法识别任何更改。
hg status
结果为空。
我的问题是,我如何才能让Mercurial认识到这些变化,从而推动它们?
谢谢
我的理解是你有两个仓库,一个是中央仓库的克隆。从这里开始,您必须将它们视为单独的存储库。hg status只显示repo (.hg directory
)中working copy
和原始文件之间的差异。对仓库的改动会显示在hg log
而不是hg status
这是一个正常的程序。
+------+ +------+
|Repo A| |Repo B|
+------+ +------+
New File | |
.............> | |
| hg add |
| hg commit |
Files in repo A | |
--------------- | |
| hg push |
|------------------ | Files in Repo B
| hg pull |
| | hg update
| | hg status (empty)
| | hg log (Will show new
version )
另外,MS word Doc文件将被视为二进制文件,您可能无法充分利用版本控制。
很抱歉有点迂腐,但是repo和工作目录之间的差异已经引起了足够的混乱。从repo中拉出的文件将只显示hg update
:
+------------+ +---------+
|Your working| |Your Repo|
|directory | |.hg dir |
+------------+ +---------+
| |
| hg status |
|-----------------------------|
| shows difference between | hg pull <--
| working dir and repo |-------------
| | <-- hg push
| | from another repo
| |
| hg update | hg pull or push
| <-------------------------- | deals with repo
| This brings latest change | and not working
| version from repo to | dir
working dir