diff options
Diffstat (limited to 'bitbake/lib/bb/fetch/hg.py')
-rw-r--r-- | bitbake/lib/bb/fetch/hg.py | 14 |
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 | ||
27 | import os | 27 | import os |
28 | import sys | 28 | import sys |
29 | import logging | ||
29 | import bb | 30 | import bb |
30 | from bb import data | 31 | from bb import data |
31 | from bb.fetch import Fetch | 32 | from bb.fetch import Fetch |
32 | from bb.fetch import FetchError | 33 | from bb.fetch import FetchError |
33 | from bb.fetch import MissingParameterError | 34 | from bb.fetch import MissingParameterError |
34 | from bb.fetch import runfetchcmd | 35 | from bb.fetch import runfetchcmd |
36 | from bb.fetch import logger | ||
35 | 37 | ||
36 | class Hg(Fetch): | 38 | class 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) |