mercurial/obsolete.py
changeset 34413 014d467f9d08
parent 34407 b6692ba7d5b0
child 34575 dc91580a0a88
--- a/mercurial/obsolete.py	Fri Jun 30 03:44:00 2017 +0200
+++ b/mercurial/obsolete.py	Thu Jul 06 14:50:17 2017 +0200
@@ -1043,6 +1043,11 @@
     if useoperation and operation:
         metadata['operation'] = operation
 
+    # Effect flag metadata handling
+    saveeffectflag = repo.ui.configbool('experimental',
+                                        'effect-flags',
+                                        False)
+
     tr = repo.transaction('add-obsolescence-marker')
     try:
         markerargs = []
@@ -1066,6 +1071,13 @@
                 raise error.Abort(_("changeset %s cannot obsolete itself")
                                   % prec)
 
+            # Effect flag can be different by relation
+            if saveeffectflag:
+                # The effect flag is saved in a versioned field name for future
+                # evolution
+                effectflag = obsutil.geteffectflag(rel)
+                localmetadata[obsutil.EFFECTFLAGFIELD] = "%d" % effectflag
+
             # Creating the marker causes the hidden cache to become invalid,
             # which causes recomputation when we ask for prec.parents() above.
             # Resulting in n^2 behavior.  So let's prepare all of the args