我是mercurial的新手。我最近與2位同事建立了一個存儲庫,並且在推送我的代碼時遇到了困難。 [我在Windows中使用命令行hg]。特別是當我推我得到類似下面的對話:無法在mercurial中合併
>hg commit -u petermr
>hg push
pushing to http://bitbucket.org/petermr/polyinfo/
searching for changes
abort: push creates new remote heads!
(did you forget to merge? use push -f to force)
>hg merge
abort: there is nothing to merge
>hg status
恐怕用推-f承諾,因爲我認爲這會創建多個頭,並導致我們組的問題。
當我嘗試合併,我得到一個對話是這樣的:
>hg merge -f
merging src/test/resources/PMR/algorithm/cmlAll.xml
output file src/test/resources/PMR/algorithm/cmlAll.xml appears unchanged
was merge successful (yn)? y
merging src/test/resources/PMR/irregular/cmlAll.xml
output file src/test/resources/PMR/irregular/cmlAll.xml appears unchanged
was merge successful (yn)? y
merging src/test/resources/PMR/massChange/cmlAll.xml
output file src/test/resources/PMR/massChange/cmlAll.xml appears unchanged
was merge successful (yn)? y
因爲有幾百個文件,我不能對每個輸入「y」和我找不到合併它們放在一起的一種方式。
UPDATE我試圖第一(2)的回答,仍然有一個問題:
>hg pull
pulling from http://bitbucket.org/petermr/polyinfo/
searching for changes
no changes found
>hg merge
abort: outstanding uncommitted merges
UPDATE響應於@tonfa我不能承諾:
>hg commit
abort: unresolved merge conflicts (see hg resolve)
UPDATE @balpha(我已將所有者的名稱更改爲Foo)
>hg parent
changeset: 24:9ec904d2d5a2
tag: tip
user: petermr
date: Sat Jan 09 16:40:38 2010 +0000
summary: trying to sync
changeset: 22:360aedb72f0e
parent: 21:89c4bd671bd3
parent: 18:3cffa8ca3a2a
user: Foo (not me)
date: Fri Jan 08 16:15:50 2010 +0000
summary: merged
>hg tip
changeset: 24:9ec904d2d5a2
tag: tip
user: petermr
date: Sat Jan 09 16:40:38 2010 +0000
summary: trying to sync
UPDATE
汞柱頭
changeset: 24:9ec904d2d5a2
tag: tip
user: petermr
date: Sat Jan 09 16:40:38 2010 +0000
summary: trying to sync
changeset: 22:360aedb72f0e
parent: 21:89c4bd671bd3
parent: 18:3cffa8ca3a2a
user: Foo (not me)
date: Fri Jan 08 16:15:50 2010 +0000
summary: merged
UPDATE遵循以下建議誰恢復它的修改過程要求(這也是衆多@balpha評論?如果是的話我怎麼找到它?)
>hg revert --all
abort: uncommitted merge - please provide a specific revision
UPDATE仍不能合併...
>hg revert --all -r tip
reverting .hgignore
reverting .hgignore~
reverting src\test\java\org\xmlcml\cml\converters\polyinfo\RegressionTest.java
reverting src\test\resources\PMR\algorithm\cmlAll.xml
reverting src\test\resources\PMR\irregular\cmlAll.xml
reverting src\test\resources\PMR\massChange\cmlAll.xml
reverting src\test\resources\PMR\massChangeOk\cmlAll.xml
reverting src\test\resources\PMR\ok\P340076.both.svg
reverting src\test\resources\PMR\ok\P340076.p.svg
reverting src\test\resources\PMR\ok\P340076.r.svg
reverting src\test\resources\PMR\ratio\cmlAll.xml
>hg status
M .hgignore
M .hgignore~
M src\test\resources\PMR\algorithm\cmlAll.xml
M src\test\resources\PMR\irregular\cmlAll.xml
M src\test\resources\PMR\massChange\cmlAll.xml
M src\test\resources\PMR\massChangeOk\cmlAll.xml
M src\test\resources\PMR\ok\P340076.both.svg
M src\test\resources\PMR\ok\P340076.p.svg
M src\test\resources\PMR\ok\P340076.r.svg
M src\test\resources\PMR\ratio\cmlAll.xml
? src\test\resources\PMR\bug\P020006work.both.svg
? src\test\resources\PMR\irregular\cmlAll.xml.resolve
>hg merge
abort: outstanding uncommitted merges
>hg commit
abort: unresolved merge conflicts (see hg resolve)
注意
hg resolve -all
帶來了必須回答的原始問題「y」數以百計的個人問題,我不知道它是否會解決問題。非常感謝您的幫助!
UPDATE @balpha建議清洗 - 這似乎已取得進展
>hg update --clean -r tip
10 files updated, 0 files merged, 0 files removed, 0 files unresolved
>hg merge
merging src/test/resources/PMR/algorithm/cmlAll.xml
output file src/test/resources/PMR/algorithm/cmlAll.xml appears unchanged
was merge successful (yn)? y
merging src/test/resources/PMR/irregular/cmlAll.xml
output file src/test/resources/PMR/irregular/cmlAll.xml appears unchanged
was merge successful (yn)? y
merging src/test/resources/PMR/massChange/cmlAll.xml
output file src/test/resources/PMR/massChange/cmlAll.xml appears unchanged
was merge successful (yn)? y
merging src/test/resources/PMR/massChangeOk/cmlAll.xml
output file src/test/resources/PMR/massChangeOk/cmlAll.xml appears unchanged
was merge successful (yn)? y
merging src/test/resources/PMR/ok/P340076.both.svg
output file src/test/resources/PMR/ok/P340076.both.svg appears unchanged
was merge successful (yn)? y
merging src/test/resources/PMR/ok/P340076.p.svg
output file src/test/resources/PMR/ok/P340076.p.svg appears unchanged
was merge successful (yn)? y
merging src/test/resources/PMR/ok/P340076.r.svg
output file src/test/resources/PMR/ok/P340076.r.svg appears unchanged
was merge successful (yn)? y
merging src/test/resources/PMR/ratio/cmlAll.xml
output file src/test/resources/PMR/ratio/cmlAll.xml appears unchanged
was merge successful (yn)? y
2 files updated, 8 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
>hg merge
abort: outstanding uncommitted merges
>hg merge -f
abort: outstanding uncommitted merges
>hg commit -u petermr -m "still trying to sy
nc"
>hg merge
abort: there is nothing to merge
>hg push
pushing to http://bitbucket.org/petermr/polyinfo/
searching for changes
http authorization required
realm: Bitbucket.org HTTP
user: petermr
password:
adding changesets
adding manifests
adding file changes
added 4 changesets with 298 changes to 290 files
bb/acl: petermr is allowed. accepted payload.
quota: 13.3 MB in use, 150.0 MB available (8.87% used)
只是提交合並的結果。 – tonfa 2010-01-09 17:47:59
請發佈'hg parent'和'hg tip'的輸出 – balpha 2010-01-09 17:54:18
...和'hg heads' – balpha 2010-01-09 17:59:46