From f9ba58d75e62aceb87391e2ac1fca126d5ac9b34 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 12 Sep 2010 02:39:11 +0200 Subject: Don't rely on bzrlib.trace. --- fastimport/processor.py | 39 ++++--------------------------- fastimport/processors/filter_processor.py | 9 +++---- fastimport/processors/info_processor.py | 1 - 3 files changed, 7 insertions(+), 42 deletions(-) diff --git a/fastimport/processor.py b/fastimport/processor.py index 77291ac..4ddca7b 100644 --- a/fastimport/processor.py +++ b/fastimport/processor.py @@ -23,12 +23,6 @@ for basing real processors on. See the processors package for examples. import sys import time -from bzrlib import debug -from bzrlib.trace import ( - mutter, - note, - warning, - ) import errors @@ -85,21 +79,13 @@ class ImportProcessor(object): break self.post_process() - def note(self, msg, *args): - """Output a note but timestamp it.""" - msg = "%s %s" % (self._time_of_day(), msg) - note(msg, *args) - def warning(self, msg, *args): """Output a warning but timestamp it.""" - msg = "%s WARNING: %s" % (self._time_of_day(), msg) - warning(msg, *args) + pass def debug(self, mgs, *args): - """Output a debug message if the appropriate -D option was given.""" - if "fast-import" in debug.debug_flags: - msg = "%s DEBUG: %s" % (self._time_of_day(), msg) - mutter(msg, *args) + """Output a debug message.""" + pass def _time_of_day(self): """Time of day as a string.""" @@ -172,26 +158,9 @@ class CommitHandler(object): handler(self, fc) self.post_process_files() - def note(self, msg, *args): - """Output a note but add context.""" - msg = "%s (%s)" % (msg, self.command.id) - note(msg, *args) - def warning(self, msg, *args): """Output a warning but add context.""" - msg = "WARNING: %s (%s)" % (msg, self.command.id) - warning(msg, *args) - - def mutter(self, msg, *args): - """Output a mutter but add context.""" - msg = "%s (%s)" % (msg, self.command.id) - mutter(msg, *args) - - def debug(self, msg, *args): - """Output a mutter if the appropriate -D option was given.""" - if "fast-import" in debug.debug_flags: - msg = "%s (%s)" % (msg, self.command.id) - mutter(msg, *args) + pass def pre_process_files(self): """Prepare for committing.""" diff --git a/fastimport/processors/filter_processor.py b/fastimport/processors/filter_processor.py index c8336f9..3b35a0c 100644 --- a/fastimport/processors/filter_processor.py +++ b/fastimport/processors/filter_processor.py @@ -18,9 +18,6 @@ from bzrlib import osutils -from bzrlib.trace import ( - warning, - ) from fastimport import ( commands, helpers, @@ -184,7 +181,7 @@ class FilterProcessor(processor.ImportProcessor): elif isinstance(fc, commands.FileCopyCommand): fc = self._convert_copy(fc) else: - warning("cannot handle FileCommands of class %s - ignoring", + self.warning("cannot handle FileCommands of class %s - ignoring", fc.__class__) continue if fc is not None: @@ -264,7 +261,7 @@ class FilterProcessor(processor.ImportProcessor): # to. Maybe fast-import-info needs to be extended to # remember all renames and a config file can be passed # into here ala fast-import? - warning("cannot turn rename of %s into an add of %s yet" % + self.warning("cannot turn rename of %s into an add of %s yet" % (old, new)) return None @@ -294,6 +291,6 @@ class FilterProcessor(processor.ImportProcessor): # to. Maybe fast-import-info needs to be extended to # remember all copies and a config file can be passed # into here ala fast-import? - warning("cannot turn copy of %s into an add of %s yet" % + self.warning("cannot turn copy of %s into an add of %s yet" % (src, dest)) return None diff --git a/fastimport/processors/info_processor.py b/fastimport/processors/info_processor.py index 6d8c15d..2575b4b 100644 --- a/fastimport/processors/info_processor.py +++ b/fastimport/processors/info_processor.py @@ -44,7 +44,6 @@ class InfoProcessor(processor.ImportProcessor): outf=outf) def pre_process(self): - self.note("Collecting statistics ...") # Init statistics self.cmd_counts = {} for cmd in commands.COMMAND_NAMES: -- cgit v1.2.1