equal
deleted
inserted
replaced
298 |
298 |
299 def addobsolete(self, sub, obj): |
299 def addobsolete(self, sub, obj): |
300 """Add a relation marking that node <sub> is a new version of <obj>""" |
300 """Add a relation marking that node <sub> is a new version of <obj>""" |
301 if sub == nullid: |
301 if sub == nullid: |
302 sub = None |
302 sub = None |
|
303 if obj in self._obssubrels.get(sub, set()): |
|
304 return 0 |
303 self._obssubrels.setdefault(sub, set()).add(obj) |
305 self._obssubrels.setdefault(sub, set()).add(obj) |
304 self._obsobjrels.setdefault(obj, set()).add(sub) |
306 self._obsobjrels.setdefault(obj, set()).add(sub) |
305 try: |
307 try: |
306 if self[obj].phase() == 0: |
308 if self[obj].phase() == 0: |
307 if sub is None: |
309 if sub is None: |
320 del self._obsobjrels |
322 del self._obsobjrels |
321 if '_obssubrels' in vars(self): |
323 if '_obssubrels' in vars(self): |
322 del self._obssubrels |
324 del self._obssubrels |
323 if '_obsoleteset' in vars(self): |
325 if '_obsoleteset' in vars(self): |
324 del self._obsoleteset |
326 del self._obsoleteset |
|
327 return 1 |
325 |
328 |
326 ### obsolete storage |
329 ### obsolete storage |
327 @util.propertycache |
330 @util.propertycache |
328 def _obsobjrels(self): |
331 def _obsobjrels(self): |
329 """{<old-node> -> set(<new-node>)} |
332 """{<old-node> -> set(<new-node>)} |