无法合并到 Mercurial 中
我是 Mercurial 的新手。我最近与 2 位同事建立了一个存储库,但在推送我的代码时遇到了困难。 [我在 Windows 中使用命令行 hg]。特别是当我推动时,我会得到如下对话:
>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
我害怕使用 Push -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”,而且我找不到将它们全部合并在一起的方法。
更新我已经尝试了前(2)个答案,但仍然有问题:
>hg pull
pulling from http://bitbucket.org/petermr/polyinfo/
searching for changes
no changes found
>hg merge
abort: outstanding uncommitted merges
更新回应@tonfa我无法提交:
>hg commit
abort: unresolved merge conflicts (see hg resolve)
更新@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
更新
hg头
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”的原始问题,我不知道它是否会解决该问题。非常感谢您的帮助!
更新 @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)
I am a newcomer to mercurial. I have recently set up a repository with 2 colleagues and am having difficulty with pushing my code. [I am using command-line hg in Windows]. In particular when I push I get a dialogue like the following:
>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
I am afraid to commit using push -f as I think that will create multiple heads and cause problems for our group.
When I try to merge I get a dialogue something like:
>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
Since there are several hundred files I cannot type "y" for each and I can't find a way of merging them all together.
UPDATE I have tried the first (2) answers and still have a problem:
>hg pull
pulling from http://bitbucket.org/petermr/polyinfo/
searching for changes
no changes found
>hg merge
abort: outstanding uncommitted merges
UPDATE in response to @tonfa I cannot commit:
>hg commit
abort: unresolved merge conflicts (see hg resolve)
UPDATE @balpha (I have changed the name of the owner to 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
hg heads
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 following @balpha comments below who suggests revert which asks for a revison (is this a number? If so how do I find it?)
>hg revert --all
abort: uncommitted merge - please provide a specific revision
UPDATE still cannot merge...
>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)
Note that
hg resolve -all
brings up the original problem of having to answer "y" to hundreds of individual questions and I don't know then whether it will resolve the problem. Your help is much appreciated!
UPDATE @balpha suggested cleaning - this seems to have made progress
>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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您本地的存储库克隆可能不是最新的。做一个
改变这一点。现在您在本地有两个头(您自己之前的提示和 bitbucket 存储库的提示)。现在
合并两个头,
现在您的本地存储库只有一个头,并且该头是 bitbucket 头的子级,因此推送将不再创建远程头:
您就完成了。
Your local clone of the repo is probably not up-to-date. Do a
to change that. Now you have two heads locally (your own previous tip and the tip of the bitbucket repo). Now
to merge the two heads and
Now your local repo has only one head, and this head is a child of the bitbucket head, so pushing will not create a remote head anymore:
and you're done.
在将代码推送到远程存储库之前,首先确保本地存储库是干净的并且没有未完成的合并。
然后,从远程存储库执行 hg pull。这将在您的本地存储库上创建 2 个头。
进行本地合并并提交(解决任何冲突)。
最后push到远程仓库。
一般来说,如果将在远程存储库中创建多个头,则不要推送到远程存储库。
Before you push code to a remote repository, first ensure your local repo is clean and has no outstanding merges.
Then, do a hg pull from the remote repository. This will create 2 heads on your local repository.
Do a local merge, and commit (resolving any conflicts).
Finally, push to the remote repository.
Do not, in general, push to a remote repository if multiple heads will be created there.
即使在本地,您可能也不想提交合并。清理并重新开始的方法(来自 https://www.mercurial-scm.org /bts/issue1533) 似乎是“hg update -C ”。
正如上面提到的,似乎“hg revert -a”应该起作用,但似乎不起作用。
You might not want to commit the merge even locally. The way to clean out and start over again (from https://www.mercurial-scm.org/bts/issue1533) seems to be "hg update -C ".
As alluded to above, it seems as if "hg revert -a" ought to work, but doesn't seem to.
使用TortoiseHg代替命令行工具,它更简单并且以图形方式显示存储库的状态,因此您不会对所有命令感到困惑。
Use TortoiseHg instead of the command line tool, it is simpler and graphically shows the state of the repository, so you won't be confused with all the commands.
我有一个非常相似的问题。事实证明,根本原因是 Mercurial 的“排除”扩展。通过暂时关闭扩展程序,问题得到解决。
提到“排除”扩展页面,所有者承认这是一个已知问题。
I had a very similar problem. Turned out the root cause is the "exclude" extension of the Mercurial. By turning off the extension temporarily, the problem been fixed.
Referring to the "exclude" extension page, owner admitted it's a known issue.