沒有技術上的原因說明你無法與祖先合併:正如你發現的,Mercurial在某些情況下確實支持它。所以這完全是一個GUI限制。這背後的原因是,當hg update
會給你與hg merge
相同的結果,那麼你應該使用它來代替簡單。
A 合併只是三種存儲庫狀態的組合:共同祖先和兩個正在合併的變更集。三方合併是在一個大塊的基礎上完成的。對於合併本地和遠程表看起來是這樣的:
ancestor local remote -> merge
old old old old (nobody changed the hunk)
old new old new (I changed the hunk)
old old new new (you changed the hunk)
old new new new (hunk was cherry picked onto both branches)
old foo bar <!> (conflict, both changed hunk but differently)
如果local
是remote
的祖先,然後ancestor == local
。因此,該表變爲:
ancestor local remote -> merge
old old old old (nobody changed the hunk)
old old new new (you changed the hunk)
在這兩種情況下,merge
列包含的內容是在remote
列。在你的榜樣,local
是default
和remote
是file-content
:
$ hg update default
$ hg merge file-content
結果是合併變更,看起來就像file-content
。
請求發表本主題也 – 2012-03-22 13:30:03
那麼在這個例子中使用了哪些命令來獲取這個變更集歷史?我不能在命令行重新創建它。 – Jegschemesch 2012-03-22 21:01:22