hgext/convert/filemap.py
branchstable
changeset 13968 82845434e974
parent 11680 7fefef3ce791
child 15107 2433525a9e1e
equal deleted inserted replaced
13963:3c753f9a2fbc 13968:82845434e974
   207         c = self.commits[rev] = self.base.getcommit(rev)
   207         c = self.commits[rev] = self.base.getcommit(rev)
   208         for p in c.parents:
   208         for p in c.parents:
   209             self.children[p] = self.children.get(p, 0) + 1
   209             self.children[p] = self.children.get(p, 0) + 1
   210         return c
   210         return c
   211 
   211 
       
   212     def _cachedcommit(self, rev):
       
   213         if rev in self.commits:
       
   214             return self.commits[rev]
       
   215         return self.base.getcommit(rev)
       
   216 
   212     def _discard(self, *revs):
   217     def _discard(self, *revs):
   213         for r in revs:
   218         for r in revs:
   214             if r is None:
   219             if r is None:
   215                 continue
   220                 continue
   216             self.seenchildren[r] = self.seenchildren.get(r, 0) + 1
   221             self.seenchildren[r] = self.seenchildren.get(r, 0) + 1
   306         if wp is None and parents:
   311         if wp is None and parents:
   307             wp = 0
   312             wp = 0
   308 
   313 
   309         self.origparents[rev] = parents
   314         self.origparents[rev] = parents
   310 
   315 
   311         closed = 'close' in self.commits[rev].extra
   316         closed = False
       
   317         if 'close' in self.commits[rev].extra:
       
   318             # A branch closing revision is only useful if one of its
       
   319             # parents belong to the branch being closed
       
   320             branch = self.commits[rev].branch
       
   321             pbranches = [self._cachedcommit(p).branch for p in mparents]
       
   322             if branch in pbranches:
       
   323                 closed = True
   312 
   324 
   313         if len(mparents) < 2 and not closed and not self.wanted(rev, wp):
   325         if len(mparents) < 2 and not closed and not self.wanted(rev, wp):
   314             # We don't want this revision.
   326             # We don't want this revision.
   315             # Update our state and tell the convert process to map this
   327             # Update our state and tell the convert process to map this
   316             # revision to the same revision its parent as mapped to.
   328             # revision to the same revision its parent as mapped to.