Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/obsutil.py @ 33928: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 |
comparison
equal
deleted
inserted
replaced
33927:84f72072bde6 | 33928:dba493981284 |
---|---|
327 obsoleted.add(rev) | 327 obsoleted.add(rev) |
328 return obsoleted | 328 return obsoleted |
329 | 329 |
330 class _succs(list): | 330 class _succs(list): |
331 """small class to represent a successors with some metadata about it""" | 331 """small class to represent a successors with some metadata about it""" |
332 | |
333 def copy(self): | |
334 return _succs(self) | |
332 | 335 |
333 def successorssets(repo, initialnode, closest=False, cache=None): | 336 def successorssets(repo, initialnode, closest=False, cache=None): |
334 """Return set of all latest successors of initial nodes | 337 """Return set of all latest successors of initial nodes |
335 | 338 |
336 The successors set of a changeset A are the group of revisions that succeed | 339 The successors set of a changeset A are the group of revisions that succeed |
528 for suc in mark[1]: | 531 for suc in mark[1]: |
529 # cardinal product with previous successors | 532 # cardinal product with previous successors |
530 productresult = [] | 533 productresult = [] |
531 for prefix in markss: | 534 for prefix in markss: |
532 for suffix in cache[suc]: | 535 for suffix in cache[suc]: |
533 newss = _succs(prefix) | 536 newss = prefix.copy() |
534 for part in suffix: | 537 for part in suffix: |
535 # do not duplicated entry in successors set | 538 # do not duplicated entry in successors set |
536 # first entry wins. | 539 # first entry wins. |
537 if part not in newss: | 540 if part not in newss: |
538 newss.append(part) | 541 newss.append(part) |