Commit 659c6267 authored by Eric S. Raymond's avatar Eric S. Raymond

Fix some bugs in source type assignment.

parent a92d463b
......@@ -2955,18 +2955,21 @@ class StreamParser:
if fields[1].endswith(b",v"):
# CVS revision
blob.cookie = (fields[1][:-2], fields[2])
self.repo.hint("cvs")
if self.repo.hint("cvs"):
announce("$Id$ header hints at CVS.")
else:
# Subversion revision
blob.cookie = fields[1]
self.repo.hint("svn")
if self.repo.hint("svn"):
announce("$Id$ header hints at svn.")
for m in re.finditer(r"\$Revision *: *([^$]*)\$",
blobcontent):
rev = m.group(0).strip()
if b'.' not in rev:
# Subversion revision
blob.cookie = rev
self.repo.hint("svn")
if self.repo.hint("svn"):
announce("$Revision$ header hints at svn.")
blob.set_content(blobcontent, blobstart)
else:
self.error(b"missing mark after blob")
......@@ -3018,6 +3021,7 @@ class StreamParser:
# Generated by cvs-fast-export
if name == "cvs-revisions":
self.repo.hint("cvs",strong=True)
announce("cvs_revisions property hints at CVS.")
for line in value.split(b'\n'):
if line:
self.repo.legacy_map["CVS:"+line] = commit
......@@ -4709,8 +4713,10 @@ class Repository:
if self.vcs and self.vcs != newvcs and self.stronghint and strong:
raise Recoverable("new hint %s conficts with old %s" \
% (newvcs.name, self.vs.name))
self.vcs = newvcs
if not self.stronghint:
self.vcs = newvcs
self.stronghint = self.stronghint or strong
return not self.stronghint
def size(self):
"Return the size of this import stream, for statistics display."
return sum(len(str(e)) for e in self.events)
......@@ -6006,12 +6012,12 @@ def read_repo(source, options, preferred):
raise Recoverable(b"couldn't find a repo under %s" % os.path.relpath(source))
elif hitcount > 1:
raise Recoverable(b"too many repos under %s" % os.path.relpath(source))
elif verbose > 0:
elif debug_enable(DEBUG_SHUFFLE):
announce(b"found %s repository" % getattr(vcs or extractor, b"name"))
repo = Repository()
repo.sourcedir = source
if vcs:
repo.vcs = vcs
repo.hint(vcs.name, strong=True)
repo.preserve_set = vcs.preserve
showprogress = (verbose > 0) and not "export-progress" in repo.export_style()
context = {b"basename": os.path.basename(repo.sourcedir)}
......@@ -6093,6 +6099,7 @@ def read_repo(source, options, preferred):
del stamp_set
# We found a matching custom extractor
if extractor:
repo.hint(extractor.name, strong=True)
streamer = RepoStreamer(extractor)
streamer.extract(repo, progress=verbose>0)
finally:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment