hgext/convert/p4.py
changeset 26587 56b2bcea2529
parent 25884 b810b59eca62
child 26779 aaa33ec3c951
equal deleted inserted replaced
26586:d51c658d3f04 26587:56b2bcea2529
     3 # Copyright 2009, Frank Kingswood <frank@kingswood-consulting.co.uk>
     3 # Copyright 2009, Frank Kingswood <frank@kingswood-consulting.co.uk>
     4 #
     4 #
     5 # This software may be used and distributed according to the terms of the
     5 # This software may be used and distributed according to the terms of the
     6 # GNU General Public License version 2 or any later version.
     6 # GNU General Public License version 2 or any later version.
     7 
     7 
     8 from mercurial import util
     8 from mercurial import util, error
     9 from mercurial.i18n import _
     9 from mercurial.i18n import _
    10 
    10 
    11 from common import commit, converter_source, checktool, NoRepo
    11 from common import commit, converter_source, checktool, NoRepo
    12 import marshal
    12 import marshal
    13 import re
    13 import re
    68             r"\$(Id|Header|Date|DateTime|Change|File|Revision|Author)"
    68             r"\$(Id|Header|Date|DateTime|Change|File|Revision|Author)"
    69             r":[^$\n]*\$")
    69             r":[^$\n]*\$")
    70         self.re_keywords_old = re.compile("\$(Id|Header):[^$\n]*\$")
    70         self.re_keywords_old = re.compile("\$(Id|Header):[^$\n]*\$")
    71 
    71 
    72         if revs and len(revs) > 1:
    72         if revs and len(revs) > 1:
    73             raise util.Abort(_("p4 source does not support specifying "
    73             raise error.Abort(_("p4 source does not support specifying "
    74                                "multiple revisions"))
    74                                "multiple revisions"))
    75         self._parse(ui, path)
    75         self._parse(ui, path)
    76 
    76 
    77     def _parse_view(self, path):
    77     def _parse_view(self, path):
    78         "Read changes affecting the path"
    78         "Read changes affecting the path"
   275 
   275 
   276         return contents, mode
   276         return contents, mode
   277 
   277 
   278     def getchanges(self, rev, full):
   278     def getchanges(self, rev, full):
   279         if full:
   279         if full:
   280             raise util.Abort(_("convert from p4 do not support --full"))
   280             raise error.Abort(_("convert from p4 do not support --full"))
   281         return self.files[rev], self.copies[rev], set()
   281         return self.files[rev], self.copies[rev], set()
   282 
   282 
   283     def getcommit(self, rev):
   283     def getcommit(self, rev):
   284         return self.changeset[rev]
   284         return self.changeset[rev]
   285 
   285