# First, create all the repositories
# BRL-CAD is the main project, but there
# have been and are other sub-projects
# that aren't BRL-CAD branches
create repository brlcad
end repository

create repository rt_3
end repository

create repository iBME
end repository

create repository isst
end repository

create repository jbrlcad
end repository

create repository ova
end repository

create repository osl
end repository

create repository rtcmp
end repository

create repository web
end repository

create repository webcad
end repository

create repository unknown
end repository

# For sufficiently old revisions,
# it's all BRL-CAD
match /trunk/
   min revision 1
   max revision 22796
   repository brlcad
   branch master
end match

match /brlcad/trunk/
   repository brlcad
   branch master
end match

# Make BRL-CAD branches

# Put these where they belong in git
match /brlcad/framebuffer-experiment/
   repository brlcad
   branch dm-work
end match
match /brlcad/branches/framebuffer-experiment/
   repository brlcad
   branch dm-work
end match

# General rule for well-behaved branches
match /brlcad/branches/([^/]+)/
   repository brlcad
   branch \1
end match

# Make BRL-CAD tags
match /brlcad/tags/([^/]+)/
   repository brlcad
   branch tag--\1
end match


# Non BRL-CAD repos
match /osl/branches/([^/]+)/
   repository osl
   branch \1
end match
match /osl/tags/([^/]+)/
   repository osl
   branch tag--\1
end match
match /osl/trunk/
   repository osl
   branch master
end match
match /osl/
   repository osl
   branch master
end match

match /rt\^3/branches/([^/]+)/
   repository rt_3
   branch \1
   substitute branch s/\^/_/
end match
match /rt\^3/tags/([^/]+)/
   repository rt_3
   branch tag--\1
   substitute branch s/\^/_/
end match
match /rt\^3/trunk/
   repository rt_3
   branch master
end match
match /rt\^3/
   repository rt_3
   branch master
end match

match /ova/branches/([^/]+)/
   repository ova
   branch \1
end match
match /ova/tags/([^/]+)/
   repository ova
   branch tag--\1
end match
match /ova/trunk/
   repository ova
   branch master
end match
match /ova/
   repository ova
   branch master
end match

match /iBME/branches/([^/]+)/
   repository iBME
   branch \1
end match
match /iBME/tags/([^/]+)/
   repository iBME
   branch tag--\1
end match
match /iBME/trunk/
   repository iBME
   branch master
end match
match /iBME/
   repository iBME
   branch master
end match

match /isst/branches/([^/]+)/
   repository isst
   branch \1
end match
match /isst/tags/([^/]+)/
   repository isst
   branch tag--\1
end match
match /isst/trunk/
   repository isst
   branch master
end match
match /isst/
   repository isst
   branch master
end match

match /jbrlcad/branches/([^/]+)/
   repository jbrlcad
   branch \1
end match
match /jbrlcad/tags/([^/]+)/
   repository jbrlcad
   branch tag--\1
end match
match /jbrlcad/trunk/
   repository jbrlcad
   branch master
end match
match /jbrlcad/
   repository jbrlcad
   branch master
end match

match /web/branches/([^/]+)/
   repository web
   branch \1
end match
match /web/tags/([^/]+)/
   repository web
   branch tag--\1
end match
match /web/trunk/
   repository web
   branch master
end match
match /web/
   repository web
   branch master
end match

match /webcad/branches/([^/]+)/
   repository webcad
   branch \1
end match
match /webcad/tags/([^/]+)/
   repository webcad
   branch tag--\1
end match
match /webcad/trunk/
   repository webcad
   branch master
end match
match /webcad/
   repository webcad
   branch master
end match

match /rtcmp/branches/([^/]+)/
   repository rtcmp
   branch \1
end match
match /rtcmp/tags/([^/]+)/
   repository rtcmp
   branch tag--\1
end match
match /rtcmp/trunk/
   repository rtcmp
   branch master
end match
match /rtcmp/
   repository rtcmp
   branch master
end match

# Finally, create an unknown repo that lets us see
# what the above filters didn't handle - ideally
# everything should be handled
match /
   repository unknown
   branch master
end match

