Changeset View
Changeset View
Standalone View
Standalone View
hgext3rd/p4fastimport/importer.py
Show First 20 Lines • Show All 343 Lines • ▼ Show 20 Line(s) | def create(self, tr, copy_tracer=None): | ||||
text, src = flat.content(c.origcl), 'gzip' | text, src = flat.content(c.origcl), 'gzip' | ||||
elif c.cl in p4fi.revisions: | elif c.cl in p4fi.revisions: | ||||
text, src = p4fi.content(c.cl), 'p4' | text, src = p4fi.content(c.cl), 'p4' | ||||
if text is None: | if text is None: | ||||
raise error.Abort('error generating file content %d %s' % ( | raise error.Abort('error generating file content %d %s' % ( | ||||
c.cl, self.relpath)) | c.cl, self.relpath)) | ||||
meta = {} | meta = {} | ||||
fileflags[c.cl] = '' | |||||
if self._p4filelog.isexec(c.cl): | if self._p4filelog.isexec(c.cl): | ||||
fileflags[c.cl] = 'x' | fileflags[c.cl] = 'x' | ||||
if self._p4filelog.issymlink(c.cl): | if self._p4filelog.issymlink(c.cl): | ||||
# On Linux/Unix a symlink must not have a newline. Perforce | # On Linux/Unix a symlink must not have a newline. Perforce | ||||
# however returns a newline at the end which we must strip. | # however returns a newline at the end which we must strip. | ||||
text = text.rstrip() | text = text.rstrip() | ||||
fileflags[c.cl] = 'l' | fileflags[c.cl] = 'l' | ||||
if self._p4filelog.iskeyworded(c.cl): | if self._p4filelog.iskeyworded(c.cl): | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | def create(self, tr): | ||||
text = None | text = None | ||||
# Only read files from p4 for a blob commit | # Only read files from p4 for a blob commit | ||||
text, src = p4fi.content(c.cl), 'p4' | text, src = p4fi.content(c.cl), 'p4' | ||||
if text is None: | if text is None: | ||||
raise error.Abort('error generating file content %d %s' % ( | raise error.Abort('error generating file content %d %s' % ( | ||||
c.cl, self.relpath)) | c.cl, self.relpath)) | ||||
meta = {} | meta = {} | ||||
fileflags[c.cl] = ' ' | |||||
if self._p4filelog.isexec(c.cl): | if self._p4filelog.isexec(c.cl): | ||||
fileflags[c.cl] = 'x' | fileflags[c.cl] = 'x' | ||||
if self._p4filelog.issymlink(c.cl): | if self._p4filelog.issymlink(c.cl): | ||||
fileflags[c.cl] = 'l' | fileflags[c.cl] = 'l' | ||||
if self._p4filelog.iskeyworded(c.cl): | if self._p4filelog.iskeyworded(c.cl): | ||||
text = re.sub(KEYWORD_REGEX, r'$\1$', text) | text = re.sub(KEYWORD_REGEX, r'$\1$', text) | ||||
node = hgfilelog.add(text, meta, tr, linkrev, fparent1, fparent2) | node = hgfilelog.add(text, meta, tr, linkrev, fparent1, fparent2) | ||||
Show All 14 Lines |