From e2e9e4e1864a09390d0fcd49e3dffb4a994e5717 Mon Sep 17 00:00:00 2001 From: mhagger Date: Mon, 19 Jul 2010 13:53:02 +0000 Subject: [PATCH] Use the logger instance rather than the Log class. git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5238 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- contrib/cvs2svn_memlog | 4 +- cvs2bzr-example.options | 12 ++-- cvs2git-example.options | 12 ++-- cvs2hg-example.options | 12 ++-- cvs2svn-example.options | 12 ++-- cvs2svn_lib/artifact.py | 4 +- cvs2svn_lib/artifact_manager.py | 4 +- cvs2svn_lib/changeset_graph.py | 10 ++-- cvs2svn_lib/check_dependencies_pass.py | 6 +- cvs2svn_lib/checkout_internal.py | 8 +-- cvs2svn_lib/collect_data.py | 37 ++++++------ cvs2svn_lib/common.py | 10 ++-- cvs2svn_lib/cvs_file_items.py | 14 ++--- cvs2svn_lib/database.py | 6 +- cvs2svn_lib/dvcs_common.py | 4 +- cvs2svn_lib/external_blob_generator.py | 8 +-- cvs2svn_lib/git_output_option.py | 10 ++-- cvs2svn_lib/pass_manager.py | 16 ++--- cvs2svn_lib/passes.py | 106 ++++++++++++++++----------------- cvs2svn_lib/property_setters.py | 26 ++++---- cvs2svn_lib/record_table.py | 4 +- cvs2svn_lib/repository_mirror.py | 4 +- cvs2svn_lib/repository_walker.py | 10 ++-- cvs2svn_lib/run_options.py | 14 ++--- cvs2svn_lib/stdout_delegate.py | 26 ++++---- cvs2svn_lib/svn_commit_creator.py | 14 ++--- cvs2svn_lib/svn_output_option.py | 20 +++---- cvs2svn_lib/svn_run_options.py | 8 +-- cvs2svn_lib/symbol_statistics.py | 16 ++--- cvs2svn_lib/symbol_strategy.py | 38 ++++++------ cvs2svn_lib/symbol_transform.py | 6 +- 31 files changed, 240 insertions(+), 241 deletions(-) diff --git a/contrib/cvs2svn_memlog b/contrib/cvs2svn_memlog index 76f6720b..c1407f7d 100755 --- a/contrib/cvs2svn_memlog +++ b/contrib/cvs2svn_memlog @@ -43,7 +43,7 @@ import optparse import threading from cvs2svn_lib.common import FatalException -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.main import main @@ -82,7 +82,7 @@ class MemoryLogger(threading.Thread): delay = self.start_time + self.interval * i - time.time() if delay > 0: time.sleep(delay) - Log().write('Memory used: %s' % (get_memory_used(),)) + logger.write('Memory used: %s' % (get_memory_used(),)) i += 1 diff --git a/cvs2bzr-example.options b/cvs2bzr-example.options index 274b1ea3..4d307018 100644 --- a/cvs2bzr-example.options +++ b/cvs2bzr-example.options @@ -77,7 +77,7 @@ import os from cvs2svn_lib import config from cvs2svn_lib import changeset_database from cvs2svn_lib.common import CVSTextDecoder -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.project import Project from cvs2svn_lib.git_output_option import GitRevisionInlineWriter from cvs2svn_lib.bzr_output_option import BzrOutputOption @@ -115,11 +115,11 @@ from cvs2svn_lib.property_setters import SVNBinaryFileKeywordsPropertySetter # To choose the level of logging output, uncomment one of the # following lines: -#Log().log_level = Log.WARN -#Log().log_level = Log.QUIET -Log().log_level = Log.NORMAL -#Log().log_level = Log.VERBOSE -#Log().log_level = Log.DEBUG +#logger.log_level = logger.WARN +#logger.log_level = logger.QUIET +logger.log_level = logger.NORMAL +#logger.log_level = logger.VERBOSE +#logger.log_level = logger.DEBUG # The directory to use for temporary files: diff --git a/cvs2git-example.options b/cvs2git-example.options index b545c263..edbf5c2c 100644 --- a/cvs2git-example.options +++ b/cvs2git-example.options @@ -77,7 +77,7 @@ import os from cvs2svn_lib import config from cvs2svn_lib import changeset_database from cvs2svn_lib.common import CVSTextDecoder -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.project import Project from cvs2svn_lib.git_revision_collector import GitRevisionCollector from cvs2svn_lib.external_blob_generator import ExternalBlobGenerator @@ -115,11 +115,11 @@ from cvs2svn_lib.property_setters import SVNBinaryFileKeywordsPropertySetter # To choose the level of logging output, uncomment one of the # following lines: -#Log().log_level = Log.WARN -#Log().log_level = Log.QUIET -Log().log_level = Log.NORMAL -#Log().log_level = Log.VERBOSE -#Log().log_level = Log.DEBUG +#logger.log_level = logger.WARN +#logger.log_level = logger.QUIET +logger.log_level = logger.NORMAL +#logger.log_level = logger.VERBOSE +#logger.log_level = logger.DEBUG # The directory to use for temporary files: diff --git a/cvs2hg-example.options b/cvs2hg-example.options index cf0cc73d..3bcc8dd1 100644 --- a/cvs2hg-example.options +++ b/cvs2hg-example.options @@ -83,7 +83,7 @@ import os from cvs2svn_lib import config from cvs2svn_lib import changeset_database from cvs2svn_lib.common import CVSTextDecoder -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.project import Project from cvs2svn_lib.git_output_option import GitRevisionInlineWriter from cvs2svn_lib.git_output_option import GitOutputOption @@ -121,11 +121,11 @@ from cvs2svn_lib.property_setters import SVNBinaryFileKeywordsPropertySetter # To choose the level of logging output, uncomment one of the # following lines: -#Log().log_level = Log.WARN -#Log().log_level = Log.QUIET -Log().log_level = Log.NORMAL -#Log().log_level = Log.VERBOSE -#Log().log_level = Log.DEBUG +#logger.log_level = logger.WARN +#logger.log_level = logger.QUIET +logger.log_level = logger.NORMAL +#logger.log_level = logger.VERBOSE +#logger.log_level = logger.DEBUG # The directory to use for temporary files: diff --git a/cvs2svn-example.options b/cvs2svn-example.options index 5fbcbba5..dd4cf262 100644 --- a/cvs2svn-example.options +++ b/cvs2svn-example.options @@ -64,7 +64,7 @@ import re from cvs2svn_lib import config from cvs2svn_lib import changeset_database from cvs2svn_lib.common import CVSTextDecoder -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.project import Project from cvs2svn_lib.svn_output_option import DumpfileOutputOption from cvs2svn_lib.svn_output_option import ExistingRepositoryOutputOption @@ -106,11 +106,11 @@ from cvs2svn_lib.property_setters import SVNBinaryFileKeywordsPropertySetter # To choose the level of logging output, uncomment one of the # following lines: -#Log().log_level = Log.WARN -#Log().log_level = Log.QUIET -Log().log_level = Log.NORMAL -#Log().log_level = Log.VERBOSE -#Log().log_level = Log.DEBUG +#logger.log_level = logger.WARN +#logger.log_level = logger.QUIET +logger.log_level = logger.NORMAL +#logger.log_level = logger.VERBOSE +#logger.log_level = logger.DEBUG # The directory to use for temporary files: diff --git a/cvs2svn_lib/artifact.py b/cvs2svn_lib/artifact.py index 99d69456..27a351a4 100644 --- a/cvs2svn_lib/artifact.py +++ b/cvs2svn_lib/artifact.py @@ -20,7 +20,7 @@ import os from cvs2svn_lib.context import Ctx -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger class Artifact(object): @@ -50,7 +50,7 @@ class TempFile(Artifact): filename = property(_get_filename) def cleanup(self): - Log().verbose("Deleting", self.filename) + logger.verbose("Deleting", self.filename) os.unlink(self.filename) def __str__(self): diff --git a/cvs2svn_lib/artifact_manager.py b/cvs2svn_lib/artifact_manager.py index 08f0ec7b..310baf2f 100644 --- a/cvs2svn_lib/artifact_manager.py +++ b/cvs2svn_lib/artifact_manager.py @@ -17,7 +17,7 @@ """This module manages the artifacts produced by conversion passes.""" -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.artifact import TempFile @@ -245,7 +245,7 @@ class ArtifactManager: if artifact._passes_needed] if unclean_artifacts: - Log().warn( + logger.warn( 'INTERNAL: The following artifacts were not cleaned up:\n %s\n' % ('\n '.join(unclean_artifacts))) diff --git a/cvs2svn_lib/changeset_graph.py b/cvs2svn_lib/changeset_graph.py index 30b2d052..0bf2196a 100644 --- a/cvs2svn_lib/changeset_graph.py +++ b/cvs2svn_lib/changeset_graph.py @@ -19,7 +19,7 @@ import heapq -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.changeset import RevisionChangeset from cvs2svn_lib.changeset import OrderedChangeset from cvs2svn_lib.changeset import BranchChangeset @@ -131,8 +131,8 @@ class ChangesetGraph(object): def add_new_changeset(self, changeset): """Add the new CHANGESET to the graph and also to the databases.""" - if Log().is_on(Log.DEBUG): - Log().debug('Adding changeset %r' % (changeset,)) + if logger.is_on(logger.DEBUG): + logger.debug('Adding changeset %r' % (changeset,)) self.add_changeset(changeset) self.store_changeset(changeset) @@ -145,8 +145,8 @@ class ChangesetGraph(object): in CHANGESET are always added again as part of a new CHANGESET, which will cause the old values to be overwritten.""" - if Log().is_on(Log.DEBUG): - Log().debug('Removing changeset %r' % (changeset,)) + if logger.is_on(logger.DEBUG): + logger.debug('Removing changeset %r' % (changeset,)) del self[changeset.id] del self._changeset_db[changeset.id] diff --git a/cvs2svn_lib/check_dependencies_pass.py b/cvs2svn_lib/check_dependencies_pass.py index 4d14dd41..a739d2d5 100644 --- a/cvs2svn_lib/check_dependencies_pass.py +++ b/cvs2svn_lib/check_dependencies_pass.py @@ -21,7 +21,7 @@ from cvs2svn_lib import config from cvs2svn_lib.context import Ctx from cvs2svn_lib.common import FatalException from cvs2svn_lib.common import DB_OPEN_READ -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.pass_manager import Pass from cvs2svn_lib.project import read_projects from cvs2svn_lib.artifact_manager import artifact_manager @@ -56,7 +56,7 @@ class CheckDependenciesPass(Pass): self.symbol_db = SymbolDatabase() Ctx()._symbol_db = self.symbol_db - Log().quiet("Checking dependency consistency...") + logger.quiet("Checking dependency consistency...") fatal_errors = [] for cvs_item in self.iter_cvs_items(): @@ -84,7 +84,7 @@ class CheckDependenciesPass(Pass): self.symbol_db.close() self.symbol_db = None Ctx()._cvs_path_db.close() - Log().quiet("Done") + logger.quiet("Done") class CheckItemStoreDependenciesPass(CheckDependenciesPass): diff --git a/cvs2svn_lib/checkout_internal.py b/cvs2svn_lib/checkout_internal.py index 5698748e..93ef3d50 100644 --- a/cvs2svn_lib/checkout_internal.py +++ b/cvs2svn_lib/checkout_internal.py @@ -88,7 +88,7 @@ from cvs2svn_lib.common import InternalError from cvs2svn_lib.common import canonicalize_eol from cvs2svn_lib.common import is_trunk_revision from cvs2svn_lib.context import Ctx -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.artifact_manager import artifact_manager from cvs2svn_lib.cvs_item import CVSRevisionModification from cvs2svn_lib.database import Database @@ -433,11 +433,11 @@ class TextRecordDatabase: """If any TextRecords still exist, log them.""" if self.text_records: - Log().warn( + logger.warn( "%s: internal problem: leftover revisions in the checkout cache:" % warning_prefix) for text_record in self.itervalues(): - Log().warn(' %s' % (text_record,)) + logger.warn(' %s' % (text_record,)) def __repr__(self): """Debugging output of the current contents of the TextRecordDatabase.""" @@ -521,7 +521,7 @@ class _Sink(cvs2svn_rcsparse.Sink): try: text = self._rcs_stream.invert_diff(text) except MalformedDeltaException, e: - Log().error( + logger.error( 'Malformed RCS delta in %s, revision %s: %s' % (self.cvs_file_items.cvs_file.filename, revision, e) ) diff --git a/cvs2svn_lib/collect_data.py b/cvs2svn_lib/collect_data.py index 02593359..a1269f45 100644 --- a/cvs2svn_lib/collect_data.py +++ b/cvs2svn_lib/collect_data.py @@ -55,7 +55,7 @@ from cvs2svn_lib.common import warning_prefix from cvs2svn_lib.common import error_prefix from cvs2svn_lib.common import is_trunk_revision from cvs2svn_lib.common import is_branch_revision_number -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.context import Ctx from cvs2svn_lib.artifact_manager import artifact_manager from cvs2svn_lib.cvs_path import CVSPath @@ -266,7 +266,7 @@ class _SymbolDataCollector(object): branch_data = self.branches_data.get(branch_number) if branch_data is not None: - Log().warn( + logger.warn( "%s: in '%s':\n" " branch '%s' already has name '%s',\n" " cannot also have name '%s', ignoring the latter\n" @@ -350,14 +350,14 @@ class _SymbolDataCollector(object): if name is None: # Ignore symbol: self.pdc.log_symbol_transform(old_name, None) - Log().verbose( + logger.verbose( " symbol '%s'=%s ignored in %s" % (old_name, revision, self.cvs_file.filename,) ) else: if name != old_name: self.pdc.log_symbol_transform(old_name, name) - Log().verbose( + logger.verbose( " symbol '%s'=%s transformed to '%s' in %s" % (old_name, revision, name, self.cvs_file.filename,) ) @@ -379,7 +379,7 @@ class _SymbolDataCollector(object): # The revision number is valid; record it for later processing: self._symbol_defs.append( (name, revision) ) else: - Log().warn( + logger.warn( 'In %r:\n' ' branch %r references invalid revision %s\n' ' and will be ignored.' @@ -409,7 +409,7 @@ class _SymbolDataCollector(object): dup_indexes = set() for ((name, revision), indexes) in known_definitions.iteritems(): if len(indexes) > 1: - Log().verbose( + logger.verbose( "in %r:\n" " symbol %s:%s defined multiple times; ignoring duplicates\n" % (self.cvs_file.filename, name, revision,) @@ -611,7 +611,7 @@ class _FileDataCollector(cvs2svn_rcsparse.Sink): if revision in self._rev_data: # This revision has already been seen. - Log().error('File %r contains duplicate definitions of revision %s.' + logger.error('File %r contains duplicate definitions of revision %s.' % (self.cvs_file.filename, revision,)) raise RuntimeError @@ -685,7 +685,7 @@ class _FileDataCollector(cvs2svn_rcsparse.Sink): try: parent_data = self._rev_data[branch_data.parent] except KeyError: - Log().warn( + logger.warn( 'In %r:\n' ' branch %r references non-existing revision %s\n' ' and will be ignored.' @@ -726,7 +726,7 @@ class _FileDataCollector(cvs2svn_rcsparse.Sink): try: parent_data = self._rev_data[rev] except KeyError: - Log().warn( + logger.warn( 'In %r:\n' ' the following tag(s) reference non-existing revision %s\n' ' and will be ignored:\n' @@ -787,7 +787,7 @@ class _FileDataCollector(cvs2svn_rcsparse.Sink): # that's what we will do. (For the record: "cvs log" fails on # such a file; "rlog" prints the log message from the first # block and ignores the second one.) - Log().warn( + logger.warn( "%s: in '%s':\n" " Deltatext block for revision %s appeared twice;\n" " ignoring the second occurrence.\n" @@ -1001,22 +1001,21 @@ class _ProjectDataCollector: self.symbol_transform_counts[old_name, new_name] = 1 def summarize_symbol_transforms(self): - if self.symbol_transform_counts and Log().is_on(Log.NORMAL): - log = Log() - log.normal('Summary of symbol transforms:') + if self.symbol_transform_counts and logger.is_on(logger.NORMAL): + logger.normal('Summary of symbol transforms:') transforms = self.symbol_transform_counts.items() transforms.sort() for ((old_name, new_name), count) in transforms: if new_name is None: - log.normal(' "%s" ignored in %d files' % (old_name, count,)) + logger.normal(' "%s" ignored in %d files' % (old_name, count,)) else: - log.normal( + logger.normal( ' "%s" transformed to "%s" in %d files' % (old_name, new_name, count,) ) def process_file(self, cvs_file): - Log().normal(cvs_file.filename) + logger.normal(cvs_file.filename) fdc = _FileDataCollector(self, cvs_file) try: cvs2svn_rcsparse.parse(open(cvs_file.filename, 'rb'), fdc) @@ -1028,7 +1027,7 @@ class _ProjectDataCollector: # with other files: return except: - Log().warn("Exception occurred while parsing %s" % cvs_file.filename) + logger.warn("Exception occurred while parsing %s" % cvs_file.filename) raise else: self.num_files += 1 @@ -1075,7 +1074,7 @@ class CollectData: output again in a summary at the end of CollectRevsPass.""" err = '%s: %s' % (error_prefix, err,) - Log().error(err + '\n') + logger.error(err + '\n') self.fatal_errors.append(err) def add_cvs_directory(self, cvs_directory): @@ -1149,7 +1148,7 @@ class CollectData: pdc.summarize_symbol_transforms() self.num_files += pdc.num_files - Log().verbose('Processed', self.num_files, 'files') + logger.verbose('Processed', self.num_files, 'files') def _register_empty_subdirectories(self): """Set the CVSDirectory.empty_subdirectory_id members.""" diff --git a/cvs2svn_lib/common.py b/cvs2svn_lib/common.py index d60b2b4c..d7948929 100644 --- a/cvs2svn_lib/common.py +++ b/cvs2svn_lib/common.py @@ -21,7 +21,7 @@ import re import time import codecs -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger # Always use these constants for opening databases. @@ -375,7 +375,7 @@ class CVSTextDecoder: try: return decoder(s)[0] except ValueError: - Log().verbose("Encoding '%s' failed for string %r" % (name, s)) + logger.verbose("Encoding '%s' failed for string %r" % (name, s)) if self.fallback_decoder is not None: (name, decoder) = self.fallback_decoder @@ -417,15 +417,15 @@ class Timestamper: # changesets with even earlier timestamps depend on this one. self.timestamp = self.timestamp + 1.0 if not change_expected: - Log().warn( + logger.warn( 'Timestamp "%s" is in the future; changed to "%s".' % (time.asctime(time.gmtime(timestamp)), time.asctime(time.gmtime(self.timestamp)),) ) elif timestamp < self.timestamp + 1.0: self.timestamp = self.timestamp + 1.0 - if not change_expected and Log().is_on(Log.VERBOSE): - Log().verbose( + if not change_expected and logger.is_on(logger.VERBOSE): + logger.verbose( 'Timestamp "%s" adjusted to "%s" to ensure monotonicity.' % (time.asctime(time.gmtime(timestamp)), time.asctime(time.gmtime(self.timestamp)),) diff --git a/cvs2svn_lib/cvs_file_items.py b/cvs2svn_lib/cvs_file_items.py index fafa46c9..c7502e63 100644 --- a/cvs2svn_lib/cvs_file_items.py +++ b/cvs2svn_lib/cvs_file_items.py @@ -22,7 +22,7 @@ import re from cvs2svn_lib.common import InternalError from cvs2svn_lib.common import FatalError from cvs2svn_lib.context import Ctx -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.symbol import Trunk from cvs2svn_lib.symbol import Branch from cvs2svn_lib.symbol import Tag @@ -181,7 +181,7 @@ class CVSFileItems(object): try: cvs_item.check_links(self) except AssertionError: - Log().error( + logger.error( 'Link consistency error in %s\n' 'This is probably a bug internal to cvs2svn. Please file a bug\n' 'report including the following stack trace (see FAQ for more ' @@ -565,7 +565,7 @@ class CVSFileItems(object): cvs_branch = vendor_lod_items.cvs_branch rev_1_1 = self[cvs_branch.source_id] assert isinstance(rev_1_1, CVSRevision) - Log().debug('Removing unnecessary revision %s' % (rev_1_1,)) + logger.debug('Removing unnecessary revision %s' % (rev_1_1,)) # Delete the 1.1.1 CVSBranch and sever the vendor branch from trunk: self._sever_branch(vendor_lod_items) @@ -635,7 +635,7 @@ class CVSFileItems(object): for id in self.root_ids: cvs_item = self[id] if self._is_unneeded_initial_trunk_delete(cvs_item, metadata_db): - Log().debug('Removing unnecessary delete %s' % (cvs_item,)) + logger.debug('Removing unnecessary delete %s' % (cvs_item,)) # Sever any CVSBranches rooted at cvs_item. for cvs_branch_id in cvs_item.branch_ids[:]: @@ -697,7 +697,7 @@ class CVSFileItems(object): for lod_items in self.iter_lods(): if self._is_unneeded_initial_branch_delete(lod_items, metadata_db): cvs_revision = lod_items.cvs_revisions[0] - Log().debug( + logger.debug( 'Removing unnecessary initial branch delete %s' % (cvs_revision,) ) @@ -968,7 +968,7 @@ class CVSFileItems(object): parent = self[branch_id] assert isinstance(parent, CVSBranch) - Log().debug('Grafting %s from %s (on %s) onto %s' % ( + logger.debug('Grafting %s from %s (on %s) onto %s' % ( cvs_tag, source, source.lod, parent,)) # Switch parent: source.tag_ids.remove(cvs_tag.id) @@ -1017,7 +1017,7 @@ class CVSFileItems(object): parent = possible_parent assert isinstance(parent, CVSBranch) - Log().debug('Grafting %s from %s (on %s) onto %s' % ( + logger.debug('Grafting %s from %s (on %s) onto %s' % ( cvs_branch, source, source.lod, parent,)) # Switch parent: source.branch_ids.remove(cvs_branch.id) diff --git a/cvs2svn_lib/database.py b/cvs2svn_lib/database.py index 9db9be2c..ff5bb718 100644 --- a/cvs2svn_lib/database.py +++ b/cvs2svn_lib/database.py @@ -26,7 +26,7 @@ from cvs2svn_lib.common import DB_OPEN_WRITE from cvs2svn_lib.common import DB_OPEN_NEW from cvs2svn_lib.common import warning_prefix from cvs2svn_lib.common import error_prefix -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.record_table import FileOffsetPacker from cvs2svn_lib.record_table import RecordTable @@ -44,7 +44,7 @@ except ImportError: # 2. These DBM modules are not good for cvs2svn. import anydbm if anydbm._defaultmod.__name__ in ['dumbdbm', 'dbm']: - Log().error( + logger.error( '%s: cvs2svn uses the anydbm package, which depends on lower level ' 'dbm\n' 'libraries. Your system has %s, with which cvs2svn is known to have\n' @@ -64,7 +64,7 @@ if hasattr(anydbm._defaultmod, 'bsddb') \ try: gdbm = __import__('gdbm') except ImportError: - Log().warn( + logger.warn( '%s: The version of the bsddb module found on your computer ' 'has been\n' 'reported to malfunction on some datasets, causing KeyError ' diff --git a/cvs2svn_lib/dvcs_common.py b/cvs2svn_lib/dvcs_common.py index fe2758d0..c580d5fc 100644 --- a/cvs2svn_lib/dvcs_common.py +++ b/cvs2svn_lib/dvcs_common.py @@ -24,7 +24,7 @@ from cvs2svn_lib import config from cvs2svn_lib.common import FatalError from cvs2svn_lib.common import InternalError from cvs2svn_lib.run_options import RunOptions -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.common import error_prefix from cvs2svn_lib.context import Ctx from cvs2svn_lib.artifact_manager import artifact_manager @@ -113,7 +113,7 @@ class DVCSRunOptions(RunOptions): sys.exit(1) if len(self.args) > 1: - Log().error(error_prefix + ": must pass only one CVS repository.\n") + logger.error(error_prefix + ": must pass only one CVS repository.\n") self.usage() sys.exit(1) diff --git a/cvs2svn_lib/external_blob_generator.py b/cvs2svn_lib/external_blob_generator.py index de126b21..aa2e90b2 100644 --- a/cvs2svn_lib/external_blob_generator.py +++ b/cvs2svn_lib/external_blob_generator.py @@ -41,7 +41,7 @@ import subprocess import cPickle as pickle from cvs2svn_lib.common import FatalError -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.cvs_item import CVSRevisionDelete from cvs2svn_lib.revision_manager import RevisionCollector from cvs2svn_lib.key_generator import KeyGenerator @@ -55,7 +55,7 @@ class ExternalBlobGenerator(RevisionCollector): def start(self): self._mark_generator = KeyGenerator() - Log().normal('Starting generate_blobs.py...') + logger.normal('Starting generate_blobs.py...') self._popen = subprocess.Popen( [ sys.executable, @@ -101,13 +101,13 @@ class ExternalBlobGenerator(RevisionCollector): def finish(self): self._popen.stdin.close() - Log().normal('Waiting for generate_blobs.py to finish...') + logger.normal('Waiting for generate_blobs.py to finish...') returncode = self._popen.wait() if returncode: raise FatalError( 'generate_blobs.py failed with return code %s.' % (returncode,) ) else: - Log().normal('generate_blobs.py is done.') + logger.normal('generate_blobs.py is done.') diff --git a/cvs2svn_lib/git_output_option.py b/cvs2svn_lib/git_output_option.py index e971bf7a..0e3dc16f 100644 --- a/cvs2svn_lib/git_output_option.py +++ b/cvs2svn_lib/git_output_option.py @@ -26,7 +26,7 @@ import bisect import time from cvs2svn_lib.common import InternalError -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.context import Ctx from cvs2svn_lib.symbol import Trunk from cvs2svn_lib.symbol import Branch @@ -443,7 +443,7 @@ class GitOutputOption(DVCSOutputOption): source_groups = list(self._get_source_groups(svn_commit)) if self._is_simple_copy(svn_commit, source_groups): (source_lod, source_revnum, cvs_symbols) = source_groups[0] - Log().debug( + logger.debug( '%s will be created via a simple copy from %s:r%d' % (svn_commit.symbol, source_lod, source_revnum,) ) @@ -452,7 +452,7 @@ class GitOutputOption(DVCSOutputOption): self._mirror.copy_lod(source_lod, svn_commit.symbol, source_revnum) self._set_lod_mark(svn_commit.symbol, svn_commit.revnum, mark) else: - Log().debug( + logger.debug( '%s will be created via fixup commit(s)' % (svn_commit.symbol,) ) self._process_symbol_commit( @@ -490,7 +490,7 @@ class GitOutputOption(DVCSOutputOption): source_groups = list(self._get_source_groups(svn_commit)) if self._is_simple_copy(svn_commit, source_groups): (source_lod, source_revnum, cvs_symbols) = source_groups[0] - Log().debug( + logger.debug( '%s will be created via a simple copy from %s:r%d' % (svn_commit.symbol, source_lod, source_revnum,) ) @@ -499,7 +499,7 @@ class GitOutputOption(DVCSOutputOption): self._mirror.copy_lod(source_lod, svn_commit.symbol, source_revnum) self._set_lod_mark(svn_commit.symbol, svn_commit.revnum, mark) else: - Log().debug( + logger.debug( '%s will be created via a fixup branch' % (svn_commit.symbol,) ) diff --git a/cvs2svn_lib/pass_manager.py b/cvs2svn_lib/pass_manager.py index 90fa2dc4..3a0d79e1 100644 --- a/cvs2svn_lib/pass_manager.py +++ b/cvs2svn_lib/pass_manager.py @@ -23,7 +23,7 @@ import gc from cvs2svn_lib import config from cvs2svn_lib.common import FatalError from cvs2svn_lib.context import Ctx -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.stats_keeper import StatsKeeper from cvs2svn_lib.stats_keeper import read_stats_keeper from cvs2svn_lib.artifact_manager import artifact_manager @@ -44,13 +44,13 @@ def check_for_garbage(): gc.set_debug(gc.DEBUG_SAVEALL) gc_count = gc.collect() if gc_count: - if Log().is_on(Log.DEBUG): - Log().debug( + if logger.is_on(logger.DEBUG): + logger.debug( 'INTERNAL: %d unreachable object(s) were garbage collected:' % (gc_count,) ) for g in gc.garbage: - Log().debug(' %s' % (g,)) + logger.debug(' %s' % (g,)) del gc.garbage[:] @@ -166,7 +166,7 @@ class PassManager: start_time = time.time() for i in range(index_start, index_end): the_pass = self.passes[i] - Log().quiet('----- pass %d (%s) -----' % (i + 1, the_pass.name,)) + logger.quiet('----- pass %d (%s) -----' % (i + 1, the_pass.name,)) artifact_manager.pass_started(the_pass) if i == 0: @@ -183,7 +183,7 @@ class PassManager: stats_keeper.log_duration_for_pass( end_time - start_time, i + 1, the_pass.name ) - Log().normal(stats_keeper.single_pass_timing(i + 1)) + logger.normal(stats_keeper.single_pass_timing(i + 1)) stats_keeper.archive( artifact_manager.get_temp_file(config.STATISTICS_FILE % (i + 1,)) ) @@ -199,8 +199,8 @@ class PassManager: for the_pass in self.passes[index_end:]: artifact_manager.pass_deferred(the_pass) - Log().quiet(stats_keeper) - Log().normal(stats_keeper.timings()) + logger.quiet(stats_keeper) + logger.normal(stats_keeper.timings()) # Consistency check: artifact_manager.check_clean() diff --git a/cvs2svn_lib/passes.py b/cvs2svn_lib/passes.py index b143b5eb..eea8d9e0 100644 --- a/cvs2svn_lib/passes.py +++ b/cvs2svn_lib/passes.py @@ -32,7 +32,7 @@ from cvs2svn_lib.common import DB_OPEN_READ from cvs2svn_lib.common import DB_OPEN_WRITE from cvs2svn_lib.common import Timestamper from cvs2svn_lib.sort import sort_file -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.pass_manager import Pass from cvs2svn_lib.serializer import PrimedPickleSerializer from cvs2svn_lib.artifact_manager import artifact_manager @@ -93,7 +93,7 @@ class CollectRevsPass(Pass): self._register_temp_file(config.CVS_ITEMS_STORE) def run(self, run_options, stats_keeper): - Log().quiet("Examining all CVS ',v' files...") + logger.quiet("Examining all CVS ',v' files...") Ctx()._projects = {} Ctx()._cvs_path_db = CVSPathDatabase(DB_OPEN_NEW) cd = CollectData(stats_keeper) @@ -112,7 +112,7 @@ class CollectRevsPass(Pass): Ctx()._cvs_path_db.close() write_projects(artifact_manager.get_temp_file(config.PROJECTS)) - Log().quiet("Done") + logger.quiet("Done") class CleanMetadataPass(Pass): @@ -184,17 +184,17 @@ class CleanMetadataPass(Pass): try: metadata.author = self._get_clean_author(metadata.author) except UnicodeError, e: - Log().warn('%s: %s' % (warning_prefix, e,)) + logger.warn('%s: %s' % (warning_prefix, e,)) self.warnings = True try: metadata.log_msg = self._get_clean_log_msg(metadata.log_msg) except UnicodeError, e: - Log().warn('%s: %s' % (warning_prefix, e,)) + logger.warn('%s: %s' % (warning_prefix, e,)) self.warnings = True def run(self, run_options, stats_keeper): - Log().quiet("Converting metadata to UTF8...") + logger.quiet("Converting metadata to UTF8...") metadata_db = MetadataDatabase( artifact_manager.get_temp_file(config.METADATA_STORE), artifact_manager.get_temp_file(config.METADATA_INDEX_TABLE), @@ -233,7 +233,7 @@ class CleanMetadataPass(Pass): metadata_clean_db.close() metadata_db.close() - Log().quiet("Done") + logger.quiet("Done") class CollateSymbolsPass(Pass): @@ -420,7 +420,7 @@ class CollateSymbolsPass(Pass): del self.symbol_stats - Log().quiet("Done") + logger.quiet("Done") class FilterSymbolsPass(Pass): @@ -465,14 +465,14 @@ class FilterSymbolsPass(Pass): revision_collector = Ctx().revision_collector - Log().quiet("Filtering out excluded symbols and summarizing items...") + logger.quiet("Filtering out excluded symbols and summarizing items...") stats_keeper.reset_cvs_rev_info() revision_collector.start() # Process the cvs items store one file at a time: for cvs_file_items in cvs_item_store.iter_cvs_file_items(): - Log().verbose(cvs_file_items.cvs_file.filename) + logger.verbose(cvs_file_items.cvs_file.filename) cvs_file_items.filter_excluded_symbols() cvs_file_items.mutate_symbols() cvs_file_items.adjust_parents() @@ -507,7 +507,7 @@ class FilterSymbolsPass(Pass): Ctx()._symbol_db.close() Ctx()._cvs_path_db.close() - Log().quiet("Done") + logger.quiet("Done") class SortRevisionsPass(Pass): @@ -518,7 +518,7 @@ class SortRevisionsPass(Pass): self._register_temp_file_needed(config.CVS_REVS_DATAFILE) def run(self, run_options, stats_keeper): - Log().quiet("Sorting CVS revision summaries...") + logger.quiet("Sorting CVS revision summaries...") sort_file( artifact_manager.get_temp_file(config.CVS_REVS_DATAFILE), artifact_manager.get_temp_file( @@ -526,7 +526,7 @@ class SortRevisionsPass(Pass): ), tempdirs=[Ctx().tmpdir], ) - Log().quiet("Done") + logger.quiet("Done") class SortSymbolsPass(Pass): @@ -537,7 +537,7 @@ class SortSymbolsPass(Pass): self._register_temp_file_needed(config.CVS_SYMBOLS_DATAFILE) def run(self, run_options, stats_keeper): - Log().quiet("Sorting CVS symbol summaries...") + logger.quiet("Sorting CVS symbol summaries...") sort_file( artifact_manager.get_temp_file(config.CVS_SYMBOLS_DATAFILE), artifact_manager.get_temp_file( @@ -545,7 +545,7 @@ class SortSymbolsPass(Pass): ), tempdirs=[Ctx().tmpdir], ) - Log().quiet("Done") + logger.quiet("Done") class InitializeChangesetsPass(Pass): @@ -756,7 +756,7 @@ class InitializeChangesetsPass(Pass): ) def run(self, run_options, stats_keeper): - Log().quiet("Creating preliminary commit sets...") + logger.quiet("Creating preliminary commit sets...") Ctx()._projects = read_projects( artifact_manager.get_temp_file(config.PROJECTS) @@ -786,8 +786,8 @@ class InitializeChangesetsPass(Pass): self.changeset_key_generator = KeyGenerator() for (changeset, changeset_items) in self.get_changesets(): - if Log().is_on(Log.DEBUG): - Log().debug(repr(changeset)) + if logger.is_on(logger.DEBUG): + logger.debug(repr(changeset)) changeset_db.store(changeset) for cvs_item in changeset_items: self.sorted_cvs_items_db.add(cvs_item) @@ -801,7 +801,7 @@ class InitializeChangesetsPass(Pass): del self.cvs_item_serializer - Log().quiet("Done") + logger.quiet("Done") class ProcessedChangesetLogger: @@ -809,12 +809,12 @@ class ProcessedChangesetLogger: self.processed_changeset_ids = [] def log(self, changeset_id): - if Log().is_on(Log.DEBUG): + if logger.is_on(logger.DEBUG): self.processed_changeset_ids.append(changeset_id) def flush(self): if self.processed_changeset_ids: - Log().debug( + logger.debug( 'Consumed changeset ids %s' % (', '.join(['%x' % id for id in self.processed_changeset_ids]),)) @@ -876,8 +876,8 @@ class BreakRevisionChangesetCyclesPass(Pass): best_i = i best_link = link - if Log().is_on(Log.DEBUG): - Log().debug( + if logger.is_on(logger.DEBUG): + logger.debug( 'Breaking cycle %s by breaking node %x' % ( ' -> '.join(['%x' % node.id for node in (cycle + [cycle[0]])]), best_link.changeset.id,)) @@ -890,7 +890,7 @@ class BreakRevisionChangesetCyclesPass(Pass): self.changeset_graph.add_new_changeset(changeset) def run(self, run_options, stats_keeper): - Log().quiet("Breaking revision changeset dependency cycles...") + logger.quiet("Breaking revision changeset dependency cycles...") Ctx()._projects = read_projects( artifact_manager.get_temp_file(config.PROJECTS) @@ -947,7 +947,7 @@ class BreakRevisionChangesetCyclesPass(Pass): Ctx()._symbol_db.close() Ctx()._cvs_path_db.close() - Log().quiet("Done") + logger.quiet("Done") class RevisionTopologicalSortPass(Pass): @@ -1016,7 +1016,7 @@ class RevisionTopologicalSortPass(Pass): changeset_graph.close() def run(self, run_options, stats_keeper): - Log().quiet("Generating CVSRevisions in commit order...") + logger.quiet("Generating CVSRevisions in commit order...") Ctx()._projects = read_projects( artifact_manager.get_temp_file(config.PROJECTS) @@ -1041,7 +1041,7 @@ class RevisionTopologicalSortPass(Pass): Ctx()._symbol_db.close() Ctx()._cvs_path_db.close() - Log().quiet("Done") + logger.quiet("Done") class BreakSymbolChangesetCyclesPass(Pass): @@ -1098,8 +1098,8 @@ class BreakSymbolChangesetCyclesPass(Pass): best_i = i best_link = link - if Log().is_on(Log.DEBUG): - Log().debug( + if logger.is_on(logger.DEBUG): + logger.debug( 'Breaking cycle %s by breaking node %x' % ( ' -> '.join(['%x' % node.id for node in (cycle + [cycle[0]])]), best_link.changeset.id,)) @@ -1112,7 +1112,7 @@ class BreakSymbolChangesetCyclesPass(Pass): self.changeset_graph.add_new_changeset(changeset) def run(self, run_options, stats_keeper): - Log().quiet("Breaking symbol changeset dependency cycles...") + logger.quiet("Breaking symbol changeset dependency cycles...") Ctx()._projects = read_projects( artifact_manager.get_temp_file(config.PROJECTS) @@ -1169,7 +1169,7 @@ class BreakSymbolChangesetCyclesPass(Pass): Ctx()._symbol_db.close() Ctx()._cvs_path_db.close() - Log().quiet("Done") + logger.quiet("Done") class BreakAllChangesetCyclesPass(Pass): @@ -1204,7 +1204,7 @@ class BreakAllChangesetCyclesPass(Pass): def _split_retrograde_changeset(self, changeset): """CHANGESET is retrograde. Split it into non-retrograde changesets.""" - Log().debug('Breaking retrograde changeset %x' % (changeset.id,)) + logger.debug('Breaking retrograde changeset %x' % (changeset.id,)) self.changeset_graph.delete_changeset(changeset) @@ -1295,8 +1295,8 @@ class BreakAllChangesetCyclesPass(Pass): best_i = i best_link = link - if Log().is_on(Log.DEBUG): - Log().debug( + if logger.is_on(logger.DEBUG): + logger.debug( 'Breaking segment %s by breaking node %x' % ( ' -> '.join(['%x' % node.id for node in segment]), best_link.changeset.id,)) @@ -1322,8 +1322,8 @@ class BreakAllChangesetCyclesPass(Pass): It is not guaranteed that the cycle will be broken by one call to this routine, but at least some progress must be made.""" - if Log().is_on(Log.DEBUG): - Log().debug( + if logger.is_on(logger.DEBUG): + logger.debug( 'Breaking cycle %s' % ( ' -> '.join(['%x' % changeset.id for changeset in cycle + [cycle[0]]]),)) @@ -1332,7 +1332,7 @@ class BreakAllChangesetCyclesPass(Pass): self.break_segment([cycle[-1]] + cycle + [cycle[0]]) def run(self, run_options, stats_keeper): - Log().quiet("Breaking CVSSymbol dependency loops...") + logger.quiet("Breaking CVSSymbol dependency loops...") Ctx()._projects = read_projects( artifact_manager.get_temp_file(config.PROJECTS) @@ -1427,14 +1427,14 @@ class BreakAllChangesetCyclesPass(Pass): id = ordered_changesets[next_ordered_changeset] path = self.changeset_graph.search_for_path(id, ordered_changeset_ids) if path: - if Log().is_on(Log.DEBUG): - Log().debug('Breaking path from %s to %s' % (path[0], path[-1],)) + if logger.is_on(logger.DEBUG): + logger.debug('Breaking path from %s to %s' % (path[0], path[-1],)) self.break_segment(path) else: # There were no ordered changesets among the reachable # predecessors, so do generic cycle-breaking: - if Log().is_on(Log.DEBUG): - Log().debug( + if logger.is_on(logger.DEBUG): + logger.debug( 'Breaking generic cycle found from %s' % (self.changeset_db[id],) ) @@ -1446,7 +1446,7 @@ class BreakAllChangesetCyclesPass(Pass): self.cvs_item_to_changeset_id = None self.changeset_db = None - Log().quiet("Done") + logger.quiet("Done") class TopologicalSortPass(Pass): @@ -1505,7 +1505,7 @@ class TopologicalSortPass(Pass): changeset_graph.close() def run(self, run_options, stats_keeper): - Log().quiet("Generating CVSRevisions in commit order...") + logger.quiet("Generating CVSRevisions in commit order...") Ctx()._projects = read_projects( artifact_manager.get_temp_file(config.PROJECTS) @@ -1530,7 +1530,7 @@ class TopologicalSortPass(Pass): Ctx()._symbol_db.close() Ctx()._cvs_path_db.close() - Log().quiet("Done") + logger.quiet("Done") class CreateRevsPass(Pass): @@ -1582,17 +1582,17 @@ class CreateRevsPass(Pass): def log_svn_commit(self, svn_commit): """Output information about SVN_COMMIT.""" - Log().normal( + logger.normal( 'Creating Subversion r%d (%s)' % (svn_commit.revnum, svn_commit.get_description(),) ) if isinstance(svn_commit, SVNRevisionCommit): for cvs_rev in svn_commit.cvs_revs: - Log().verbose(' %s %s' % (cvs_rev.cvs_path, cvs_rev.rev,)) + logger.verbose(' %s %s' % (cvs_rev.cvs_path, cvs_rev.rev,)) def run(self, run_options, stats_keeper): - Log().quiet("Mapping CVS revisions to Subversion commits...") + logger.quiet("Mapping CVS revisions to Subversion commits...") Ctx()._projects = read_projects( artifact_manager.get_temp_file(config.PROJECTS) @@ -1622,7 +1622,7 @@ class CreateRevsPass(Pass): Ctx()._symbol_db.close() Ctx()._cvs_path_db.close() - Log().quiet("Done") + logger.quiet("Done") class SortSymbolOpeningsClosingsPass(Pass): @@ -1633,7 +1633,7 @@ class SortSymbolOpeningsClosingsPass(Pass): self._register_temp_file_needed(config.SYMBOL_OPENINGS_CLOSINGS) def run(self, run_options, stats_keeper): - Log().quiet("Sorting symbolic name source revisions...") + logger.quiet("Sorting symbolic name source revisions...") def sort_key(line): line = line.split(' ', 2) @@ -1647,7 +1647,7 @@ class SortSymbolOpeningsClosingsPass(Pass): key=sort_key, tempdirs=[Ctx().tmpdir], ) - Log().quiet("Done") + logger.quiet("Done") class IndexSymbolsPass(Pass): @@ -1682,7 +1682,7 @@ class IndexSymbolsPass(Pass): id, svn_revnum, ignored = line.split(" ", 2) id = int(id, 16) if id != old_id: - Log().verbose(' ', Ctx()._symbol_db.get_symbol(id).name) + logger.verbose(' ', Ctx()._symbol_db.get_symbol(id).name) old_id = id offsets[id] = fpos @@ -1694,14 +1694,14 @@ class IndexSymbolsPass(Pass): offsets_db.close() def run(self, run_options, stats_keeper): - Log().quiet("Determining offsets for all symbolic names...") + logger.quiet("Determining offsets for all symbolic names...") Ctx()._projects = read_projects( artifact_manager.get_temp_file(config.PROJECTS) ) Ctx()._symbol_db = SymbolDatabase() self.generate_offsets_for_symbolings() Ctx()._symbol_db.close() - Log().quiet("Done.") + logger.quiet("Done.") class OutputPass(Pass): diff --git a/cvs2svn_lib/property_setters.py b/cvs2svn_lib/property_setters.py index 070f637d..a888d1b4 100644 --- a/cvs2svn_lib/property_setters.py +++ b/cvs2svn_lib/property_setters.py @@ -24,7 +24,7 @@ import ConfigParser from cStringIO import StringIO from cvs2svn_lib.common import warning_prefix -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger def _squash_case(s): @@ -121,7 +121,7 @@ class MimeMapper(FilePropertySetter): self.transform_case = _preserve_case if mime_types_file is None and mime_mappings is None: - Log().error('Should specify MIME types file or dict.\n') + logger.error('Should specify MIME types file or dict.\n') if mime_types_file is not None: for line in file(mime_types_file): @@ -137,7 +137,7 @@ class MimeMapper(FilePropertySetter): for ext in extensions: ext = self.transform_case(ext) if ext in self.mappings and self.mappings[ext] != type: - Log().error( + logger.error( "%s: ambiguous MIME mapping for *.%s (%s or %s)\n" % (warning_prefix, ext, self.mappings[ext], type) ) @@ -147,7 +147,7 @@ class MimeMapper(FilePropertySetter): for ext, type in mime_mappings.iteritems(): ext = self.transform_case(ext) if ext in self.mappings and self.mappings[ext] != type: - Log().error( + logger.error( "%s: ambiguous MIME mapping for *.%s (%s or %s)\n" % (warning_prefix, ext, self.mappings[ext], type) ) @@ -238,7 +238,7 @@ class AutoPropsPropertySetter(FilePropertySetter): configtext = open(configfilename).read() if self.comment_re.search(configtext): - Log().warn( + logger.warn( '%s: Please be aware that a space followed by a\n' 'semicolon is sometimes treated as a comment in configuration\n' 'files. This pattern was seen in\n' @@ -264,7 +264,7 @@ class AutoPropsPropertySetter(FilePropertySetter): def _add_pattern(self, pattern, props): propdict = {} if self.quoted_re.match(pattern): - Log().warn( + logger.warn( '%s: Quoting is not supported in auto-props; please verify rule\n' 'for %r. (Using pattern including quotation marks.)\n' % (warning_prefix, pattern,) @@ -274,7 +274,7 @@ class AutoPropsPropertySetter(FilePropertySetter): m = self.property_unset_re.match(prop) if m: name = m.group('name') - Log().debug( + logger.debug( 'auto-props: For %r, leaving %r unset.' % (pattern, name,) ) propdict[name] = None @@ -285,13 +285,13 @@ class AutoPropsPropertySetter(FilePropertySetter): name = m.group('name') value = m.group('value') if self.quoted_re.match(value): - Log().warn( + logger.warn( '%s: Quoting is not supported in auto-props; please verify\n' 'rule %r for pattern %r. (Using value\n' 'including quotation marks.)\n' % (warning_prefix, prop, pattern,) ) - Log().debug( + logger.debug( 'auto-props: For %r, setting %r to %r.' % (pattern, name, value,) ) propdict[name] = value @@ -300,14 +300,14 @@ class AutoPropsPropertySetter(FilePropertySetter): m = self.property_novalue_re.match(prop) if m: name = m.group('name') - Log().debug( + logger.debug( 'auto-props: For %r, setting %r to the empty string' % (pattern, name,) ) propdict[name] = '' continue - Log().warn( + logger.warn( '%s: in auto-props line for %r, value %r cannot be parsed (ignored)' % (warning_prefix, pattern, prop,) ) @@ -322,7 +322,7 @@ class AutoPropsPropertySetter(FilePropertySetter): for (key,value) in pattern.propdict.items(): if key in propdict: if propdict[key] != value: - Log().warn( + logger.warn( "Contradictory values set for property '%s' for file %s." % (key, cvs_file,)) else: @@ -335,7 +335,7 @@ class AutoPropsPropertySetter(FilePropertySetter): for (k,v) in propdict.items(): if k in cvs_file.properties: if cvs_file.properties[k] != v: - Log().warn( + logger.warn( "Property '%s' already set to %r for file %s; " "auto-props value (%r) ignored." % (k, cvs_file.properties[k], cvs_file.cvs_path, v,) diff --git a/cvs2svn_lib/record_table.py b/cvs2svn_lib/record_table.py index 41ab84af..bd5f7c12 100644 --- a/cvs2svn_lib/record_table.py +++ b/cvs2svn_lib/record_table.py @@ -41,7 +41,7 @@ import mmap from cvs2svn_lib.common import DB_OPEN_READ from cvs2svn_lib.common import DB_OPEN_WRITE from cvs2svn_lib.common import DB_OPEN_NEW -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger # A unique value that can be used to stand for "unset" without @@ -258,7 +258,7 @@ class RecordTable(AbstractRecordTable): self._limit_written = self._limit def flush(self): - Log().debug('Flushing cache for %s' % (self,)) + logger.debug('Flushing cache for %s' % (self,)) pairs = [(i, s) for (i, (dirty, s)) in self._cache.items() if dirty] diff --git a/cvs2svn_lib/repository_mirror.py b/cvs2svn_lib/repository_mirror.py index e57733bd..147e8784 100644 --- a/cvs2svn_lib/repository_mirror.py +++ b/cvs2svn_lib/repository_mirror.py @@ -137,7 +137,7 @@ import bisect from cvs2svn_lib import config from cvs2svn_lib.common import DB_OPEN_NEW from cvs2svn_lib.common import InternalError -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.context import Ctx from cvs2svn_lib.cvs_path import CVSFile from cvs2svn_lib.cvs_path import CVSDirectory @@ -676,7 +676,7 @@ class _NodeDatabase(object): # The size of the cache has exceeded the threshold. Discard the # old cache values (but still store the new nodes into the # cache): - Log().debug('Clearing node cache') + logger.debug('Clearing node cache') self._cache.clear() data = {} diff --git a/cvs2svn_lib/repository_walker.py b/cvs2svn_lib/repository_walker.py index f7ff91d7..f4b76dce 100644 --- a/cvs2svn_lib/repository_walker.py +++ b/cvs2svn_lib/repository_walker.py @@ -24,7 +24,7 @@ from cvs2svn_lib.common import FatalError from cvs2svn_lib.common import warning_prefix from cvs2svn_lib.common import IllegalSVNPathError from cvs2svn_lib.common import verify_svn_filename_legal -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.context import Ctx from cvs2svn_lib.project import FileInAndOutOfAtticException from cvs2svn_lib.cvs_path import CVSDirectory @@ -120,7 +120,7 @@ class _RepositoryWalker(object): ) except FileInAndOutOfAtticException, e: if Ctx().retain_conflicting_attic_files: - Log().warn( + logger.warn( "%s: %s;\n" " storing the latter into 'Attic' subdirectory.\n" % (warning_prefix, e) @@ -151,11 +151,11 @@ class _RepositoryWalker(object): pathname = os.path.join(cvs_directory.filename, fname) if os.path.isdir(pathname): if fname == '.svn': - Log().debug( + logger.debug( "Directory %s found within Attic; ignoring" % (pathname,) ) else: - Log().warn( + logger.warn( "Directory %s found within Attic; ignoring" % (pathname,) ) elif fname.endswith(',v'): @@ -207,7 +207,7 @@ class _RepositoryWalker(object): if fname == 'Attic': attic_dir = fname elif fname == '.svn': - Log().debug("Directory %s ignored" % (pathname,)) + logger.debug("Directory %s ignored" % (pathname,)) else: dirs.append(fname) elif fname.endswith(',v'): diff --git a/cvs2svn_lib/run_options.py b/cvs2svn_lib/run_options.py index fa08d64a..3f84d456 100644 --- a/cvs2svn_lib/run_options.py +++ b/cvs2svn_lib/run_options.py @@ -29,7 +29,7 @@ from cvs2svn_lib import config from cvs2svn_lib.common import error_prefix from cvs2svn_lib.common import FatalError from cvs2svn_lib.man_writer import ManWriter -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.context import Ctx from cvs2svn_lib.man_writer import ManOption from cvs2svn_lib.pass_manager import InvalidPassError @@ -248,10 +248,10 @@ class RunOptions(object): (self.options, self.args) = parser.parse_args(args=self.cmd_args) # Now the log level has been set; log the time when the run started: - Log().verbose( + logger.verbose( time.strftime( 'Conversion start time: %Y-%m-%d %I:%M:%S %Z', - time.localtime(Log().start_time) + time.localtime(logger.start_time) ) ) @@ -902,10 +902,10 @@ class RunOptions(object): sys.exit(0) def callback_verbose(self, option, opt_str, value, parser): - Log().increase_verbosity() + logger.increase_verbosity() def callback_quiet(self, option, opt_str, value, parser): - Log().decrease_verbosity() + logger.decrease_verbosity() def callback_passes(self, option, opt_str, value, parser): if value.find(':') >= 0: @@ -1092,7 +1092,7 @@ class RunOptions(object): if self.options.options_incompatible_options or self.args: if self.options.options_incompatible_options: oio = self.options.options_incompatible_options - Log().error( + logger.error( '%s: The following options cannot be used in combination with ' 'the --options\n' 'option:\n' @@ -1100,7 +1100,7 @@ class RunOptions(object): % (error_prefix, '\n '.join(oio)) ) if self.args: - Log().error( + logger.error( '%s: No cvs-repos-path arguments are allowed with the --options ' 'option.\n' % (error_prefix,) diff --git a/cvs2svn_lib/stdout_delegate.py b/cvs2svn_lib/stdout_delegate.py index d3868657..2feb4784 100644 --- a/cvs2svn_lib/stdout_delegate.py +++ b/cvs2svn_lib/stdout_delegate.py @@ -17,7 +17,7 @@ """This module contains database facilities used by cvs2svn.""" -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.svn_repository_delegate import SVNRepositoryDelegate @@ -35,48 +35,48 @@ class StdoutDelegate(SVNRepositoryDelegate): """Prints out the Subversion revision number of the commit that is being started.""" - Log().verbose("=" * 60) - Log().normal("Starting Subversion r%d / %d" % (revnum, self.total_revs)) + logger.verbose("=" * 60) + logger.normal("Starting Subversion r%d / %d" % (revnum, self.total_revs)) def end_commit(self): pass def initialize_project(self, project): - Log().verbose(" Initializing project %s" % (project,)) + logger.verbose(" Initializing project %s" % (project,)) def initialize_lod(self, lod): - Log().verbose(" Initializing %s" % (lod,)) + logger.verbose(" Initializing %s" % (lod,)) def mkdir(self, lod, cvs_directory): - Log().verbose( + logger.verbose( " New Directory %s" % (lod.get_path(cvs_directory.cvs_path),) ) def add_path(self, cvs_rev): """Print a line stating what path we are 'adding'.""" - Log().verbose(" Adding %s" % (cvs_rev.get_svn_path(),)) + logger.verbose(" Adding %s" % (cvs_rev.get_svn_path(),)) def change_path(self, cvs_rev): """Print a line stating what path we are 'changing'.""" - Log().verbose(" Changing %s" % (cvs_rev.get_svn_path(),)) + logger.verbose(" Changing %s" % (cvs_rev.get_svn_path(),)) def delete_lod(self, lod): """Print a line stating that we are 'deleting' LOD.""" - Log().verbose(" Deleting %s" % (lod.get_path(),)) + logger.verbose(" Deleting %s" % (lod.get_path(),)) def delete_path(self, lod, cvs_path): """Print a line stating that we are 'deleting' PATH.""" - Log().verbose(" Deleting %s" % (lod.get_path(cvs_path.cvs_path),)) + logger.verbose(" Deleting %s" % (lod.get_path(cvs_path.cvs_path),)) def _show_copy(self, src_path, dest_path, src_revnum): """Print a line stating that we are 'copying' revision SRC_REVNUM of SRC_PATH to DEST_PATH.""" - Log().verbose( + logger.verbose( " Copying revision %d of %s\n" " to %s\n" % (src_revnum, src_path, dest_path,) @@ -101,7 +101,7 @@ class StdoutDelegate(SVNRepositoryDelegate): def finish(self): """State that we are done creating our repository.""" - Log().verbose("Finished creating Subversion repository.") - Log().quiet("Done.") + logger.verbose("Finished creating Subversion repository.") + logger.quiet("Done.") diff --git a/cvs2svn_lib/svn_commit_creator.py b/cvs2svn_lib/svn_commit_creator.py index c87db38b..41b2745d 100644 --- a/cvs2svn_lib/svn_commit_creator.py +++ b/cvs2svn_lib/svn_commit_creator.py @@ -20,7 +20,7 @@ import time from cvs2svn_lib.common import InternalError -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.context import Ctx from cvs2svn_lib.cvs_item import CVSRevisionNoop from cvs2svn_lib.cvs_item import CVSBranchNoop @@ -80,12 +80,12 @@ class SVNCommitCreator: for any resulting SVNCommits.""" if not changeset.cvs_item_ids: - Log().warn('Changeset has no items: %r' % changeset) + logger.warn('Changeset has no items: %r' % changeset) return - Log().verbose('-' * 60) - Log().verbose('CVS Revision grouping:') - Log().verbose(' Time: %s' % time.ctime(timestamp)) + logger.verbose('-' * 60) + logger.verbose('CVS Revision grouping:') + logger.verbose(' Time: %s' % time.ctime(timestamp)) # Generate an SVNCommit unconditionally. Even if the only change in # this group of CVSRevisions is a deletion of an already-deleted @@ -141,7 +141,7 @@ class SVNCommitCreator: self.revnum_generator.gen_id(), ) else: - Log().debug( + logger.debug( 'Omitting %r because it contains only CVSTagNoops' % (changeset,) ) @@ -173,7 +173,7 @@ class SVNCommitCreator: cvs_branch, svn_commit.revnum ) else: - Log().debug( + logger.debug( 'Omitting %r because it contains only CVSBranchNoops' % (changeset,) ) diff --git a/cvs2svn_lib/svn_output_option.py b/cvs2svn_lib/svn_output_option.py index b07577c7..262f7ff5 100644 --- a/cvs2svn_lib/svn_output_option.py +++ b/cvs2svn_lib/svn_output_option.py @@ -27,7 +27,7 @@ from cvs2svn_lib.common import error_prefix from cvs2svn_lib.common import format_date from cvs2svn_lib.common import PathsNotDisjointException from cvs2svn_lib.common import verify_paths_disjoint -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.context import Ctx from cvs2svn_lib.artifact_manager import artifact_manager from cvs2svn_lib.process import CommandFailedException @@ -106,7 +106,7 @@ class SVNOutputOption(OutputOption): for lod in symbol_map.itervalues(): if isinstance(lod, LineOfDevelopment): if lod.base_path is None: - Log().error('%s: No path was set for %r\n' % (error_prefix, lod,)) + logger.error('%s: No path was set for %r\n' % (error_prefix, lod,)) error_found = True else: paths.append(lod.base_path) @@ -115,7 +115,7 @@ class SVNOutputOption(OutputOption): try: verify_paths_disjoint(*paths) except PathsNotDisjointException, e: - Log().error(str(e)) + logger.error(str(e)) error_found = True if error_found: @@ -543,7 +543,7 @@ class SVNOutputOption(OutputOption): plural = "s" else: plural = "" - Log().verbose("Committing %d CVSRevision%s" + logger.verbose("Committing %d CVSRevision%s" % (len(svn_commit.cvs_revs), plural)) for cvs_rev in svn_commit.cvs_revs: if isinstance(cvs_rev, CVSRevisionNoop): @@ -563,7 +563,7 @@ class SVNOutputOption(OutputOption): def process_post_commit(self, svn_commit): self.start_commit(svn_commit.revnum, self._get_revprops(svn_commit)) - Log().verbose( + logger.verbose( 'Synchronizing default branch motivated by %d' % (svn_commit.motivating_revnum,) ) @@ -597,7 +597,7 @@ class SVNOutputOption(OutputOption): def process_branch_commit(self, svn_commit): self.start_commit(svn_commit.revnum, self._get_revprops(svn_commit)) - Log().verbose('Filling branch:', svn_commit.symbol.name) + logger.verbose('Filling branch:', svn_commit.symbol.name) # Get the set of sources for the symbolic name: source_set = get_source_set( @@ -611,7 +611,7 @@ class SVNOutputOption(OutputOption): def process_tag_commit(self, svn_commit): self.start_commit(svn_commit.revnum, self._get_revprops(svn_commit)) - Log().verbose('Filling tag:', svn_commit.symbol.name) + logger.verbose('Filling tag:', svn_commit.symbol.name) # Get the set of sources for the symbolic name: source_set = get_source_set( @@ -643,7 +643,7 @@ class DumpfileOutputOption(SVNOutputOption): pass def setup(self, svn_rev_count): - Log().quiet("Starting Subversion Dumpfile.") + logger.quiet("Starting Subversion Dumpfile.") SVNOutputOption.setup(self, svn_rev_count) if not Ctx().dry_run: self.add_delegate( @@ -673,7 +673,7 @@ class RepositoryOutputOption(SVNOutputOption): 'installed and/or use the --svnadmin option.' % (e,)) def setup(self, svn_rev_count): - Log().quiet("Starting Subversion Repository.") + logger.quiet("Starting Subversion Repository.") SVNOutputOption.setup(self, svn_rev_count) if not Ctx().dry_run: self.add_delegate( @@ -723,7 +723,7 @@ class NewRepositoryOutputOption(RepositoryOutputOption): % self.target) def setup(self, svn_rev_count): - Log().normal("Creating new repository '%s'" % (self.target)) + logger.normal("Creating new repository '%s'" % (self.target)) if Ctx().dry_run: # Do not actually create repository: pass diff --git a/cvs2svn_lib/svn_run_options.py b/cvs2svn_lib/svn_run_options.py index 2c7b5a0b..d0fbef55 100644 --- a/cvs2svn_lib/svn_run_options.py +++ b/cvs2svn_lib/svn_run_options.py @@ -25,7 +25,7 @@ from cvs2svn_lib.common import warning_prefix from cvs2svn_lib.common import error_prefix from cvs2svn_lib.common import FatalError from cvs2svn_lib.common import normalize_svn_path -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.context import Ctx from cvs2svn_lib.run_options import not_both from cvs2svn_lib.run_options import RunOptions @@ -357,14 +357,14 @@ A directory called \\fIcvs2svn-tmp\\fR (or the directory specified by def callback_dump_only(self, option, opt_str, value, parser): parser.values.dump_only = True - Log().error( + logger.error( warning_prefix + ': The --dump-only option is deprecated (it is implied ' 'by --dumpfile).\n' ) def callback_create(self, option, opt_str, value, parser): - Log().error( + logger.error( warning_prefix + ': The behaviour produced by the --create option is now the ' 'default;\n' @@ -497,7 +497,7 @@ A directory called \\fIcvs2svn-tmp\\fR (or the directory specified by sys.exit(1) if len(self.args) > 1: - Log().error(error_prefix + ": must pass only one CVS repository.\n") + logger.error(error_prefix + ": must pass only one CVS repository.\n") self.usage() sys.exit(1) diff --git a/cvs2svn_lib/symbol_statistics.py b/cvs2svn_lib/symbol_statistics.py index 0d35a506..c0380eee 100644 --- a/cvs2svn_lib/symbol_statistics.py +++ b/cvs2svn_lib/symbol_statistics.py @@ -21,7 +21,7 @@ import cPickle from cvs2svn_lib import config from cvs2svn_lib.common import error_prefix from cvs2svn_lib.common import FatalException -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.artifact_manager import artifact_manager from cvs2svn_lib.symbol import Trunk from cvs2svn_lib.symbol import IncludedSymbol @@ -329,7 +329,7 @@ class SymbolStatisticsCollector: for stats in self._stats.values(): if stats.is_ghost(): - Log().warn('Deleting ghost symbol: %s' % (stats.lod,)) + logger.warn('Deleting ghost symbol: %s' % (stats.lod,)) del self._stats[stats.lod] def close(self): @@ -399,7 +399,7 @@ class SymbolStatistics: def _check_blocked_excludes(self, symbol_map): """Check for any excluded LODs that are blocked by non-excluded symbols. - If any are found, describe the problem to Log().error() and raise + If any are found, describe the problem to logger.error() and raise a FatalException.""" # A list of (lod,[blocker,...]) tuples for excludes that are @@ -428,7 +428,7 @@ class SymbolStatistics: for blocker in lod_blockers: s.append(' %s\n' % (blocker,)) s.append('\n') - Log().error(''.join(s)) + logger.error(''.join(s)) raise FatalException() @@ -441,7 +441,7 @@ class SymbolStatistics: any tags with commits are found, output error messages describing the problems then raise a FatalException.""" - Log().quiet("Checking for forced tags with commits...") + logger.quiet("Checking for forced tags with commits...") invalid_tags = [ ] for symbol in symbol_map.itervalues(): @@ -463,7 +463,7 @@ class SymbolStatistics: for tag in invalid_tags: s.append(' %s\n' % (tag.name)) s.append('\n') - Log().error(''.join(s)) + logger.error(''.join(s)) raise FatalException() @@ -472,7 +472,7 @@ class SymbolStatistics: SYMBOL_MAP is a map {AbstractSymbol : (Trunk|TypedSymbol)} indicating how each AbstractSymbol is to be converted. If any - problems are detected, describe the problem to Log().error() and + problems are detected, describe the problem to logger.error() and raise a FatalException.""" # We want to do all of the consistency checks even if one of them @@ -488,7 +488,7 @@ class SymbolStatistics: try: stats.check_preferred_parent_allowed(lod) except SymbolPlanException, e: - Log().error('%s\n' % (e,)) + logger.error('%s\n' % (e,)) error_found = True try: diff --git a/cvs2svn_lib/symbol_strategy.py b/cvs2svn_lib/symbol_strategy.py index aa7d7d35..a5af1dc8 100644 --- a/cvs2svn_lib/symbol_strategy.py +++ b/cvs2svn_lib/symbol_strategy.py @@ -21,7 +21,7 @@ import re from cvs2svn_lib.common import FatalError from cvs2svn_lib.common import path_join from cvs2svn_lib.common import normalize_svn_path -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.symbol import Trunk from cvs2svn_lib.symbol import TypedSymbol from cvs2svn_lib.symbol import Branch @@ -112,7 +112,7 @@ class ForceBranchRegexpStrategyRule(_RegexpStrategyRule): _RegexpStrategyRule.__init__(self, pattern, Branch) def log(self, symbol): - Log().verbose( + logger.verbose( 'Converting symbol %s as a branch because it matches regexp "%s".' % (symbol, self.regexp.pattern,) ) @@ -125,7 +125,7 @@ class ForceTagRegexpStrategyRule(_RegexpStrategyRule): _RegexpStrategyRule.__init__(self, pattern, Tag) def log(self, symbol): - Log().verbose( + logger.verbose( 'Converting symbol %s as a tag because it matches regexp "%s".' % (symbol, self.regexp.pattern,) ) @@ -138,7 +138,7 @@ class ExcludeRegexpStrategyRule(_RegexpStrategyRule): _RegexpStrategyRule.__init__(self, pattern, ExcludedSymbol) def log(self, symbol): - Log().verbose( + logger.verbose( 'Excluding symbol %s because it matches regexp "%s".' % (symbol, self.regexp.pattern,) ) @@ -156,7 +156,7 @@ class ExcludeTrivialImportBranchRule(StrategyRule): return symbol if stats.tag_create_count == 0 \ and stats.branch_create_count == stats.trivial_import_count: - Log().verbose( + logger.verbose( 'Excluding branch %s because it is a trivial import branch.' % (symbol,) ) @@ -177,7 +177,7 @@ class ExcludeVendorBranchRule(StrategyRule): return symbol if stats.tag_create_count == 0 \ and stats.branch_create_count == stats.pure_ntdb_count: - Log().verbose( + logger.verbose( 'Excluding branch %s because it is a pure vendor branch.' % (symbol,) ) @@ -198,14 +198,14 @@ class UnambiguousUsageRule(StrategyRule): # Can't decide return symbol elif is_branch: - Log().verbose( + logger.verbose( 'Converting symbol %s as a branch because it is always used ' 'as a branch.' % (symbol,) ) return Branch(symbol) elif is_tag: - Log().verbose( + logger.verbose( 'Converting symbol %s as a tag because it is always used ' 'as a tag.' % (symbol,) @@ -223,7 +223,7 @@ class BranchIfCommitsRule(StrategyRule): if isinstance(symbol, (Trunk, TypedSymbol)): return symbol elif stats.branch_commit_count > 0: - Log().verbose( + logger.verbose( 'Converting symbol %s as a branch because there are commits on it.' % (symbol,) ) @@ -242,14 +242,14 @@ class HeuristicStrategyRule(StrategyRule): if isinstance(symbol, (Trunk, TypedSymbol)): return symbol elif stats.tag_create_count >= stats.branch_create_count: - Log().verbose( + logger.verbose( 'Converting symbol %s as a tag because it is more often used ' 'as a tag.' % (symbol,) ) return Tag(symbol) else: - Log().verbose( + logger.verbose( 'Converting symbol %s as a branch because it is more often used ' 'as a branch.' % (symbol,) @@ -289,7 +289,7 @@ class AllBranchRule(_CatchAllRule): _CatchAllRule.__init__(self, Branch) def log(self, symbol): - Log().verbose( + logger.verbose( 'Converting symbol %s as a branch because no other rules applied.' % (symbol,) ) @@ -309,7 +309,7 @@ class AllTagRule(_CatchAllRule): _CatchAllRule.__init__(self, Tag) def log(self, symbol): - Log().verbose( + logger.verbose( 'Converting symbol %s as a tag because no other rules applied.' % (symbol,) ) @@ -326,7 +326,7 @@ class AllExcludedRule(_CatchAllRule): _CatchAllRule.__init__(self, ExcludedSymbol) def log(self, symbol): - Log().verbose( + logger.verbose( 'Excluding symbol %s by catch-all rule.' % (symbol,) ) @@ -404,10 +404,10 @@ class HeuristicPreferredParentRule(StrategyRule): if isinstance(symbol, TypedSymbol) and symbol.preferred_parent_id is None: preferred_parent = self._get_preferred_parent(stats) if preferred_parent is None: - Log().verbose('%s has no preferred parent' % (symbol,)) + logger.verbose('%s has no preferred parent' % (symbol,)) else: symbol.preferred_parent_id = preferred_parent.id - Log().verbose( + logger.verbose( 'The preferred parent of %s is %s' % (symbol, preferred_parent,) ) @@ -446,7 +446,7 @@ class ManualTrunkRule(StrategyRule): def convert_as_branch(symbol): - Log().verbose( + logger.verbose( 'Converting symbol %s as a branch because of manual setting.' % (symbol,) ) @@ -454,7 +454,7 @@ def convert_as_branch(symbol): def convert_as_tag(symbol): - Log().verbose( + logger.verbose( 'Converting symbol %s as a tag because of manual setting.' % (symbol,) ) @@ -462,7 +462,7 @@ def convert_as_tag(symbol): def exclude(symbol): - Log().verbose( + logger.verbose( 'Excluding symbol %s because of manual setting.' % (symbol,) ) diff --git a/cvs2svn_lib/symbol_transform.py b/cvs2svn_lib/symbol_transform.py index 01cea800..b798f72e 100644 --- a/cvs2svn_lib/symbol_transform.py +++ b/cvs2svn_lib/symbol_transform.py @@ -20,7 +20,7 @@ import os import re -from cvs2svn_lib.log import Log +from cvs2svn_lib.log import logger from cvs2svn_lib.common import FatalError from cvs2svn_lib.common import IllegalSVNPathError from cvs2svn_lib.common import normalize_svn_path @@ -142,7 +142,7 @@ class SymbolMapper(SymbolTransform): cvs_filename = os.path.normcase(os.path.normpath(cvs_filename)) key = (cvs_filename, symbol_name, revision) if key in self._map: - Log().warn( + logger.warn( 'Overwriting symbol transform for\n' ' filename=%r symbol=%s revision=%s' % (cvs_filename, symbol_name, revision,) @@ -192,7 +192,7 @@ class SubtreeSymbolMapper(SymbolTransform): cvs_path = os.path.normcase(os.path.normpath(cvs_path)) if cvs_path in symbol_map: - Log().warn( + logger.warn( 'Overwriting symbol transform for\n' ' directory=%r symbol=%s' % (cvs_path, symbol_name,) -- 2.11.4.GIT