three-way-merge

How do I specify a merge-base to use in a 'hg merge'

こ雲淡風輕ζ 提交于 2019-12-03 07:50:42
I'm trying to do a complicated merge in a complicated hg repository. I'm not happy with the "newest shared ancestor" that Mercurial chooses to use as the "base" to perform the merge. I'd like to specify a specific commit of my own choice to use as base. Is this possible, and if so, how? Mercurial 3.0: You can now select the ancestor to use as a merge base. You do that by setting merge.preferancestor . Mercurial will tell you about it when this makes sense. With the example below, you would see: $ hg merge note: using eb49ad46fd72 as ancestor of 333411d2f751 and 7d1f71140c74 alternatively, use

Why are Mercurial backouts in one branch affecting other branches?

亡梦爱人 提交于 2019-11-30 04:55:37
This is a difficult situation to explain, so bear with me. I have a Mercurial repository with 2 main branches, default and dev . Work is usually done in a named branch off of dev (a feature branch). There may be many feature branches at any one time. Once work is completed in that branch, it is merged back into dev . When the time comes to prepare a release, another named branch is created off of dev (a release branch). Sometimes it is necessary to exclude entire features from a release. If that is the case, the merge changeset from where the feature branch was merged into dev is backed out of

Three-way compare function for Arrays in Javascript

杀马特。学长 韩版系。学妹 提交于 2019-11-29 17:12:37
There have been other questions about How to compare arrays in JavaScript? . What I want to know is the most straightforward way to write/use a three-way comparison function like the one required by Array.sort(). Here's an example using the default one which doesn't work well: > [ [4,5,10], [4,5,6], [4,1,2] ].sort() // no compare function, uses the default one [ [ 4, 1, 2 ], [ 4, 5, 10 ], // oops, string sorting makes 10 < 6 [ 4, 5, 6 ] ] This is what I came up with: // return -1 if lhs is "less" than rhs, +1 if "greater", and 0 if equal // if lhs and rhs have different lengths, only the

Three-way compare function for Arrays in Javascript

Deadly 提交于 2019-11-28 11:20:45
问题 There have been other questions about How to compare arrays in JavaScript?. What I want to know is the most straightforward way to write/use a three-way comparison function like the one required by Array.sort(). Here's an example using the default one which doesn't work well: > [ [4,5,10], [4,5,6], [4,1,2] ].sort() // no compare function, uses the default one [ [ 4, 1, 2 ], [ 4, 5, 10 ], // oops, string sorting makes 10 < 6 [ 4, 5, 6 ] ] This is what I came up with: // return -1 if lhs is

Why is a 3-way merge advantageous over a 2-way merge?

余生颓废 提交于 2019-11-26 00:41:25
问题 Wikipedia says a 3-way merge is less error-prone than a 2-way merge, and often times doesn\'t need user intervention. Why is this the case? An example where a 3-way merge succeeds and a 2-way merge fails would be helpful. 回答1: Say you and your friend both checked out a file, and made some changes to it. You removed a line at the beginning, and your friend added a line at the end. Then he committed his file, and you need to merge his changes into your copy. If you were doing a two-way merge