svn-all-fast-export / svn2git

:octopus: A fast-import based converter for an svn repo to git repos
GNU General Public License v3.0
262 stars 100 forks source link

Can't generate tags for non-standard layout #122

Closed capslocky closed 3 years ago

capslocky commented 3 years ago

We have a non-standard layout with many projects within same svn repo

/branches/2020.01/project-alpha
/branches/2020.01/project-beta
/branches/2020.01/project-gamma

Let's take first one, its consequent development would be

/branches/2020.02/project-alpha
/branches/2020.03/project-alpha
/branches/2020.04/project-alpha
...

And appropriate release tags (svn copies) are

/releases/2020.01.001/project-alpha
/releases/2020.01.002/project-alpha
/releases/2020.01.003/project-alpha
/releases/2020.01.004/project-alpha
...
/releases/2020.02.001/project-alpha
/releases/2020.02.002/project-alpha
/releases/2020.02.003/project-alpha

I have tried different rules to get these tags, but didn't succeed yet. My last attempt looks like

match /releases/$
  action recurse
end match

match /releases/(.+)/project-alpha/
  repository alpha
  branch refs/tags/v\1
  annotated true
end match

match /branches/(.+)/project-alpha
  repository alpha
  branch master
end match

These tag copy actions also seen by tool in logs:

Exporting revision 56445     /releases/2020.03.008 was copied from /branches/2020.03 rev 56444
 done

Exporting revision 56449     /releases/2020.03.009 was copied from /branches/2020.03 rev 56448
 done

I have read docs, went through examples and checked #83, but I am still stuck. Could you please suggest how to approach those tags?

capslocky commented 3 years ago

I was able to generate the tags, closing the ticket. There are two things:

match /releases/([\d\.]+)/$
  action recurse
end match

match /releases/([\d\.]+)/some-folder/$
  action recurse
end match

match /releases/([\d\.]+)/some-folder/project-alpha/
  repository alpha
  branch refs/tags/v\1
  annotated true
end match