1. Pierre-Yves David
  2. mutable-history

Commits

Pierre-Yves David  committed 02f3490 Merge

merge with default

  • Participants
  • Parent commits 5a0a01c, 2cd2ee2
  • Branches default

Comments (0)

Files changed (13)

File docs/figures/edit-is-rewrite-step1.svg

View file
Added
New image

File docs/figures/edit-is-rewrite-step2.svg

View file
Added
New image

File docs/figures/explain-troubles-concurrent-10-solution.svg

View file
Added
New image

File docs/figures/explain-troubles-concurrent-10-sumup.svg

View file
Added
New image

File docs/figures/explain-troubles-latecomer-10-sumup.svg

View file
Added
New image

File docs/figures/explain-troubles-latecomer-15-solution.svg

View file
Added
New image

File docs/figures/explain-troubles-unstable-10-sumup.svg

View file
Added
New image

File docs/figures/explain-troubles-unstable-15-solution.svg

View file
Added
New image

File docs/figures/git.svg

View file
Added
New image

File docs/instability.rst

View file
 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.
 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.
 

File docs/obs-concept.rst

View file
 *meaningful*.
 
 
-.. warning:: add a schema::
+.. figure:: ./figures/git.*
 
-        C
-        | B---<foo>
-        |/
-        |
-        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
 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.
 * *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

File docs/obs-terms.rst

View file
 |                     | 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**               |
 |                     |                          | 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.                       |
 |                     |                          | conflict)                   |
 |                     |                          |                             |
 |                     |                          | (possible alternative names:|
-|                     |                          | clashing, rival)            |
+|                     |                          | clashing, rival, concurent, |
+|                     |                          | conflicting)                |
 |                     |                          |                             |
 |                     +--------------------------+-----------------------------+
 |                     |                                                        |
 
           - "ok" changeset
           - latecomer
-          - conflicting
+          - divergent
 
           Any better idea are welcome.
 
 ```````````````
 
 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.

File hgext/evolve.py

View file
 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                                    ###
 #####################################################################
 
     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