]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake: Fix a bug in the hg fetcher
authorRichard Purdie <rpurdie@linux.intel.com>
Tue, 21 Apr 2009 16:42:47 +0000 (17:42 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 21 Apr 2009 16:42:47 +0000 (17:42 +0100)
Fix a bug in the hg fetcher where branch revisions are used with an
initial checkout.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/fetch/hg.py

index b87fd0fbe514c6c650e2b76f82eeb2dfcdb61ffe..7643e159ecad016b55ca5907262eba0d67ac2ccb 100644 (file)
@@ -123,9 +123,6 @@ class Hg(Fetch):
             bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % updatecmd)
             runfetchcmd(updatecmd, d)
 
-            updatecmd = self._buildhgcommand(ud, d, "update")
-            bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % updatecmd)
-            runfetchcmd(updatecmd, d)
         else:
             fetchcmd = self._buildhgcommand(ud, d, "fetch")
             bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc)
@@ -134,6 +131,12 @@ class Hg(Fetch):
             os.chdir(ud.pkgdir)
             bb.msg.debug(1, bb.msg.domain.Fetcher, "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)
+        runfetchcmd(updatecmd, d)
 
         os.chdir(ud.pkgdir)
         try: