summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch/hg.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch/hg.py')
-rw-r--r--bitbake/lib/bb/fetch/hg.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch/hg.py b/bitbake/lib/bb/fetch/hg.py
index efb3b5c76d..ab00d43033 100644
--- a/bitbake/lib/bb/fetch/hg.py
+++ b/bitbake/lib/bb/fetch/hg.py
@@ -26,12 +26,14 @@ BitBake 'Fetch' implementation for mercurial DRCS (hg).
26 26
27import os 27import os
28import sys 28import sys
29import logging
29import bb 30import bb
30from bb import data 31from bb import data
31from bb.fetch import Fetch 32from bb.fetch import Fetch
32from bb.fetch import FetchError 33from bb.fetch import FetchError
33from bb.fetch import MissingParameterError 34from bb.fetch import MissingParameterError
34from bb.fetch import runfetchcmd 35from bb.fetch import runfetchcmd
36from bb.fetch import logger
35 37
36class Hg(Fetch): 38class Hg(Fetch):
37 """Class to fetch a from mercurial repositories""" 39 """Class to fetch a from mercurial repositories"""
@@ -116,29 +118,29 @@ class Hg(Fetch):
116 def go(self, loc, ud, d): 118 def go(self, loc, ud, d):
117 """Fetch url""" 119 """Fetch url"""
118 120
119 bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: checking for module directory '" + ud.moddir + "'") 121 logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
120 122
121 if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK): 123 if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK):
122 updatecmd = self._buildhgcommand(ud, d, "pull") 124 updatecmd = self._buildhgcommand(ud, d, "pull")
123 bb.msg.note(1, bb.msg.domain.Fetcher, "Update " + loc) 125 logger.info("Update " + loc)
124 # update sources there 126 # update sources there
125 os.chdir(ud.moddir) 127 os.chdir(ud.moddir)
126 bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % updatecmd) 128 logger.debug(1, "Running %s", updatecmd)
127 runfetchcmd(updatecmd, d) 129 runfetchcmd(updatecmd, d)
128 130
129 else: 131 else:
130 fetchcmd = self._buildhgcommand(ud, d, "fetch") 132 fetchcmd = self._buildhgcommand(ud, d, "fetch")
131 bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc) 133 logger.info("Fetch " + loc)
132 # check out sources there 134 # check out sources there
133 bb.mkdirhier(ud.pkgdir) 135 bb.mkdirhier(ud.pkgdir)
134 os.chdir(ud.pkgdir) 136 os.chdir(ud.pkgdir)
135 bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % fetchcmd) 137 logger.debug(1, "Running %s", fetchcmd)
136 runfetchcmd(fetchcmd, d) 138 runfetchcmd(fetchcmd, d)
137 139
138 # Even when we clone (fetch), we still need to update as hg's clone 140 # Even when we clone (fetch), we still need to update as hg's clone
139 # won't checkout the specified revision if its on a branch 141 # won't checkout the specified revision if its on a branch
140 updatecmd = self._buildhgcommand(ud, d, "update") 142 updatecmd = self._buildhgcommand(ud, d, "update")
141 bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % updatecmd) 143 logger.debug(1, "Running %s", updatecmd)
142 runfetchcmd(updatecmd, d) 144 runfetchcmd(updatecmd, d)
143 145
144 os.chdir(ud.pkgdir) 146 os.chdir(ud.pkgdir)