Mercurial provider checkout should not default to tip
-----------------------------------------------------

                 Key: SCM-621
                 URL: http://jira.codehaus.org/browse/SCM-621
             Project: Maven SCM
          Issue Type: Bug
          Components: maven-scm-provider-mercurial (hg)
    Affects Versions: 1.5
            Reporter: Kevin Calcagno
            Priority: Critical
         Attachments: hg-checkout-no-tip.patch

The checkout command for the Mercurial provider defaults to using "tip" as the 
revision to clone if no explicit revision is specified, for example via the 
scmVersion property when using the SCM plugin.

This poses a problem for repositories with branches because tip always points 
to the most recent changeset in the repository regardless of branch.  Thus 
subsequent checkouts, even moments apart, using the same options could wind up 
fetching completely different branches of code.

A better option is to simply not pass a revision to Hg if no scmVersion is 
specified.  This will cause Hg to resort to its default behavior: grab the 
tip-most changeset from the default branch, or "tip" itself if the default 
branch doesn't exist.

One potential downside of this solution is that it will result in cloning the 
entire repository rather than just tip and its required ancestors.  Predictable 
behavior is worth the cost, however, and users with large repositories can work 
around that limitation by explicitly making "default" their default value for 
scmVersion.  (Or "tip" if they want to preserve the current behavior.)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to