Patchwork [1,of,3,V4] obsolete: move marker flags to obsutil

login
register
mail settings
Submitter Anton Shestakov
Date March 15, 2018, 3:58 a.m.
Message ID <b7b0c187d6aef20b63d4.1521086331@neuro>
Download mbox | patch
Permalink /patch/29526/
State Accepted
Headers show

Comments

Anton Shestakov - March 15, 2018, 3:58 a.m.
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1520944478 -28800
#      Tue Mar 13 20:34:38 2018 +0800
# Node ID b7b0c187d6aef20b63d48e1c98fcc923353fc707
# Parent  31581528f2421dc5d8a567125b8ecc0367b2b906
# EXP-Topic whyunstable-obsutil
obsolete: move marker flags to obsutil

Evolve extension expects to have obsolete.bumpedfix (imported in
hgext3rd/evolve/evolvecmd.py), so we provide it.
Yuya Nishihara - March 15, 2018, 2:04 p.m.
On Thu, 15 Mar 2018 11:58:51 +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6@dwimlabs.net>
> # Date 1520944478 -28800
> #      Tue Mar 13 20:34:38 2018 +0800
> # Node ID b7b0c187d6aef20b63d48e1c98fcc923353fc707
> # Parent  31581528f2421dc5d8a567125b8ecc0367b2b906
> # EXP-Topic whyunstable-obsutil
> obsolete: move marker flags to obsutil

Queued the series, thanks.

Patch

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -148,38 +148,8 @@  def isenabled(repo, option):
 
     return _getoptionvalue(repo, option)
 
-### obsolescence marker flag
-
-## bumpedfix flag
-#
-# When a changeset A' succeed to a changeset A which became public, we call A'
-# "bumped" because it's a successors of a public changesets
-#
-# o    A' (bumped)
-# |`:
-# | o  A
-# |/
-# o    Z
-#
-# The way to solve this situation is to create a new changeset Ad as children
-# of A. This changeset have the same content than A'. So the diff from A to A'
-# is the same than the diff from A to Ad. Ad is marked as a successors of A'
-#
-# o   Ad
-# |`:
-# | x A'
-# |'|
-# o | A
-# |/
-# o Z
-#
-# But by transitivity Ad is also a successors of A. To avoid having Ad marked
-# as bumped too, we add the `bumpedfix` flag to the marker. <A', (Ad,)>.
-# This flag mean that the successors express the changes between the public and
-# bumped version and fix the situation, breaking the transitivity of
-# "bumped" here.
-bumpedfix = 1
-usingsha256 = 2
+bumpedfix = obsutil.bumpedfix
+usingsha256 = obsutil.usingsha256
 
 ## Parsing and writing of version "0"
 #
diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -17,6 +17,39 @@  from . import (
 )
 from .utils import dateutil
 
+### obsolescence marker flag
+
+## bumpedfix flag
+#
+# When a changeset A' succeed to a changeset A which became public, we call A'
+# "bumped" because it's a successors of a public changesets
+#
+# o    A' (bumped)
+# |`:
+# | o  A
+# |/
+# o    Z
+#
+# The way to solve this situation is to create a new changeset Ad as children
+# of A. This changeset have the same content than A'. So the diff from A to A'
+# is the same than the diff from A to Ad. Ad is marked as a successors of A'
+#
+# o   Ad
+# |`:
+# | x A'
+# |'|
+# o | A
+# |/
+# o Z
+#
+# But by transitivity Ad is also a successors of A. To avoid having Ad marked
+# as bumped too, we add the `bumpedfix` flag to the marker. <A', (Ad,)>.
+# This flag mean that the successors express the changes between the public and
+# bumped version and fix the situation, breaking the transitivity of
+# "bumped" here.
+bumpedfix = 1
+usingsha256 = 2
+
 class marker(object):
     """Wrap obsolete marker raw data"""