I'm not certain this is the 'best' solution but I can at least share with you my expected result based on what I was attempting to do. ;)
I would like to use the 'revision' number of the Hg repository as the revision number in the labeller. Hg does use the hash value to label specific changesets across multiple repositories, however within the scope of any particular instance of a repository, there is a single revision number. Even though technically Hg is a DVCS, there's still a common central repository that the build server is pulling from. Thus there is technically a single relevant revision number for the branch that it is building from. If I were maintaining multiple branches, I would simply change the major/minor to reflect that. I'm not entirely sure how this would work with multiple heads in the repository, but I think there's an option in the Hg source block to fail if it detects multiple heads anyway, so that would likely be the course of action I would take. I'm not sure if git has a similar numeric revision number like Hg does or if it's hash only, so this may be Hg specific. Perhaps someone with more knowledge about this can weigh in on it. The alternative from my perspective would be to write a custom labeller which I am happy to do, I had just originally thought this was part of the existing labeller. Thoughts? On May 18, 4:51 am, Daniel Nauck <[email protected]> wrote: > Hello, > > currently its not supported. We was discussing to "generate" numeric > values of of DVCS's like hg or git .. but without any useful > result. If you've an idea .. let me know ;) > > Daniel > > Am 18.05.2010 03:54, schrieb cstavro: > > > It does indeed use a hash of some fashion and I can see the value in > > the log. But Mercurial provides a respository dependent numerical > > value associated with each changeset as well and based on the link I > > provided in my original post I was under the assumption that it was > > going to be used by the assembly version labeller. > > The revision number is definitely being picked up by the source > > control process but the version labeller is relying solely on the hash > > which is of course non-numeric. > > > If this isn't intended to be supported then that's fine, but I was > > hoping to get some clarification on that. > > > On May 17, 3:46 am, Daniel Nauck <[email protected]> wrote: > > >> Hello, > > >> as far as i know Mercurial uses, like git, sha-1 hashsums as "commit > >> identifier". > >> The AssemblyVersionLabeller depends on numeric values, like svn > >> revisions numbers. > > >> Checkout your build log (from a IfModificationExist) build and have a > >> look in the: > >> <integrationProperties> > >> section. > >> Search for: > >> <LastChangeNumber>7233</LastChangeNumber> > > >> In your case it is a sha-1 checksum, right? > > >> You can also check your ccnetservice.log file in debug logging mode. > >> There the AssemblyVersionLabeller prints out what he is donig. > > >> Daniel > > >> Am 12.05.2010 20:14, schrieb cstavro: > > >>> I can't seem to get the AssemblyVersionLabeller to pull the numerical > >>> revision number from the repository for the build label. > > >>> According to what I've been able to find here (http:// > >>> groups.google.com/group/ccnet-user/browse_thread/thread/ > >>> 4baaf260c66be41c/ad3a6bfbc0d94dfa? > >>> lnk=gst&q=assemblyVersionLabeller#ad3a6bfbc0d94dfa) this was > >>> considered and agreed upon thus I assume it should work so I must be > >>> missing something. > > >>> Here's the relevant bit from the config: > > >>> <sourcecontrol type="hg"> > >>> > >>> <repo>https://user:[email protected]/myproject/1.0-stable/</repo> > >>> > >>> <workingDirectory>C:\build\myproject\1.0-stable</workingDirectory> > >>> </sourcecontrol> > >>> <labeller type="assemblyVersionLabeller"> > >>> <major>1</major> > >>> <minor>0</minor> > >>> <incrementOnFailure>false</incrementOnFailure> > >>> </labeller> > > >>> Right now my labels are coming out with 1.0.<build>.0 where build is > >>> the CC incrementing build number. > > >>> I'm in version 1.5.6804.1 > > >>> Anyone have any suggestions on this one?
