mercurial/obsolete.py
changeset 34414 014d467f9d08
parent 34408 b6692ba7d5b0
child 34575 dc91580a0a88
equal deleted inserted replaced
34413:83dfbda40e67 34414:014d467f9d08
  1041     useoperation = repo.ui.configbool('experimental',
  1041     useoperation = repo.ui.configbool('experimental',
  1042         'stabilization.track-operation')
  1042         'stabilization.track-operation')
  1043     if useoperation and operation:
  1043     if useoperation and operation:
  1044         metadata['operation'] = operation
  1044         metadata['operation'] = operation
  1045 
  1045 
       
  1046     # Effect flag metadata handling
       
  1047     saveeffectflag = repo.ui.configbool('experimental',
       
  1048                                         'effect-flags',
       
  1049                                         False)
       
  1050 
  1046     tr = repo.transaction('add-obsolescence-marker')
  1051     tr = repo.transaction('add-obsolescence-marker')
  1047     try:
  1052     try:
  1048         markerargs = []
  1053         markerargs = []
  1049         for rel in relations:
  1054         for rel in relations:
  1050             prec = rel[0]
  1055             prec = rel[0]
  1064                 npare = tuple(p.node() for p in prec.parents())
  1069                 npare = tuple(p.node() for p in prec.parents())
  1065             if nprec in nsucs:
  1070             if nprec in nsucs:
  1066                 raise error.Abort(_("changeset %s cannot obsolete itself")
  1071                 raise error.Abort(_("changeset %s cannot obsolete itself")
  1067                                   % prec)
  1072                                   % prec)
  1068 
  1073 
       
  1074             # Effect flag can be different by relation
       
  1075             if saveeffectflag:
       
  1076                 # The effect flag is saved in a versioned field name for future
       
  1077                 # evolution
       
  1078                 effectflag = obsutil.geteffectflag(rel)
       
  1079                 localmetadata[obsutil.EFFECTFLAGFIELD] = "%d" % effectflag
       
  1080 
  1069             # Creating the marker causes the hidden cache to become invalid,
  1081             # Creating the marker causes the hidden cache to become invalid,
  1070             # which causes recomputation when we ask for prec.parents() above.
  1082             # which causes recomputation when we ask for prec.parents() above.
  1071             # Resulting in n^2 behavior.  So let's prepare all of the args
  1083             # Resulting in n^2 behavior.  So let's prepare all of the args
  1072             # first, then create the markers.
  1084             # first, then create the markers.
  1073             markerargs.append((nprec, nsucs, npare, localmetadata))
  1085             markerargs.append((nprec, nsucs, npare, localmetadata))