- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我经常读到 Hg(以及 Git 和...)在 merge 方面比 SVN 更好,但我从未见过 Hg/Git 可以在 SVN 失败的地方(或 SVN 需要手动干预的地方) merge 某些东西的实际例子。您能否发布一些分支/修改/提交/...-操作的分步列表,以显示在 Hg/Git 继续前进时 SVN 会在哪里失败?请实际的,不是非常特殊的情况......
一些背景:我们有几十个开发人员使用 SVN 开发项目,每个项目(或一组类似的项目)都在自己的存储库中。我们知道如何应用发布分支和功能分支,因此我们不会经常遇到问题(即,我们曾经遇到过这种情况,但我们学会了克服 Joel's problems “一个程序员给整个团队造成创伤”的问题”或“需要六名开发人员两周来重新整合一个分支机构”)。我们有非常稳定的发布分支,仅用于应用错误修复。我们的主干应该足够稳定,能够在一周内创建一个版本。我们有单个开发人员或开发人员组可以处理的功能分支。是的,它们在重新集成后被删除,因此它们不会弄乱存储库。 ;)
所以我仍在努力寻找 Hg/Git 相对于 SVN 的优势。我很想获得一些实践经验,但目前还没有任何更大的项目可以转移到 Hg/Git,所以我只能玩那些只包含一些组合文件的小型人工项目。我正在寻找一些您可以感受到 Hg/Git 令人印象深刻的力量的案例,因为到目前为止我经常读到它们,但我自己却没有找到它们。
最佳答案
我也一直在寻找这样一种情况,比如说,Subversion 无法 merge 分支,而 Mercurial(和 Git、Bazaar 等)做了正确的事情。
SVN 手册 describes how renamed files are merged incorrectly .这适用于 Subversion 1.5 , 1.6 , 1.7 , 和 1.8 !我试图重现以下情况:
cd /tmprm -rf svn-repo svn-checkoutsvnadmin create svn-reposvn checkout file:///tmp/svn-repo svn-checkoutcd svn-checkoutmkdir trunk branchesecho 'Goodbye, World!' > trunk/hello.txtsvn add trunk branchessvn commit -m 'Initial import.'svn copy '^/trunk' '^/branches/rename' -m 'Create branch.'svn switch '^/trunk' .echo 'Hello, World!' > hello.txtsvn commit -m 'Update on trunk.'svn switch '^/branches/rename' .svn rename hello.txt hello.en.txtsvn commit -m 'Rename on branch.'svn switch '^/trunk' .svn merge --reintegrate '^/branches/rename'
According to the book, the merge should finish cleanly, but with wrong data in the renamed file since the update on trunk
is forgotten. Instead I get a tree conflict (this is with Subversion 1.6.17, the newest version in Debian at the time of writing):
--- Merging differences between repository URLs into '.':A hello.en.txt C hello.txtSummary of conflicts: Tree conflicts: 1
There shouldn't be any conflict at all — the update should be merged into the new name of the file. While Subversion fails, Mercurial handles this correctly:
rm -rf /tmp/hg-repo
hg init /tmp/hg-repo
cd /tmp/hg-repo
echo 'Goodbye, World!' > hello.txt
hg add hello.txt
hg commit -m 'Initial import.'
echo 'Hello, World!' > hello.txt
hg commit -m 'Update.'
hg update 0
hg rename hello.txt hello.en.txt
hg commit -m 'Rename.'
hg merge
merge 之前,存储库看起来像这样(来自 hg glog
):
@ changeset: 2:6502899164cc| tag: tip| parent: 0:d08bcebadd9e| user: Martin Geisler | date: Thu Apr 01 12:29:19 2010 +0200| summary: Rename.|| o changeset: 1:9d06fa155634|/ user: Martin Geisler | date: Thu Apr 01 12:29:18 2010 +0200| summary: Update.|o changeset: 0:d08bcebadd9e user: Martin Geisler date: Thu Apr 01 12:29:18 2010 +0200 summary: Initial import.
merge 的输出是:
merging hello.en.txt and hello.txt to hello.en.txt0 files updated, 1 files merged, 0 files removed, 0 files unresolved(branch merge, don't forget to commit)
换句话说:Mercurial 将修订版 1 中的更改 merge 到修订版 2 中的新文件名中 (hello.en.txt
)。为了支持重构,处理这种情况当然是必不可少的,而重构正是您希望在分支上做的事情。
关于git - merge : Hg/Git vs. SVN,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2475831/
我是 Mercurial 的新手,并且不知何故仍处于评估过程中,所以这四个概念对我来说有点困惑。有些被提到等同于 Git 的 Staging/Index 概念,有些甚至比 Git 的 Staging
关闭。这个问题需要更多focused .它目前不接受答案。 想改善这个问题吗?更新问题,使其仅关注一个问题 editing this post . 6 个月前关闭。 Improve this ques
任何人都可以给我详细信息吗? 例如? #ID 是属性、特性、选择器还是 anchor ? 默认属性和默认属性是不同的东西吗? 这些都是标签还是元素? 我们将对此说些什么 这个 ..... 还有这些
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 8 年前。 Improve this qu
我有一个由 Javascript 填充的下拉列表。 在决定加载时显示的默认值时,我意识到以下属性显示的值完全相同: innerText innerHTML label text textContent
我可以知道每个 Exec 之间有什么区别吗? , ExecWait , ExecShell , nsExec::Exec , nsExec::ExecToLog, nsExec::ExecToStac
当您处于版本 1 和版本 2 之间时,您会如何维护您的软件? 从我的角度来看,“补丁”、“修补程序”、“维护版本”、“服务包”等术语都很模糊,根据与您交谈的对象不同,定义也不同。 您如何称呼版本之间的
我刚刚发现在 ES6 中有一个新的数学方法:Math.trunc . 我在 MDN article 中阅读了它的描述。 , 听起来像使用 |0 . 此外,>0 , &-1 , ^0也做类似的事情(感谢
我想知道我的 StackPanel 所有项目的高度。 有什么区别: Height - 获取或设置元素的建议高度。 ActualHeight - 获取该元素的渲染高度。 (只读) ExtentHeigh
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 9 年前。 Improve this
我对所有声称以某种方式阻止计算的内置 Mathematica 函数感到困惑:Unevaluated、Defer、Hold ,以及超过 6 个 Hold* 形式。 Mathematica 文档只是单独解
我什至不确定正确的术语,所以让我从我的目标开始:拥有一个简单的应用程序(“Data Doler”),它只会将大量数据从文件读取到内存中,然后提供服务将该数据切片到名为“Data Lapper”的单个多
我刚刚开始在我的项目中使用 Elasticsearch,我想像 sql 关键字一样搜索 '喜欢%' 做。 谁能解释一下 之间的区别通配符 , 前缀 , 查询字符串和 正则表达式 ? 哪个可以搜索最好性
由于我对任何主流浏览器(Firefox、Chrome、Opera)都不太满意,而且我尝试过的不太受欢迎的浏览器(近十几种)都没有,所以我决定 DIY 并制作一个网页我想要最好的浏览器。 主要目标是让它
我知道如何使用 Python 解析页面。我的问题是哪种方法是所有解析技术中最快的,其他方法的速度有多快? 我知道的解析技术有Xpath、DOM、BeautifulSoup,还有使用Python的fin
我试图从正在解析的命令行中找出哪个函数最适合将十进制、十六进制或八进制数转换为 int 最好——在不知道输入的情况下事先。 目标是使用一个函数来识别不同类型的输入并将其分配给它的整数 (int) 值,
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我们需要在我们的网站上显示酒吧、餐馆和剧院等各种场所的元信息(例如,地址、姓名)。 理想情况下,用户会输入地点名称以及邮政编码,我们会提供最接近的匹配项。 人们将哪些 API 用于类似的地理定位目的?
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我正在创建我的第一个 Web 应用程序,我真的很困惑应该使用什么技术。 我的应用程序需要看起来很严肃(像一个应用程序),它不需要很多色彩缤纷的图形界面。它只需要一个工具栏、一个标签栏、一个拆分面板(最
我是一名优秀的程序员,十分优秀!