# HG changeset patch # User Boris Feld # Date 1537988589 -7200 # Node ID 99f0f052b6bf12d6a120d178ef75a64f13b2502e # Parent bae6f1418a95ad54b99ac13ef601f77ddd4e4b25 obsolete: preindent code in createmarkers This will help to make the next change clearer. diff -r bae6f1418a95 -r 99f0f052b6bf mercurial/obsolete.py --- a/mercurial/obsolete.py Wed Sep 26 23:37:43 2018 +0200 +++ b/mercurial/obsolete.py Wed Sep 26 21:03:09 2018 +0200 @@ -994,36 +994,37 @@ markerargs = [] for rel in relations: prec = rel[0] - sucs = rel[1] - localmetadata = metadata.copy() - if 2 < len(rel): - localmetadata.update(rel[2]) + if True: + sucs = rel[1] + localmetadata = metadata.copy() + if 2 < len(rel): + localmetadata.update(rel[2]) - if not prec.mutable(): - raise error.Abort(_("cannot obsolete public changeset: %s") - % prec, - hint="see 'hg help phases' for details") - nprec = prec.node() - nsucs = tuple(s.node() for s in sucs) - npare = None - if not nsucs: - npare = tuple(p.node() for p in prec.parents()) - if nprec in nsucs: - raise error.Abort(_("changeset %s cannot obsolete itself") - % prec) + if not prec.mutable(): + raise error.Abort(_("cannot obsolete public changeset: %s") + % prec, + hint="see 'hg help phases' for details") + nprec = prec.node() + nsucs = tuple(s.node() for s in sucs) + npare = None + if not nsucs: + npare = tuple(p.node() for p in prec.parents()) + if nprec in nsucs: + 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(prec, sucs) - localmetadata[obsutil.EFFECTFLAGFIELD] = "%d" % effectflag + # 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(prec, sucs) + 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 - # first, then create the markers. - markerargs.append((nprec, nsucs, npare, localmetadata)) + # 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 first, then create the markers. + markerargs.append((nprec, nsucs, npare, localmetadata)) for args in markerargs: nprec, nsucs, npare, localmetadata = args