mss-svn2git 1.2.4.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog.markdown CHANGED
@@ -1,3 +1,10 @@
1
+ # 1.3.0 - 2009-05-06
2
+
3
+ * Fixed a problem where tags didn't get the original date and time.
4
+ * New switch --exclude which can be used to specify a PCRE pattern to exclude paths from the import.
5
+ * New switches --no{trunk,branches,tags} to skip import of those.
6
+ * Improved docs.
7
+
1
8
  # 1.2.4 - 2009-05-04
2
9
 
3
10
  * No changes. I ran the jeweler command twice inadvertently. Tearing down the release would be more harmful than helpful.
@@ -35,4 +42,5 @@
35
42
 
36
43
  # 1.0.0 - 2008-07-19
37
44
 
38
- * Forked version from jcoglan.
45
+ * Forked version from jcoglan.
46
+
data/README.markdown CHANGED
@@ -85,24 +85,24 @@ root level of the repo.
85
85
  2. The svn repo is NOT in standard layout and has only a trunk and tags at the
86
86
  root level of the repo.
87
87
 
88
- $ svn2git http://svn.example.com/path/to/repo --trunk trunk --tags tags
88
+ $ svn2git http://svn.example.com/path/to/repo --trunk dev --tags rel --nobranches
89
89
 
90
- 3. The svn repo is NOT in standard layout and has only a trunk and branches at
91
- the root level of the repo.
92
-
93
- $ svn2git http://svn.example.com/path/to/repo --trunk trunk --branches branches
94
-
95
- 4. The svn repo is NOT in standard layout and has only a trunk at the root
90
+ 3. The svn repo is NOT in standard layout and has only a trunk at the root
96
91
  level of the repo.
97
92
 
98
- $ svn2git http://svn.example.com/path/to/repo --trunk trunk
93
+ $ svn2git http://svn.example.com/path/to/repo --trunk trunk --nobranches --notags
99
94
 
100
- 5. The svn repo is NOT in standard layout and has no trunk, branches, or tags
95
+ 4. The svn repo is NOT in standard layout and has no trunk, branches, or tags
101
96
  at the root level of the repo. Instead the root level of the repo is
102
97
  equivalent to the trunk and there are no tags or branches.
103
98
 
104
99
  $ svn2git http://svn.example.com/path/to/repo --rootistrunk
105
100
 
101
+ 5. The svn repo is in the standard layout but you want to exclude the massive
102
+ doc directory and the backup files you once accidently added.
103
+
104
+ $ svn2git http://svn.example.com/path/to/repo --exclude doc --exclude '.*~$'
105
+
106
106
  The above will create a git repository in the current directory with the git
107
107
  version of the svn repository. Hence, you need to make a directory that you
108
108
  want your new git repo to exist in, change into it and then run one of the
@@ -110,7 +110,7 @@ above commands. Note that in the above cases the trunk, branches, tags options
110
110
  are simply folder names relative to the provided repo path. For example if you
111
111
  specified trunk=foo branches=bar and tags=foobar it would be referencing
112
112
  http://svn.example.com/path/to/repo/foo as your trunk, and so on. However, in
113
- case 5 it references the root of the repo as trunk.
113
+ case 4 it references the root of the repo as trunk.
114
114
 
115
115
  Authors
116
116
  -------
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :minor: 2
3
- :patch: 4
4
2
  :major: 1
3
+ :minor: 3
4
+ :patch: 0
@@ -32,6 +32,7 @@ module Svn2Git
32
32
  options[:trunk] = 'trunk'
33
33
  options[:branches] = 'branches'
34
34
  options[:tags] = 'tags'
35
+ options[:exclude] = []
35
36
 
36
37
  if File.exists?(File.expand_path(DEFAULT_AUTHORS_FILE))
37
38
  options[:authors] = DEFAULT_AUTHORS_FILE
@@ -52,17 +53,35 @@ module Svn2Git
52
53
  opts.on('--branches BRANCHES_PATH', 'Subpath to branches from repository URL (default: branches)') do |branches|
53
54
  options[:branches] = branches
54
55
  end
55
-
56
56
  opts.on('--tags TAGS_PATH', 'Subpath to tags from repository URL (default: tags)') do |tags|
57
57
  options[:tags] = tags
58
58
  end
59
59
 
60
+ opts.on('--rootistrunk', 'Use this if the root level of the repo is equivalent to the trunk and there are no tags or branches') do
61
+ options[:rootistrunk] = true
62
+ options[:trunk] = nil
63
+ options[:branches] = nil
64
+ options[:tags] = nil
65
+ end
66
+
67
+ opts.on('--notrunk', 'Do not import anything from trunk') do
68
+ options[:trunk] = nil
69
+ end
70
+
71
+ opts.on('--nobranches', 'Do not try to import any branches') do
72
+ options[:branches] = nil
73
+ end
74
+
75
+ opts.on('--notags', 'Do not try to import any tags') do
76
+ options[:tags] = nil
77
+ end
78
+
60
79
  opts.on('--authors AUTHORS_FILE', "Path to file containing svn-to-git authors mapping (default: #{DEFAULT_AUTHORS_FILE})") do |authors|
61
80
  options[:authors] = authors
62
81
  end
63
82
 
64
- opts.on('--rootistrunk', 'Use this if the root level of the repo is equivalent to the trunk and there are no tags or branches') do
65
- options[:rootistrunk] = true
83
+ opts.on('--exclude REGEX', 'Specify a Perl regular expression to filter paths when fetching; can be used multiple times') do |regex|
84
+ options[:exclude] << regex
66
85
  end
67
86
 
68
87
  opts.on('-v', '--verbose', 'Be verbose in logging -- useful for debugging issues') do
@@ -91,24 +110,37 @@ module Svn2Git
91
110
  tags = @options[:tags]
92
111
  rootistrunk = @options[:rootistrunk]
93
112
  authors = @options[:authors]
113
+ exclude = @options[:exclude]
94
114
 
95
115
  cmd = %w{git svn init --no-metadata}
96
116
  if rootistrunk
97
117
  # Non-standard repository layout. The repository root is effectively 'trunk.'
98
118
  cmd << "--trunk=#{@url}"
99
-
100
119
  else
101
120
  # Add each component to the command that was passed as an argument.
102
121
  cmd << "--trunk=#{trunk}" unless trunk.nil?
103
122
  cmd << "--tags=#{tags}" unless tags.nil?
104
123
  cmd << "--branches=#{branches}" unless branches.nil?
105
-
106
124
  cmd << @url
107
125
  end
108
126
  run_command(cmd)
109
127
 
110
128
  run_command("git config svn.authorsfile #{authors}") if authors
111
- run_command("git svn fetch")
129
+
130
+ cmd = %w{git svn fetch}
131
+ unless exclude.empty?
132
+ # Add exclude paths to the command line; some versions of git support
133
+ # this for fetch only, later also for init.
134
+ regex = []
135
+ unless rootistrunk
136
+ regex << "#{trunk}[/]" unless trunk.nil?
137
+ regex << "#{tags}[/][^/]+[/]" unless tags.nil?
138
+ regex << "#{branches}[/][^/]+[/]" unless branches.nil?
139
+ end
140
+ regex = '^(?:' + regex.join('|') + ')(?:' + exclude.join('|') + ')'
141
+ cmd << "'--ignore-paths=#{regex}'"
142
+ end
143
+ run_command(cmd)
112
144
 
113
145
  get_branches
114
146
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mss-svn2git
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Coglan
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-05-04 00:00:00 -07:00
13
+ date: 2009-05-06 00:00:00 -07:00
14
14
  default_executable: svn2git
15
15
  dependencies: []
16
16