handle an empty input stream (Gonéri Le Bouder)
authorIan Clatworthy <ian.clatworthy@canonical.com>
Fri, 21 Aug 2009 14:01:24 +0000 (00:01 +1000)
committerIan Clatworthy <ian.clatworthy@canonical.com>
Fri, 21 Aug 2009 14:01:24 +0000 (00:01 +1000)
1  2 
processors/generic_processor.py

index 1a1f89417763807a2b89ce6ccc3544c0bb1d4c3d,f2a3b880438b2631bce4aa57a713e42ee1c7c4cc..43197f99c1763c9447d689eb35e4ba680a689b5d
@@@ -116,13 -116,12 +116,13 @@@ class GenericProcessor(processor.Import
          'export-marks',
          ]
  
 -    def __init__(self, bzrdir, params=None, verbose=False,
 +    def __init__(self, bzrdir, params=None, verbose=False, outf=None,
              prune_empty_dirs=True):
          processor.ImportProcessor.__init__(self, bzrdir, params, verbose)
          self.prune_empty_dirs = prune_empty_dirs
  
      def pre_process(self):
 +        self.note("Starting import ...")
          self._start_time = time.time()
          self._load_info_and_params()
          self.cache_mgr = cache_manager.CacheManager(self.info, self.verbose,
              marks_file.export_marks(self.params.get("export-marks"),
                  self.cache_mgr.revision_ids)
  
+         if self.cache_mgr.last_ref == None:
+             """Nothing to refresh"""
+             return
          # Update the branches
          self.note("Updating branch information ...")
          updater = branch_updater.BranchUpdater(self.repo, self.branch,