Doeth... slightly better

for (AbstractProject project:
Jenkins.getInstance().getAllItems(AbstractProject.class)) {
    if (item.getSCM() instanceof MercurialSCM) {
      MercurialSCM hg = (MercurialSCM)item.getSCM()
      if (repo.matcher().matches(hg.getSource()))
        result.add(project);
    }
}


On 31 May 2013 12:41, Stephen Connolly <stephen.alan.conno...@gmail.com>wrote:

> Pattern repo = ...;
> List<AbstractProject<?,?>> result = new ArrayList<AbstractProject<?,?>>();
>
> for (Item item: Jenkins.getInstance().getAllItems()) {
>   if (item instanceof AbstractProject) {
>     AbstractProject<?,?> project = (AbstractProject)item;
>     if (item.getSCM() instanceof MercurialSCM) {
>       MercurialSCM hg = (MercurialSCM)item.getSCM()
>       if (repo.matcher().matches(hg.getSource()))
>         result.add(project);
>     }
>   }
> }
>
>
> On 31 May 2013 11:47, Dirk Heinrichs <dirk.heinri...@recommind.com> wrote:
>
>>  Hi,****
>>
>> ** **
>>
>> is it possible to (programmatically) find out which projects use a given
>> (Mercurial) repository? If so, how?****
>>
>> ** **
>>
>> Thanks...****
>>
>> ** **
>>
>>                 Dirk****
>>
>> ** **
>>
>> [image: cid:image003.gif@01CB3EF6.319079E0]****
>>
>> *Dirk Heinrichs*, Senior Systems Engineer, Infrastructure****
>>
>> Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach****
>>
>> *Tel:* +49 2226 1596666 1149****
>>
>> *Email:* dirk.heinri...@recommind.com****
>>
>> *Skype:* dirk.heinrichs.recommind****
>>
>> *www.recommind.com* <http://www.recommind.com/>****
>>
>> ** **
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jenkinsci-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


<<image001.gif>>

Reply via email to