]> andersk Git - svn-all-fast-export.git/commitdiff
Add a set of sample rules files.
authorThiago Macieira <thiago@kde.org>
Fri, 20 Feb 2009 20:47:05 +0000 (21:47 +0100)
committerThiago Macieira <thiago@kde.org>
Fri, 20 Feb 2009 20:47:05 +0000 (21:47 +0100)
All of these files are untested. I just wrote from memory.

samples/ignore-branch.rules [new file with mode: 0644]
samples/merged-branches-tags.rules [new file with mode: 0644]
samples/min-max-revision.rules [new file with mode: 0644]
samples/recurse.rules [new file with mode: 0644]
samples/standardlayout.rules [new file with mode: 0644]
samples/two-projects.rules [new file with mode: 0644]

diff --git a/samples/ignore-branch.rules b/samples/ignore-branch.rules
new file mode 100644 (file)
index 0000000..28b4bf0
--- /dev/null
@@ -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 (file)
index 0000000..c1ab75c
--- /dev/null
@@ -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 (file)
index 0000000..32ccd8e
--- /dev/null
@@ -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 (file)
index 0000000..bfce621
--- /dev/null
@@ -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 (file)
index 0000000..b5e102f
--- /dev/null
@@ -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 (file)
index 0000000..c30715b
--- /dev/null
@@ -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
This page took 0.037747 seconds and 5 git commands to generate.