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])
if self.repo.hint("cvs"):
announce("$Id$ header hints at CVS.")
# Subversion revision
blob.cookie = fields[1]
if self.repo.hint("svn"):
announce("$Id$ header hints at svn.")
for m in re.finditer(r"\$Revision *: *([^$]*)\$",
rev =
if b'.' not in rev:
# Subversion revision
blob.cookie = rev
if self.repo.hint("svn"):
announce("$Revision$ header hints at svn.")
blob.set_content(blobcontent, blobstart)
self.error(b"missing mark after blob")
......@@ -3018,6 +3021,7 @@ class StreamParser:
# Generated by cvs-fast-export
if name == "cvs-revisions":
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" \
% (,
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
......@@ -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(, 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(, strong=True)
streamer = RepoStreamer(extractor)
streamer.extract(repo, progress=verbose>0)
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