<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>7008</bug_id>
          
          <creation_ts>2014-12-02 12:42:40 +0000</creation_ts>
          <short_desc>hg fetch always returns &quot;tip&quot; of repository</short_desc>
          <delta_ts>2015-02-04 18:28:11 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.8 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sebastian Schreiber">sschreiber</reporter>
          <assigned_to name="Aníbal Limón">anibal.limon</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>47284</commentid>
    <comment_count>0</comment_count>
    <who name="Sebastian Schreiber">sschreiber</who>
    <bug_when>2014-12-02 12:42:40 +0000</bug_when>
    <thetext>I&apos;m not sure if this is a bug or intended behavior:

bb.fetch2.hg.Hg()._latest_revision() always returns the revision of the &apos;tip&apos; of a repository.
In our case this is problematic: we have SRC_URIs with a ;tag=&quot;default&quot;, but in repositories where &apos;tip&apos; points to another branch, e.g. some feature branch with more recent commits, the wrong revision is returned.

We avoid this problem by passing the user-specified revision to the hg identify command in _latest_revision():

--- a/yocto/bitbake/lib/bb/fetch2/hg.py	Tue Dec 02 11:01:39 2014 +0100
+++ b/yocto/bitbake/lib/bb/fetch2/hg.py	Tue Dec 02 11:03:48 2014 +0100
@@ -98,7 +98,7 @@
                 hgroot = ud.user + &quot;@&quot; + host + ud.path
 
         if command == &quot;info&quot;:
-            return &quot;%s identify -i %s://%s/%s&quot; % (basecmd, proto, hgroot, ud.module)
+            return &quot;%s identify -i %s://%s/%s --rev %s&quot; % (basecmd, proto, hgroot, ud.module, ud.revision)
 
         options = [];</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48558</commentid>
    <comment_count>1</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2015-02-04 18:28:11 +0000</bug_when>
    <thetext>Hi Sebastian,

The current behavior is right because if you specify a rev for get latest_revision returns the same rev that you specify. In mercurial named revisions are tags.

The issue here is that the current code don&apos;t handle mercurial branches with this support you can specify a branch and get the latest_revision associated with this branch.

Kind regards,
    alimon</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>