hgext/convert/hg.py
changeset 26154 242853e14804
parent 26078 5ca587348875
child 26587 56b2bcea2529
equal deleted inserted replaced
26153:8aa6fb6de161 26154:242853e14804
   429         return rev in self.repo
   429         return rev in self.repo
   430 
   430 
   431 class mercurial_source(converter_source):
   431 class mercurial_source(converter_source):
   432     def __init__(self, ui, path, revs=None):
   432     def __init__(self, ui, path, revs=None):
   433         converter_source.__init__(self, ui, path, revs)
   433         converter_source.__init__(self, ui, path, revs)
   434         if revs and len(revs) > 1:
       
   435             raise util.Abort(_("mercurial source does not support specifying "
       
   436                                "multiple revisions"))
       
   437         self.ignoreerrors = ui.configbool('convert', 'hg.ignoreerrors', False)
   434         self.ignoreerrors = ui.configbool('convert', 'hg.ignoreerrors', False)
   438         self.ignored = set()
   435         self.ignored = set()
   439         self.saverev = ui.configbool('convert', 'hg.saverev', False)
   436         self.saverev = ui.configbool('convert', 'hg.saverev', False)
   440         try:
   437         try:
   441             self.repo = hg.repository(self.ui, path)
   438             self.repo = hg.repository(self.ui, path)
   466                     children[self.repo.changelog.node(r)] = 1
   463                     children[self.repo.changelog.node(r)] = 1
   467                 self.keep = children.__contains__
   464                 self.keep = children.__contains__
   468             else:
   465             else:
   469                 self.keep = util.always
   466                 self.keep = util.always
   470             if revs:
   467             if revs:
   471                 self._heads = [self.repo[revs[0]].node()]
   468                 self._heads = [self.repo[r].node() for r in revs]
   472             else:
   469             else:
   473                 self._heads = self.repo.heads()
   470                 self._heads = self.repo.heads()
   474         else:
   471         else:
   475             if revs or startnode is not None:
   472             if revs or startnode is not None:
   476                 raise util.Abort(_('hg.revs cannot be combined with '
   473                 raise util.Abort(_('hg.revs cannot be combined with '