summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch/hg.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-06-10 10:35:31 -0700
committerChris Larson <chris_larson@mentor.com>2010-09-03 18:51:54 -0700
commit3b2c1fe5ca56daebb24073a9dd45723d3efd2a8d (patch)
tree1f77ebed5e5f48fd786286a51dd697113cb7ea28 /lib/bb/fetch/hg.py
parentc23c015cf8af1868faf293b19b80a5faf7e736a5 (diff)
downloadbitbake-3b2c1fe5ca56daebb24073a9dd45723d3efd2a8d.tar.gz
Switch bitbake internals to use logging directly rather than bb.msg
We use a custom Logger subclass for our loggers This logger provides: - 'debug' method which accepts a debug level - 'plain' method which bypasses log formatting - 'verbose' method which is more detail than info, but less than debug Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/fetch/hg.py')
-rw-r--r--lib/bb/fetch/hg.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/bb/fetch/hg.py b/lib/bb/fetch/hg.py
index efb3b5c76..ab00d4303 100644
--- a/lib/bb/fetch/hg.py
+++ b/lib/bb/fetch/hg.py
@@ -26,12 +26,14 @@ BitBake 'Fetch' implementation for mercurial DRCS (hg).
import os
import sys
+import logging
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
from bb.fetch import runfetchcmd
+from bb.fetch import logger
class Hg(Fetch):
"""Class to fetch a from mercurial repositories"""
@@ -116,29 +118,29 @@ class Hg(Fetch):
def go(self, loc, ud, d):
"""Fetch url"""
- bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: checking for module directory '" + ud.moddir + "'")
+ logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK):
updatecmd = self._buildhgcommand(ud, d, "pull")
- bb.msg.note(1, bb.msg.domain.Fetcher, "Update " + loc)
+ logger.info("Update " + loc)
# update sources there
os.chdir(ud.moddir)
- bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % updatecmd)
+ logger.debug(1, "Running %s", updatecmd)
runfetchcmd(updatecmd, d)
else:
fetchcmd = self._buildhgcommand(ud, d, "fetch")
- bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc)
+ logger.info("Fetch " + loc)
# check out sources there
bb.mkdirhier(ud.pkgdir)
os.chdir(ud.pkgdir)
- bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % fetchcmd)
+ logger.debug(1, "Running %s", fetchcmd)
runfetchcmd(fetchcmd, d)
# Even when we clone (fetch), we still need to update as hg's clone
# won't checkout the specified revision if its on a branch
updatecmd = self._buildhgcommand(ud, d, "update")
- bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % updatecmd)
+ logger.debug(1, "Running %s", updatecmd)
runfetchcmd(updatecmd, d)
os.chdir(ud.pkgdir)