# HG changeset patch # User Pierre-Yves David # Date 1349874691 -7200 # Node ID 02f34904305f6988489bb360593f959793ef3fe2 # Parent 5a0a01c4c7c2260d3f1328bab3adf792b7805f04# Parent 2cd2ee20d9faf2f9a25628aa9634e3650110f200 merge with default diff -r 5a0a01c4c7c2 -r 02f34904305f docs/figures/edit-is-rewrite-step1.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/figures/edit-is-rewrite-step1.svg Wed Oct 10 15:11:31 2012 +0200 @@ -0,0 +1,509 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + ";Alice;Babar"19b08111 + + + + "19b08111;Alice;Babar,Celeste"925d8319 + + + + "6fcdd7fe;Bob;Babar"⟶ebc2b5a1 + + + + "925d8319;Alice;Babar,Celeste,flore"6fcdd7fe + + + + + + + diff -r 5a0a01c4c7c2 -r 02f34904305f docs/figures/edit-is-rewrite-step2.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/figures/edit-is-rewrite-step2.svg Wed Oct 10 15:11:31 2012 +0200 @@ -0,0 +1,832 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + ";Alice;Babar"19b08111 + + + + "19b08111;Alice;Babar,Celeste"925d8319 + + + + "6fcdd7fe;Bob;Babar"⟶ebc2b5a1 + + + + "925d8319;Alice;Babar,Celeste,flore"6fcdd7fe + + + + + + + "19b08111;Bob;Babar,Celeste"1a25964c + + + + "6d9e1549;Bob;Babar"dda72e36 + + + + "1a25964c;Alice;Babar,Celeste,Flore"6d9e1549 + + + + + + diff -r 5a0a01c4c7c2 -r 02f34904305f docs/figures/explain-troubles-concurrent-10-solution.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/figures/explain-troubles-concurrent-10-solution.svg Wed Oct 10 15:11:31 2012 +0200 @@ -0,0 +1,929 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + B + + + + A + + + + Z + + + + + + B' + + + + B'' + + + + + + + + + + B + + + + A + + + + Z + + + + + + B' + + + + B'' + + + + + + + + + + + + B + + + + B' + + + + B'' + + + + B* + + + + + + + + B* + + + diff -r 5a0a01c4c7c2 -r 02f34904305f docs/figures/explain-troubles-concurrent-10-sumup.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/figures/explain-troubles-concurrent-10-sumup.svg Wed Oct 10 15:11:31 2012 +0200 @@ -0,0 +1,1451 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + Local + Distant + final = divergent + + + + + initial + + + + B + + + + A + + + + Z + + + + + + + + B + + + + A + + + + Z + + + + + + B' + + + + + + + + B + + + + A + + + + Z + + + + + + B'' + + + + + + + + B + + + + A + + + + Z + + + + + + B' + + + + B'' + + + + + + + + diff -r 5a0a01c4c7c2 -r 02f34904305f docs/figures/explain-troubles-latecomer-10-sumup.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/figures/explain-troubles-latecomer-10-sumup.svg Wed Oct 10 15:11:31 2012 +0200 @@ -0,0 +1,1039 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + Local + Distant + final = tardif + + + + + + + + A + + + + Z + + + + + + + A + + + + Z + + + + + A' + + + + + initial + + + + v4.2 + + + + A + + + + Z + + + + + + A' + + + + + + + + v4.2 + + + + A + + + + Z + + + + + + diff -r 5a0a01c4c7c2 -r 02f34904305f docs/figures/explain-troubles-latecomer-15-solution.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/figures/explain-troubles-latecomer-15-solution.svg Wed Oct 10 15:11:31 2012 +0200 @@ -0,0 +1,994 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + v4.2 + + + + A + + + + Z + + + + + + A' + + + + + + + + + v4.2 + + + + A + + + + Z + + + + + + A' + + Aᵟ + + + + + + + + diff -r 5a0a01c4c7c2 -r 02f34904305f docs/figures/explain-troubles-unstable-10-sumup.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/figures/explain-troubles-unstable-10-sumup.svg Wed Oct 10 15:11:31 2012 +0200 @@ -0,0 +1,1101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + B + + + + A + + + + Z + + + + + + B' + + + + A' + + + + + + + Local + + + + + + B + + + + A + + + + Z + + + + + + C + + + + Distant + + + + + + + B + + + + A + + + + Z + + + + + + B' + + + + A' + + + + + + + + C + + + + final = instable + + + + + + B + + + + A + + + + Z + + + + + initial + + + + + + + diff -r 5a0a01c4c7c2 -r 02f34904305f docs/figures/explain-troubles-unstable-15-solution.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/figures/explain-troubles-unstable-15-solution.svg Wed Oct 10 15:11:31 2012 +0200 @@ -0,0 +1,1006 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + B + + + + A + + + + Z + + + + + + B' + + + + A' + + + + + + + + C + + + + + + + B + + + + A + + + + Z + + + + + + B' + + + + A' + + + + + + + + C + + + + + C' + + + + + + diff -r 5a0a01c4c7c2 -r 02f34904305f docs/figures/git.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/figures/git.svg Wed Oct 10 15:11:31 2012 +0200 @@ -0,0 +1,863 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + B + + + + A + + + + Z + + + + + + B' + + + + A' + + + + + + + + + + + + B + + + + A + + + + Z + + + + + + B' + + + + A' + + + + + + C + + + + + feature-babar + other/feature-babar + feature-babar + + diff -r 5a0a01c4c7c2 -r 02f34904305f docs/instability.rst --- a/docs/instability.rst Thu Sep 20 23:14:59 2012 +0200 +++ b/docs/instability.rst Wed Oct 10 15:11:31 2012 +0200 @@ -32,9 +32,8 @@ changing B content too. This requires the creation of **another** changeset, which is semantically good. -:: +.. figure:: ./figures/edit-is-rewrite-step2.svg - Schema base, A, B and B' To avoid duplication, the older changeset is usually discarded from accessible history. I'm calling them *obsolete* changesets. @@ -116,7 +115,7 @@ This allow much more flexible workflow but two major feature are lost in the process: -:Graceful merge: MQ use plain-patch to store changeset content and patch have +:graceful merge: MQ use plain-patch to store changeset content and patch have trouble to apply in changing context. Applying your queue becomes very painful when context changes. diff -r 5a0a01c4c7c2 -r 02f34904305f docs/obs-concept.rst --- a/docs/obs-concept.rst Thu Sep 20 23:14:59 2012 +0200 +++ b/docs/obs-concept.rst Wed Oct 10 15:11:31 2012 +0200 @@ -57,15 +57,8 @@ *meaningful*. -.. warning:: add a schema:: +.. figure:: ./figures/git.* - C - | B--- - |/ - | - A - - Only B and A are visible. This simplifies the process of getting rid of old changesets. You can just leave them in place and move the reference on the new one. You @@ -300,8 +293,7 @@ will keep the same parent than `A'` and `A''` with two obsolete markers pointing to both `A` and `A'` -.. warning:: TODO: Add a schema of the resolution. (merge A' and A'' with A as - ancestor and graft the result of A^) +.. figure:: ./figures/explain-troubles-concurrent-10-solution.* Allowing multiple new changesets to obsolete a single one allows to distinguish a split changeset from a history rewriting conflict. @@ -325,12 +317,14 @@ * *newer* version of a public changeset are called **latecomer** and highlighted as an error case. +.. figure:: ./figures/explain-troubles-concurrent-10-sumup.* + Solving such an error is easy. Because we know what changeset a *latecomer* tries to rewrite, we can easily compute a smaller changeset containing only the change from the old *public* to the new *latecomer*. -.. warning:: add a schema +.. figure:: ./figures/explain-troubles-concurrent-15-solution.* Conclusion diff -r 5a0a01c4c7c2 -r 02f34904305f docs/obs-terms.rst --- a/docs/obs-terms.rst Thu Sep 20 23:14:59 2012 +0200 +++ b/docs/obs-terms.rst Wed Oct 10 15:11:31 2012 +0200 @@ -104,7 +104,7 @@ | | for *troubled* | | | | changeset to combine | (possible alternative name: | | | multiple issue at once. | precarious) | -| | (a.k.a. conflicting and | | +| | (a.k.a. divergent and | | | | unstable) +-----------------------------+ | | | | | | (possible alternative | **latecomer** | @@ -125,17 +125,17 @@ | | | mindless, disenchanting) | | | | | | | +-----------------------------+ -| | | **conflicting** | +| | | **divergent** | | | | | -| | | *conflicting* is changeset | +| | | *divergent* is changeset | | | | that appears when multiple | | | | changesets are successors | | | | of the same precursor. | | | | | -| | | *conflicting* are solved | +| | | *divergent* are solved | | | | through a three ways merge | | | | between the two | -| | | *conflictings*, | +| | | *divergent* , | | | | using the last "obsolete- | | | | -common-ancestor" as the | | | | base. | @@ -145,7 +145,8 @@ | | | conflict) | | | | | | | | (possible alternative names:| -| | | clashing, rival) | +| | | clashing, rival, concurent, | +| | | conflicting) | | | | | | +--------------------------+-----------------------------+ | | | @@ -182,7 +183,7 @@ - "ok" changeset - latecomer - - conflicting + - divergent Any better idea are welcome. @@ -232,7 +233,7 @@ ``````````````` Automatically resolve *troublesome* changesets -(*unstable*, *latecomer* and *conflicting*) +(*unstable*, *latecomer* and *divergent*) This is an important name as hg pull/push will suggest it the same way it suggest merging when you add heads. diff -r 5a0a01c4c7c2 -r 02f34904305f hgext/evolve.py --- a/hgext/evolve.py Thu Sep 20 23:14:59 2012 +0200 +++ b/hgext/evolve.py Wed Oct 10 15:11:31 2012 +0200 @@ -295,6 +295,25 @@ reposetup = eh.final_reposetup ##################################################################### +### Critical fix ### +##################################################################### + +@eh.wrapfunction(mercurial.obsolete, '_readmarkers') +def safereadmarkers(orig, data): + """safe maker wrapper to remove nullid succesors + + Nullid successors was created by older version of evolve. + """ + for marker in orig(data): + if nullid in marker[1]: + marker = (marker[0], + tuple(s for s in marker[1] if s != nullid), + marker[2], + marker[3]) + yield marker + + +##################################################################### ### Obsolescence Caching Logic ### ##################################################################### @@ -554,6 +573,15 @@ conf = getobscache(repo, 'conflicting') return [r for r in subset if r in conf] +@eh.revset('divergent') +def revsetdivergent(repo, subset, x): + """``divergent()`` + Changesets marked as successors of a same changeset. + """ + args = revset.getargs(x, 0, 0, 'divergent takes no arguments') + conf = getobscache(repo, 'conflicting') + return [r for r in subset if r in conf] + ### Discovery wrapping