# HG changeset patch # User Boris Feld # Date 2017-07-03 01:13:17 # Node ID dba493981284b00cb434e7878fa4ca3ce568cfa8 # Parent 84f72072bde618a976488ed0197004b60d7339a3 obsolete: add an explicit '_succs.copy()' method Mimic the standard API for copying in the _succs class, it makes the code slightly cleaner and will be needed later for copying markers at the same time than copying the list content. diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py --- a/mercurial/obsutil.py +++ b/mercurial/obsutil.py @@ -330,6 +330,9 @@ def getobsoleted(repo, tr): class _succs(list): """small class to represent a successors with some metadata about it""" + def copy(self): + return _succs(self) + def successorssets(repo, initialnode, closest=False, cache=None): """Return set of all latest successors of initial nodes @@ -530,7 +533,7 @@ def successorssets(repo, initialnode, cl productresult = [] for prefix in markss: for suffix in cache[suc]: - newss = _succs(prefix) + newss = prefix.copy() for part in suffix: # do not duplicated entry in successors set # first entry wins.