Show More
@@ -994,36 +994,37 b' def createmarkers(repo, relations, flag=' | |||||
994 | markerargs = [] |
|
994 | markerargs = [] | |
995 | for rel in relations: |
|
995 | for rel in relations: | |
996 | prec = rel[0] |
|
996 | prec = rel[0] | |
997 |
|
|
997 | if True: | |
998 | localmetadata = metadata.copy() |
|
998 | sucs = rel[1] | |
999 | if 2 < len(rel): |
|
999 | localmetadata = metadata.copy() | |
1000 |
|
|
1000 | if 2 < len(rel): | |
|
1001 | localmetadata.update(rel[2]) | |||
1001 |
|
1002 | |||
1002 | if not prec.mutable(): |
|
1003 | if not prec.mutable(): | |
1003 | raise error.Abort(_("cannot obsolete public changeset: %s") |
|
1004 | raise error.Abort(_("cannot obsolete public changeset: %s") | |
1004 | % prec, |
|
1005 | % prec, | |
1005 | hint="see 'hg help phases' for details") |
|
1006 | hint="see 'hg help phases' for details") | |
1006 | nprec = prec.node() |
|
1007 | nprec = prec.node() | |
1007 | nsucs = tuple(s.node() for s in sucs) |
|
1008 | nsucs = tuple(s.node() for s in sucs) | |
1008 | npare = None |
|
1009 | npare = None | |
1009 | if not nsucs: |
|
1010 | if not nsucs: | |
1010 | npare = tuple(p.node() for p in prec.parents()) |
|
1011 | npare = tuple(p.node() for p in prec.parents()) | |
1011 | if nprec in nsucs: |
|
1012 | if nprec in nsucs: | |
1012 | raise error.Abort(_("changeset %s cannot obsolete itself") |
|
1013 | raise error.Abort(_("changeset %s cannot obsolete itself") | |
1013 | % prec) |
|
1014 | % prec) | |
1014 |
|
1015 | |||
1015 | # Effect flag can be different by relation |
|
1016 | # Effect flag can be different by relation | |
1016 | if saveeffectflag: |
|
1017 | if saveeffectflag: | |
1017 |
# The effect flag is saved in a versioned field name for |
|
1018 | # The effect flag is saved in a versioned field name for | |
1018 | # evolution |
|
1019 | # future evolution | |
1019 | effectflag = obsutil.geteffectflag(prec, sucs) |
|
1020 | effectflag = obsutil.geteffectflag(prec, sucs) | |
1020 | localmetadata[obsutil.EFFECTFLAGFIELD] = "%d" % effectflag |
|
1021 | localmetadata[obsutil.EFFECTFLAGFIELD] = "%d" % effectflag | |
1021 |
|
1022 | |||
1022 |
# Creating the marker causes the hidden cache to become |
|
1023 | # Creating the marker causes the hidden cache to become | |
1023 |
# which causes recomputation when we ask for |
|
1024 | # invalid, which causes recomputation when we ask for | |
1024 |
# Resulting in n^2 behavior. So let's |
|
1025 | # prec.parents() above. Resulting in n^2 behavior. So let's | |
1025 | # first, then create the markers. |
|
1026 | # prepare all of the args first, then create the markers. | |
1026 | markerargs.append((nprec, nsucs, npare, localmetadata)) |
|
1027 | markerargs.append((nprec, nsucs, npare, localmetadata)) | |
1027 |
|
1028 | |||
1028 | for args in markerargs: |
|
1029 | for args in markerargs: | |
1029 | nprec, nsucs, npare, localmetadata = args |
|
1030 | nprec, nsucs, npare, localmetadata = args |
General Comments 0
You need to be logged in to leave comments.
Login now