Mercurial问题如何处理不同的头
我的存储库无法合并,无法拉取,也无法进行更新,只是因为它不能简单地关闭错误的不需要的头。看来我对 hg 进行了更改,使合并变得复杂。我预计这些更改(头)是相当无关紧要的,我只想启用一个头和一个分支。
$ hg merge
branch 'default' has 4 heads
$ hg merge -r e571b17295e9
outstanding uncommitted changes (use 'hg status' to list changes)
$ hg commit -m ''
nothing changed
我是否忘记了 hg Push 或 hg pull 某处?如果没有发生任何变化,为什么会说未完成的未提交更改?这是我从 hg head 的最新输出。我如何了解更多有关这些变化的信息? 为什么像去掉一个头这样简单的事情几乎不可能完成? 我并不好奇 hg 如何定义变更集、修订版、头部、分支等,我只是希望简单的操作变得简单。
$ hg head
ändring: 233:88de4be7943c
märke: tip
användare: niklasro
datum: Mon Sep 05 18:30:37 2011 +0000
kortfattat: addremove
ändring: 176:e571b17295e9
användare: tekniklas
datum: Sat Jan 08 04:45:07 2011 +0000
kortfattat: twitter support added
ändring: 159:f8d974793b12
förälder: 157:ef1d955b9236
användare: tekniklas
datum: Sat Dec 18 17:05:45 2010 +0000
kortfattat: remove
ändring: 89:008a2ac46b4f
användare: tekniklas
datum: Sun Aug 01 07:10:40 2010 +0000
kortfattat: classifiedsmarket/market/market_ad_preview.html
我不完全理解如何使用 Mercurial,我想要更多的控制,例如看看当有几个所谓的头时这些日期发生了什么。我主要是这个存储库的唯一开发人员,但希望能够从多个位置更新它。我之前问过这些更改,但我似乎不知道如何执行 hg pull
从存储库同步到本地。我可以进行 hg 克隆并添加更改,但上面列出的更改意味着我忘记同步某些内容,我想让它更容易
现在 hg diff、hg status 和 hgcoming不显示任何更改,并且我已设法清理存储库(位于 googlecode.com 上),甚至通过 googlecode.com 的网络用户界面更新文件,因此我希望更轻松地在存储库和本地之间同步。
感谢您的任何建议
编辑:我可以看到更改集 176:e571b17295e9 并不重要,我只是想将其与提示合并,没有实际更改,但获得 1 个头。
所以我尝试并发现更改集是无关紧要的,并且我不关心此更改:
$ hg diff -c e571b17295e9
diff -r f50d4c4461e5 -r e571b17295e9 classifiedsmarket/app.yaml
--- a/classifiedsmarket/app.yaml Thu Jan 06 11:36:10 2011 +0000
+++ b/classifiedsmarket/app.yaml Sat Jan 08 04:45:07 2011 +0000
@@ -4,6 +4,10 @@
api_version: 1
default_expiration: "400d 5h"
handlers:
+- url: /twitter
+ script: /twitter_oauth_handler.py
+- url: /oauth.*
+ script: /twitter_oauth_handler.py
- url: /
script: i18n.py
- url: /li
所以为什么我需要对根本不重要的变更集进行如此多的管理?
所以现在我尝试另一种方法,但也失败了。伟大的。选择 Mercurial,您将无法进行开发,因为您所做的只是尝试丢失一些垃圾:
hg update -r 123
hg commit --close-branch -m 'Closing old branch'
hg update -C default
我的尝试:
$ hg update -r e571b17295e9
avbryter: crosses branches (merge branches or use --clean to discard changes)
太好了,没有任何效果,我想做的事情非常简单。我尝试了更多才能真正理解不可能做一些非常简单的事情,以及我们如何浪费时间尝试做最基本的事情以及 Mercurial 如何无法做简单的事情:
$ hg head
ändring: 235:68bc6873fafb
märke: tip
användare: niklasro
datum: Tue Sep 06 11:53:32 2011 +0000
kortfattat: added fblist
ändring: 176:e571b17295e9
användare: tekniklas
datum: Sat Jan 08 04:45:07 2011 +0000
kortfattat: twitter support added
ändring: 159:f8d974793b12
förälder: 157:ef1d955b9236
användare: tekniklas
datum: Sat Dec 18 17:05:45 2010 +0000
kortfattat: remove
ändring: 89:008a2ac46b4f
användare: tekniklas
datum: Sun Aug 01 07:10:40 2010 +0000
kortfattat: classifiedsmarket/market/market_ad_preview.html
$ hg merge -r e571b17295e9
avbryter: outstanding uncommitted changes (use 'hg status' to list changes)
所以我尝试另一种方法只是为了弄清楚 VCS 如何完全停止我无法进行开发,而这些愚蠢的修订却无法工作,即使您想做的事情非常简单:
$ hg update -r e571b17295e9
avbryter: crosses branches (merge branches or use --clean to discard changes)
我结束了为我想要关闭的每个修订创建一个新的本地目录,克隆了修订,关闭它是由当地做出的承诺和推动克隆,它似乎有效,但我这样做的方式正确吗?看来我仍然可以“打开”封闭的头,这很好,但我还没有尝试与其他人的更改同步,并且我没有尝试通过 googlecode.com 中的 webui 进行更改并与本地拉取/合并克隆。
因此,我通过克隆 3 个修订版并一一关闭它们来关闭 Mercurial 的未提交(?)变更集,而不仅仅是 hg head -r -close 或一些可以处理未提交变更集的简单 hg 工具。
现在看起来已经解决了,我可以查看多个头是
o changeset: 181:bb0545ceff33
| parent: 179:b03d10fc4260
| user: tekniklas
| date: Sun Jan 09 04:39:33 2011 +0000
| summary: twitter support
|
| o changeset: 180:9bbefafbdb16
| | parent: 178:e571b17295e9
| | user: niklasro
| | date: Tue Sep 06 14:09:19 2011 +0000
| | summary: close badbranch, this approach never worked
| |
o | changeset: 179:b03d10fc4260
| | parent: 177:f50d4c4461e5
| | user: tekniklas
| | date: Sun Jan 09 04:32:12 2011 +0000
| | summary: removed aeoid
| |
| o changeset: 178:e571b17295e9
|/ user: tekniklas
| date: Sat Jan 08 04:45:07 2011 +0000
| summary: twitter support added
|
o changeset: 177:f50d4c4461e5
| user: tekniklas
| date: Thu Jan 06 11:36:10 2011 +0000
| summary: i18n reports
…………
o changeset: 163:aa078cbdbbe5
| parent: 161:51ec76c45cf0
| user: tekniklas
| date: Sat Dec 18 19:20:25 2010 +0000
| summary: fb login
|
| o changeset: 162:37951de836dc
| | parent: 160:f8d974793b12
| | user: niklasro
| | date: Tue Sep 06 14:17:18 2011 +0000
| | summary: close badbranch, this approach never worked
| |
o | changeset: 161:51ec76c45cf0
| | parent: 159:652958f895e2
| | user: tekniklas
| | date: Sat Dec 18 19:19:41 2010 +0000
| | summary: fb login
| |
| o changeset: 160:f8d974793b12
| | parent: 158:ef1d955b9236
| | user: tekniklas
| | date: Sat Dec 18 17:05:45 2010 +0000
| | summary: remove
| |
o | changeset: 159:652958f895e2
| | parent: 157:9658adb05792
| | user: tekniklas
| | date: Sat Dec 18 19:19:17 2010 +0000
| | summary: fb login
| |
| o changeset: 158:ef1d955b9236
|/ user: tekniklas
| date: Sat Dec 18 17:05:00 2010 +0000
| summary: removed
|
o changeset: 157:9658adb05792
| user: tekniklas
| date: Fri Dec 17 21:57:36 2010 +0000
| summary: tabs
:
o changeset: 92:9e48ce2a444e
| parent: 90:a381c59aedc1
| user: ubuntu@ubuntu
| date: Mon Aug 02 04:30:31 2010 +0000
| summary: coordinates
|
| o changeset: 91:84facd40c690
| | parent: 89:008a2ac46b4f
| | user: niklasro
| | date: Tue Sep 06 14:18:58 2011 +0000
| | summary: close badbranch, this approach never worked
| |
o | changeset: 90:a381c59aedc1
| | parent: 88:cfcd7313278d
| | user: ubuntu@ubuntu
| | date: Mon Aug 02 04:30:16 2010 +0000
| | summary: logo
| |
| o changeset: 89:008a2ac46b4f
|/ user: tekniklas
| date: Sun Aug 01 07:10:40 2010 +0000
| summary: classifiedsmarket/market/market_ad_preview.html
|
o changeset: 88:cfcd7313278d
| user: ubuntu@ubuntu
| date: Sun Aug 01 05:58:50 2010 +0000
| summary: previewform
什么
My repository can't merge, can't pull and can't do update just because it can't simply close unwanted heads that were mistakes. It seems I've got changes in hg that complicates merging. I expect the changes (heads) to be rather irrelevant and I want to enable just one head and just one branch.
$ hg merge
branch 'default' has 4 heads
$ hg merge -r e571b17295e9
outstanding uncommitted changes (use 'hg status' to list changes)
$ hg commit -m ''
nothing changed
Did I forget hg push or hg pull somewhere? If nothing changed, why does it say outstanding uncommitted changes? This is my latest output from hg head. How do I find out more about what these changes were?
Why is it nearly impossible to do something as simple as getting rid of one of the heads?
I'm not curious how hg defines a changeset, a revision, a head, a branch etc, I just want the simple actions to be simple.
$ hg head
ändring: 233:88de4be7943c
märke: tip
användare: niklasro
datum: Mon Sep 05 18:30:37 2011 +0000
kortfattat: addremove
ändring: 176:e571b17295e9
användare: tekniklas
datum: Sat Jan 08 04:45:07 2011 +0000
kortfattat: twitter support added
ändring: 159:f8d974793b12
förälder: 157:ef1d955b9236
användare: tekniklas
datum: Sat Dec 18 17:05:45 2010 +0000
kortfattat: remove
ändring: 89:008a2ac46b4f
användare: tekniklas
datum: Sun Aug 01 07:10:40 2010 +0000
kortfattat: classifiedsmarket/market/market_ad_preview.html
I don't fully understand how to use mercurial and I want more control e.g. see what happened these dates when there were several so-called heads. I'm mostly the sole developer on this repository but want ability to update it from many locations. I asked before about these changes and I can't seem to figure out how to do a hg pull
to sync from repository to local. I can do a hg clone and add changes but the listed changes above means that I forgot to sync something and I want to make it easier to
abort: unsynced remote changes?
How to see a mercurial difference
How to get rid of older mercurial heads?
Now hg diff, hg status and hg incoming don't display any changes and I've managed to clean the repository (which is on googlecode.com) and even update files via the web ui googlecode.com has so I want to make it easier to sync between repository and local.
Thanks for any advice
Edit: I can see that the changeset 176:e571b17295e9 is not important and I just want to merge it with the tip with no actual change but getting 1 head.
So I try and I get that the changeset is irrevelavant and I don't care about this change:
$ hg diff -c e571b17295e9
diff -r f50d4c4461e5 -r e571b17295e9 classifiedsmarket/app.yaml
--- a/classifiedsmarket/app.yaml Thu Jan 06 11:36:10 2011 +0000
+++ b/classifiedsmarket/app.yaml Sat Jan 08 04:45:07 2011 +0000
@@ -4,6 +4,10 @@
api_version: 1
default_expiration: "400d 5h"
handlers:
+- url: /twitter
+ script: /twitter_oauth_handler.py
+- url: /oauth.*
+ script: /twitter_oauth_handler.py
- url: /
script: i18n.py
- url: /li
So why do I need so much administation about changesets that do not matter at all?
So now I try this other way which also fails. Great. Choose mercurial and you won't be able to do development since all you do is try to lose some garbage:
hg update -r 123
hg commit --close-branch -m 'Closing old branch'
hg update -C default
My try:
$ hg update -r e571b17295e9
avbryter: crosses branches (merge branches or use --clean to discard changes)
Great, nothing works and what I'm trying to do is really simple. I try some more to really understand that it's impossible to do something really simple and how we lose time trying to do the most basic thing and how Mercurial can't do something simple:
$ hg head
ändring: 235:68bc6873fafb
märke: tip
användare: niklasro
datum: Tue Sep 06 11:53:32 2011 +0000
kortfattat: added fblist
ändring: 176:e571b17295e9
användare: tekniklas
datum: Sat Jan 08 04:45:07 2011 +0000
kortfattat: twitter support added
ändring: 159:f8d974793b12
förälder: 157:ef1d955b9236
användare: tekniklas
datum: Sat Dec 18 17:05:45 2010 +0000
kortfattat: remove
ändring: 89:008a2ac46b4f
användare: tekniklas
datum: Sun Aug 01 07:10:40 2010 +0000
kortfattat: classifiedsmarket/market/market_ad_preview.html
$ hg merge -r e571b17295e9
avbryter: outstanding uncommitted changes (use 'hg status' to list changes)
So I try another way just to make clear how VCS completely stops me from being able to do development and these stupid revisions instead that won't work not even when it's really simple you're trying to do:
$ hg update -r e571b17295e9
avbryter: crosses branches (merge branches or use --clean to discard changes)
I ended creating a new local directory for each revision I wanted to close, cloned the revision, closed it, committed and pushed from the local clone and it seems to have worked but did I do this the right way? It seems I can still "open" the closed heads which is good but I didn't try yet to sync with other people's changes and I didn't try to do a change via the webui in googlecode.com and pull / merge with local clone.
So I closed uncommitted(?) changesets to mercurial by cloning 3 revisions and close them one by one instead of just hg head -r -close or some simple gear to hg that can handle uncommitted changesets.
It looks resolved now and I can view what the multiple heads were:
o changeset: 181:bb0545ceff33
| parent: 179:b03d10fc4260
| user: tekniklas
| date: Sun Jan 09 04:39:33 2011 +0000
| summary: twitter support
|
| o changeset: 180:9bbefafbdb16
| | parent: 178:e571b17295e9
| | user: niklasro
| | date: Tue Sep 06 14:09:19 2011 +0000
| | summary: close badbranch, this approach never worked
| |
o | changeset: 179:b03d10fc4260
| | parent: 177:f50d4c4461e5
| | user: tekniklas
| | date: Sun Jan 09 04:32:12 2011 +0000
| | summary: removed aeoid
| |
| o changeset: 178:e571b17295e9
|/ user: tekniklas
| date: Sat Jan 08 04:45:07 2011 +0000
| summary: twitter support added
|
o changeset: 177:f50d4c4461e5
| user: tekniklas
| date: Thu Jan 06 11:36:10 2011 +0000
| summary: i18n reports
...
o changeset: 163:aa078cbdbbe5
| parent: 161:51ec76c45cf0
| user: tekniklas
| date: Sat Dec 18 19:20:25 2010 +0000
| summary: fb login
|
| o changeset: 162:37951de836dc
| | parent: 160:f8d974793b12
| | user: niklasro
| | date: Tue Sep 06 14:17:18 2011 +0000
| | summary: close badbranch, this approach never worked
| |
o | changeset: 161:51ec76c45cf0
| | parent: 159:652958f895e2
| | user: tekniklas
| | date: Sat Dec 18 19:19:41 2010 +0000
| | summary: fb login
| |
| o changeset: 160:f8d974793b12
| | parent: 158:ef1d955b9236
| | user: tekniklas
| | date: Sat Dec 18 17:05:45 2010 +0000
| | summary: remove
| |
o | changeset: 159:652958f895e2
| | parent: 157:9658adb05792
| | user: tekniklas
| | date: Sat Dec 18 19:19:17 2010 +0000
| | summary: fb login
| |
| o changeset: 158:ef1d955b9236
|/ user: tekniklas
| date: Sat Dec 18 17:05:00 2010 +0000
| summary: removed
|
o changeset: 157:9658adb05792
| user: tekniklas
| date: Fri Dec 17 21:57:36 2010 +0000
| summary: tabs
...
o changeset: 92:9e48ce2a444e
| parent: 90:a381c59aedc1
| user: ubuntu@ubuntu
| date: Mon Aug 02 04:30:31 2010 +0000
| summary: coordinates
|
| o changeset: 91:84facd40c690
| | parent: 89:008a2ac46b4f
| | user: niklasro
| | date: Tue Sep 06 14:18:58 2011 +0000
| | summary: close badbranch, this approach never worked
| |
o | changeset: 90:a381c59aedc1
| | parent: 88:cfcd7313278d
| | user: ubuntu@ubuntu
| | date: Mon Aug 02 04:30:16 2010 +0000
| | summary: logo
| |
| o changeset: 89:008a2ac46b4f
|/ user: tekniklas
| date: Sun Aug 01 07:10:40 2010 +0000
| summary: classifiedsmarket/market/market_ad_preview.html
|
o changeset: 88:cfcd7313278d
| user: ubuntu@ubuntu
| date: Sun Aug 01 05:58:50 2010 +0000
| summary: previewform
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看一下修订图,您会更清楚:
这可以通过以下方式完成:
hgserve
并打开网络浏览器到 http://localhost:8000hg glog
如果您启用了图形日志扩展(使用-l 20
来查看最新的 20仅提交)它看起来像这样:
为了合并这些头中的更改,您需要合并它们。参见上面的68040,它将两个头合二为一。如果您有同时来自多个位置的提交,则这是必要的。
Take a look at the revision graph, and it shall be clearer to you:
This can be done via:
hg serve
and open webbrowser to http://localhost:8000hg glog
if you've enabled the graph log extension (use-l 20
to se latest 20 commits only)It will looks something like this:
In order to combine the changes in these heads, you need to merge them. See 68040 above, which combines two heads into one. This is necessary if you have commits coming in from several locations simultaneously.
您可以运行以
查看在变更集 R 中更改的内容。您还可以使用像 TortoiseHg 这样的日志查看器来查看并查看变更集出现在变更集图中的位置。
基本工作周期为
You can run
to see what you changed in changeset R. You can also use a log viewer like TortoiseHg se see that and to see where the changesets appear in the changeset graph.
The basic work cycle is