2012-01-03 36 views
5

使用在Emacs出現,我有這樣一個會議:如何將emacs'emerge中衝突的兩種變體結合起來?

<<<<<<< variant A 
      522ADC9C14B2FD9D00F56BAD /* close_test_button.png in Resources */, 
      522ADC9D14B2FD9D00F56BAD /* [email protected] in Resources */, 
      522ADCA014B2FDB100F56BAD /* test_failed.png in Resources */, 
      522ADCA114B2FDB100F56BAD /* [email protected] in Resources */, 
>>>>>>> variant B 
      EC1633C014B2F3E3004B52E7 /* arrow.png in Resources */, 
      EC1633C114B2F3E3004B52E7 /* [email protected] in Resources */, 
      EC1633C214B2F3E3004B52E7 /* groups.png in Resources */, 
      EC1633C314B2F3E3004B52E7 /* [email protected] in Resources */, 
####### Ancestor 
======= end 

我可以通過敲擊一個b我的鍵盤上選擇變異一個,但怎麼辦我將這兩種變體一個接一個地結合起來?

回答

7

只需使用C-H 米的出現緩衝區內查看幫助當前模式。與大多數模式的典型情況一樣,Emerge次要模式在本幫助文本中顯示其鍵綁定。

,幫助顯示您可以插入變種A或B與內容:我一個b,這樣你就可以使用該功能插入哪個變種當前未選擇。

您也可以從默認的「快速」模式切換到「編輯」模式以直接編輯合併的文本。使用C-CC-C˚F在編輯模式下,回到快速模式(在編輯模式下,因爲,所有出現的命令需要由C-CC-C前綴)。

emerge的手冊有更多詳細信息:
M-:(info "(emacs) Emerge")RET

特別是,它解釋了XÇ的結合行爲,它結合了兩種變體在一個使用預定義的模板字符串的單個步驟:
M-:(info "(emacs) Combining in Emerge")RET

但是,默認模板使用C預處理器條件語法,因此幾乎可以肯定要覆蓋該模板。您可以通過Emerge Options菜單或emerge-set-combine-template設置模板。對於模板語法看到:
vemerge-combine-versions-templateRET

1

使用快捷鍵:

x-c (combine the two versions of the difference) 

這將插入兩個相互衝突的地區依次,產生的輸出是這樣的:

vvvvvvvvvvvvvvvvvvvv 
#ifdef NEW 
522ADC9C14B2FD9D00F56BAD /* close_test_button.png in Resources */, 
522ADC9D14B2FD9D00F56BAD /* [email protected] in Resources */, 
522ADCA014B2FDB100F56BAD /* test_failed.png in Resources */, 
522ADCA114B2FDB100F56BAD /* [email protected] in Resources */, 
#else /* not NEW */ 
EC1633C014B2F3E3004B52E7 /* arrow.png in Resources */, 
EC1633C114B2F3E3004B52E7 /* [email protected] in Resources */, 
EC1633C214B2F3E3004B52E7 /* groups.png in Resources */, 
EC1633C314B2F3E3004B52E7 /* [email protected] in Resources */, 
#endif /* not NEW */ 
^^^^^^^^^^^^^^^^^^^^ 

從那裏,你可以去我nto編輯模式(快捷鍵:'e')根據需要刪除#ifdef宏以創建所需的最終合併。

相關問題