hgext/convert/p4.py
changeset 7973 db3a68fd9387
parent 7905 d596b1f2935a
child 8066 aece3c9e62f1
equal deleted inserted replaced
7972:425a30ddfff6 7973:db3a68fd9387
     8 #
     8 #
     9 
     9 
    10 from mercurial import util
    10 from mercurial import util
    11 from mercurial.i18n import _
    11 from mercurial.i18n import _
    12 
    12 
    13 from common import commit, converter_source, checktool
    13 from common import commit, converter_source, checktool, NoRepo
    14 import marshal
    14 import marshal
    15 
    15 
    16 def loaditer(f):
    16 def loaditer(f):
    17     "Yield the dictionary objects generated by p4"
    17     "Yield the dictionary objects generated by p4"
    18     try:
    18     try:
    25         pass
    25         pass
    26 
    26 
    27 class p4_source(converter_source):
    27 class p4_source(converter_source):
    28     def __init__(self, ui, path, rev=None):
    28     def __init__(self, ui, path, rev=None):
    29         super(p4_source, self).__init__(ui, path, rev=rev)
    29         super(p4_source, self).__init__(ui, path, rev=rev)
       
    30 
       
    31         if not path.startswith('//'):
       
    32             raise NoRepo('%s does not look like a P4 repo' % path)
    30 
    33 
    31         checktool('p4', abort=False)
    34         checktool('p4', abort=False)
    32 
    35 
    33         self.p4changes = {}
    36         self.p4changes = {}
    34         self.heads = {}
    37         self.heads = {}