我們正在使用Mercurial來管理我們的代碼並將其設置爲兩個主要分支;默認和穩定。確定何時從另一個分支合併文件(Mercurial)
我們希望能夠找到何時將特定文件添加到穩定分支,但一直無法弄清楚這是如何實現的。
作爲一個例子,我們有一個穩定分支中的文件(從默認合併),但是當試圖確定文件在什麼階段被合併到穩定分支中時,我們只能看到文件何時被添加到存儲庫(默認分支)。
即
hg log <filename> --verbose
...僅示出了單個變更。
通過遍歷每個必要的修訂並確定文件出現在哪個文件中的繁瑣過程,可以計算出它的添加時間,但希望有一個更優雅的方法!
編輯:下面的步驟可以用來證明這個問題:
hg init
echo "syntax: glob" > .hgignore
hg addremove
hg commit -u testuser -m "new repository"
hg branch stable
hg commit -u testuser -m "new branch"
hg update default
echo "The quick red fox jumps over the lazy brown dog." > test.txt
hg addremove
hg commit -u testuser -m "new file"
hg update stable
hg merge default
hg commit -u testuser -m 'mock release'
hg update default
hg merge stable
hg commit -u testuser -m "switch to development branch (default)"
test.txt文件是現在穩定的存儲庫的一部分....
hg update stable --clean
hg log .\test.txt
changeset: 3:ca4338ed2c56
user: testuser
date: Mon Aug 03 15:52:48 2015 +0100
summary: new file
...然而,隨着-b穩定選項沒有顯示結果。
隱而不宣」 t似乎爲我工作。即使我可以看到引用的文件存在於穩定的存儲庫中,-b穩定選項也沒有結果。我會舉例說明如何重現我所看到的,這可能會更好地解釋問題(或突出顯示我做錯了什麼!)。 –
@JinxedNZ - 添加了解決方案(草案) –