Mercurial质疑如何处理不同的头脑

问题描述 投票:4回答:2

我的存储库不能合并,不能拉,也不能做更新只是因为它不能简单地关闭那些错误的不需要的头。似乎我的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 in somewhere?如果没有任何改变,为什么会说未完成的未提交更改?这是我最新的hg头输出。如何了解这些变化的更多信息?为什么做一些像摆脱其中一个头一样简单的事情几乎是不可能的?我并不好奇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克隆并添加更改,但上面列出的更改意味着我忘了同步一些东西,我想让它更容易

abort: unsynced remote changes?

How to see a mercurial difference

How to get rid of older mercurial heads?

现在hg diff,hg status和hg incoming不显示任何更改,我已设法清理存储库(位于googlecode.com上),甚至通过web ui 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个版本并将它们逐个关闭而不仅仅是hg head -r -close或者一些可以处理未提交的变更集的简单齿轮来将未提交的(?)变更集关闭到mercurial。

它看起来现在解决了,我可以查看多个头是什么:

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

...

version-control mercurial repository versioning
2个回答
2
投票

看一下修订图,你会更清楚:

这可以通过以下方式完成:

  • qazxsw poi和打开网页浏览器到qazxsw poi
  • 如果您启用了图形日志扩展,则使用hg serve(仅使用http://localhost:8000进行最新的20次提交)
  • 如果您的操作系统可用,请使用hg glog

它看起来像这样:

为了组合这些头部的变化,您需要合并它们。见上面的68040,它将两个头合二为一。如果您同时从多个位置进入提交,则必须执行此操作。


2
投票

你可以跑

-l 20

看看你在变更集R中改变了什么。你也可以使用像TortoiseHg这样的日志查看器,看看变更集在变更集图中的位置。

基本的工作周期是

TortoiseHg
© www.soinside.com 2019 - 2024. All rights reserved.