From: Thiago Macieira Date: Fri, 20 Feb 2009 20:47:05 +0000 (+0100) Subject: Add a set of sample rules files. X-Git-Url: https://repo.or.cz/w/svn-all-fast-export.git/commitdiff_plain/60d67149d24f86474d20fac636093092d7f37e7a Add a set of sample rules files. All of these files are untested. I just wrote from memory. --- diff --git a/samples/ignore-branch.rules b/samples/ignore-branch.rules new file mode 100644 index 0000000..28b4bf0 --- /dev/null +++ b/samples/ignore-branch.rules @@ -0,0 +1,31 @@ +# +# Declare the repositories we know about: +# + +create repository myproject +end repository + +# +# Declare the rules +# Note: rules must end in a slash +# + +match /trunk/ + repository myproject + branch master +end match + +# Ignore this branch: +# We ignore a branch by not telling svn-all-fast-export what to do +# with this path +# Note that rules are applied in order of appearance, so this rule +# must appear before the generic branch rule +match /branches/abandoned-work/ +end match + +match /branches/([^/]+)/ + repository myproject + branch \1 +end match + +# No tag processing diff --git a/samples/merged-branches-tags.rules b/samples/merged-branches-tags.rules new file mode 100644 index 0000000..c1ab75c --- /dev/null +++ b/samples/merged-branches-tags.rules @@ -0,0 +1,31 @@ +# +# Declare the repositories we know about: +# + +create repository myproject +end repository + +# +# Declare the rules +# Note: rules must end in a slash +# + +match /trunk/ + repository myproject + branch master +end match + +# Subversion doesn't understand the Git concept of tags +# In Subversion, tags are really branches +# +# Only a post-processing (i.e., after converting to Git) of the tag +# branches can we be sure that a tag wasn't moved or changed from the +# branch it was copied from +# +# So we don't pretend that SVN tags are Git tags and then import +# everything as one + +match /(branches|tags)/([^/]+)/ + repository myproject + branch \2 +end match diff --git a/samples/min-max-revision.rules b/samples/min-max-revision.rules new file mode 100644 index 0000000..32ccd8e --- /dev/null +++ b/samples/min-max-revision.rules @@ -0,0 +1,39 @@ +# +# Declare the repositories we know about: +# + +create repository myproject +end repository + +# +# Declare the rules +# Note: rules must end in a slash +# + +# Ignore this particular revision in trunk +# See ignore-branch.rules first +# Note that rules are applied in order of appearance, so this rule +# must appear before the generic trunk rule +match /trunk/ + min revision 123 + max revision 123 +end match + +# Stop importing trunk +# If we don't specify a max revision, then there is no limit +# The same applies to min revision (i.e., min revision is 0) +match /trunk/ + min revision 1234 +end match + +match /trunk/ + repository myproject + branch master +end match + +match /branches/([^/]+)/ + repository myproject + branch \1 +end match + +# No tag processing diff --git a/samples/recurse.rules b/samples/recurse.rules new file mode 100644 index 0000000..bfce621 --- /dev/null +++ b/samples/recurse.rules @@ -0,0 +1,37 @@ +# +# Declare the repositories we know about: +# + +create repository project1 +end repository + +create repository project2 +end repository + +# +# Declare the rules +# Note: rules must end in a slash +# + +match /trunk/([^/]+)/ + repository \1 + branch master +end match + +match /branches/([^/]+)/([^/]+)/ + repository \1 + branch \2 +end match + + +# +# Example of the recurse rule: +# We tell svn-all-fast-export to not import anything +# but to go inside and recurse in the subdirs +# Note how the ending slash is missing in this particular case + +match /branches/[^/]+ + action recurse +end match + +# No tag processing diff --git a/samples/standardlayout.rules b/samples/standardlayout.rules new file mode 100644 index 0000000..b5e102f --- /dev/null +++ b/samples/standardlayout.rules @@ -0,0 +1,26 @@ +# +# Declare the repositories we know about: +# + +create repository myproject +end repository + +# +# Declare the rules +# Note: rules must end in a slash +# + +match /trunk/ + repository myproject + branch master +end match + +match /branches/([^/]+)/ + repository myproject + branch \1 +end match + +match /tags/([^/]+)/ + repository myproject + branch refs/tags/\1 +end match diff --git a/samples/two-projects.rules b/samples/two-projects.rules new file mode 100644 index 0000000..c30715b --- /dev/null +++ b/samples/two-projects.rules @@ -0,0 +1,32 @@ +# +# Declare the repositories we know about: +# + +create repository project1 +end repository + +create repository project2 +end repository + +# +# Declare the rules +# Note: rules must end in a slash +# + +match /project1/trunk/ + repository project1 + branch master +end match + +match /project2/trunk/ + repository project2 + branch master +end match + +# Note how we can use regexp to capture the repository name +match /([^/]+)/branches/([^/]+)/ + repository \1 + branch \2 +end match + +# No tag processing