changeset 33910:dba493981284

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.
author Boris Feld <boris.feld@octobus.net>
date Mon, 03 Jul 2017 03:13:17 +0200
parents 84f72072bde6
children 34e10e09afa5
files mercurial/obsutil.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/obsutil.py	Mon Jul 03 00:53:55 2017 +0200
+++ b/mercurial/obsutil.py	Mon Jul 03 03:13:17 2017 +0200
@@ -330,6 +330,9 @@
 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 @@
                         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.