Use util.nouideprecwarn because _addpredecessors doesn't have easy access to
an ui object.
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
dsp |
hg-reviewers |
Use util.nouideprecwarn because _addpredecessors doesn't have easy access to
an ui object.
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/obsolete.py (19 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan | ||
Closed | lothiraldan |
for marker in markers: | for marker in markers: | ||||
yield encodeone(marker) | yield encodeone(marker) | ||||
@util.nogc | @util.nogc | ||||
def _addsuccessors(successors, markers): | def _addsuccessors(successors, markers): | ||||
for mark in markers: | for mark in markers: | ||||
successors.setdefault(mark[0], set()).add(mark) | successors.setdefault(mark[0], set()).add(mark) | ||||
def _addprecursors(*args, **kwargs): | |||||
msg = ("'obsolete._addprecursors' is deprecated, " | |||||
"use 'obsolete._addpredecessors'") | |||||
util.nouideprecwarn(msg, '4.4') | |||||
return _addpredecessors(*args, **kwargs) | |||||
@util.nogc | @util.nogc | ||||
def _addprecursors(precursors, markers): | def _addpredecessors(predecessors, markers): | ||||
for mark in markers: | for mark in markers: | ||||
for suc in mark[1]: | for suc in mark[1]: | ||||
precursors.setdefault(suc, set()).add(mark) | predecessors.setdefault(suc, set()).add(mark) | ||||
@util.nogc | @util.nogc | ||||
def _addchildren(children, markers): | def _addchildren(children, markers): | ||||
for mark in markers: | for mark in markers: | ||||
parents = mark[5] | parents = mark[5] | ||||
if parents is not None: | if parents is not None: | ||||
for p in parents: | for p in parents: | ||||
children.setdefault(p, set()).add(mark) | children.setdefault(p, set()).add(mark) | ||||
@propertycache | @propertycache | ||||
def successors(self): | def successors(self): | ||||
successors = {} | successors = {} | ||||
_addsuccessors(successors, self._all) | _addsuccessors(successors, self._all) | ||||
return successors | return successors | ||||
@propertycache | @propertycache | ||||
def precursors(self): | def precursors(self): | ||||
precursors = {} | predecessors = {} | ||||
_addprecursors(precursors, self._all) | _addpredecessors(predecessors, self._all) | ||||
return precursors | return predecessors | ||||
@propertycache | @propertycache | ||||
def children(self): | def children(self): | ||||
children = {} | children = {} | ||||
_addchildren(children, self._all) | _addchildren(children, self._all) | ||||
return children | return children | ||||
def _cached(self, attr): | def _cached(self, attr): | ||||
return attr in self.__dict__ | return attr in self.__dict__ | ||||
def _addmarkers(self, markers, rawdata): | def _addmarkers(self, markers, rawdata): | ||||
markers = list(markers) # to allow repeated iteration | markers = list(markers) # to allow repeated iteration | ||||
self._data = self._data + rawdata | self._data = self._data + rawdata | ||||
self._all.extend(markers) | self._all.extend(markers) | ||||
if self._cached('successors'): | if self._cached('successors'): | ||||
_addsuccessors(self.successors, markers) | _addsuccessors(self.successors, markers) | ||||
if self._cached('precursors'): | if self._cached('precursors'): | ||||
_addprecursors(self.precursors, markers) | _addpredecessors(self.precursors, markers) | ||||
if self._cached('children'): | if self._cached('children'): | ||||
_addchildren(self.children, markers) | _addchildren(self.children, markers) | ||||
_checkinvalidmarkers(markers) | _checkinvalidmarkers(markers) | ||||
def relevantmarkers(self, nodes): | def relevantmarkers(self, nodes): | ||||
"""return a set of all obsolescence markers relevant to a set of nodes. | """return a set of all obsolescence markers relevant to a set of nodes. | ||||
"relevant" to a set of nodes mean: | "relevant" to a set of nodes mean: |