svn2git 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.markdown +11 -4
- data/README.markdown +4 -0
- data/VERSION.yml +1 -1
- data/lib/svn2git/migration.rb +20 -13
- data/svn2git.gemspec +2 -2
- metadata +2 -2
data/ChangeLog.markdown
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# 2.2.1
|
2
|
+
|
3
|
+
This is a critical bugfix release if your repository has tags. Thanks to David Zülke (dzuelke) for the patches making up this release.
|
4
|
+
|
5
|
+
* Added the ability to specify an end revision for migration (thanks dzuelke).
|
6
|
+
* Fixed an issue with initial conversion if the repo had tags (thanks dzuelke).
|
7
|
+
|
1
8
|
# 2.2.0 - 2012-01-25
|
2
9
|
|
3
10
|
Thanks to Craig Hobbs (craigahobbs) and Simon Chiang (thinkerbot) for the patches making up this release.
|
@@ -9,13 +16,13 @@
|
|
9
16
|
|
10
17
|
# 2.1.2 - 2011-12-28
|
11
18
|
|
12
|
-
* Fixed a regression in improperly quoting branch names (thanks ziangsong)
|
19
|
+
* Fixed a regression in improperly quoting branch names (thanks ziangsong).
|
13
20
|
|
14
21
|
# 2.1.1 - 2011-12-27
|
15
22
|
|
16
|
-
* Fixed SVN branch detection (thanks thinkerbot)
|
17
|
-
* Stop processing when a git subprocess fails (thanks thinkerbot)
|
18
|
-
* Fixed an issue with SVN branches containing shell special characters (thanks sleicht)
|
23
|
+
* Fixed SVN branch detection (thanks thinkerbot).
|
24
|
+
* Stop processing when a git subprocess fails (thanks thinkerbot).
|
25
|
+
* Fixed an issue with SVN branches containing shell special characters (thanks sleicht).
|
19
26
|
|
20
27
|
# 2.1.0 - 2011-04-03
|
21
28
|
|
data/README.markdown
CHANGED
@@ -124,6 +124,10 @@ one of them.
|
|
124
124
|
|
125
125
|
$ svn2git http://svn.example.com/path/to/repo --revision <<starting_revision_number>>
|
126
126
|
|
127
|
+
9. You need to migrate starting at a specific svn revision number, ending at a specific revision number.
|
128
|
+
|
129
|
+
$ svn2git http://svn.example.com/path/to/repo --revision <<starting_revision_number>>:<<ending_revision_number>>
|
130
|
+
|
127
131
|
The above will create a git repository in the current directory with the git
|
128
132
|
version of the svn repository. Hence, you need to make a directory that you
|
129
133
|
want your new git repo to exist in, change into it and then run one of the
|
data/VERSION.yml
CHANGED
data/lib/svn2git/migration.rb
CHANGED
@@ -101,7 +101,7 @@ module Svn2Git
|
|
101
101
|
options[:nominimizeurl] = true
|
102
102
|
end
|
103
103
|
|
104
|
-
opts.on('--revision
|
104
|
+
opts.on('--revision START_REV[:END_REV]', 'Start importing from SVN revision START_REV; optionally end at END_REV') do |revision|
|
105
105
|
options[:revision] = revision
|
106
106
|
end
|
107
107
|
|
@@ -181,7 +181,11 @@ module Svn2Git
|
|
181
181
|
run_command("git config --local svn.authorsfile #{authors}") unless authors.nil?
|
182
182
|
|
183
183
|
cmd = "git svn fetch "
|
184
|
-
|
184
|
+
unless revision.nil?
|
185
|
+
range = revision.split(":")
|
186
|
+
range[1] = "HEAD" unless range[1]
|
187
|
+
cmd += "-r #{range[0]}:#{range[1]} "
|
188
|
+
end
|
185
189
|
unless exclude.empty?
|
186
190
|
# Add exclude paths to the command line; some versions of git support
|
187
191
|
# this for fetch only, later also for init.
|
@@ -211,8 +215,8 @@ module Svn2Git
|
|
211
215
|
|
212
216
|
def fix_tags
|
213
217
|
current = {}
|
214
|
-
current['user.name'] = run_command("git config --local --get user.name")
|
215
|
-
current['user.email'] = run_command("git config --local --get user.email")
|
218
|
+
current['user.name'] = run_command("git config --local --get user.name", false)
|
219
|
+
current['user.email'] = run_command("git config --local --get user.email", false)
|
216
220
|
|
217
221
|
@tags.each do |tag|
|
218
222
|
tag = tag.strip
|
@@ -228,13 +232,16 @@ module Svn2Git
|
|
228
232
|
end
|
229
233
|
|
230
234
|
ensure
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
235
|
+
# We only change the git config values if there are @tags available. So it stands to reason we should revert them only in that case.
|
236
|
+
unless @tags.empty?
|
237
|
+
current.each_pair do |name, value|
|
238
|
+
# If a line was read, then there was a config value so restore it.
|
239
|
+
# Otherwise unset the value because originally there was none.
|
240
|
+
if value.strip != ''
|
241
|
+
run_command("git config --local #{name} '#{value.strip}'")
|
242
|
+
else
|
243
|
+
run_command("git config --local --unset #{name}")
|
244
|
+
end
|
238
245
|
end
|
239
246
|
end
|
240
247
|
end
|
@@ -278,7 +285,7 @@ module Svn2Git
|
|
278
285
|
run_command("git gc")
|
279
286
|
end
|
280
287
|
|
281
|
-
def run_command(cmd)
|
288
|
+
def run_command(cmd, exit_on_error=true)
|
282
289
|
log "Running command: #{cmd}"
|
283
290
|
|
284
291
|
ret = ''
|
@@ -291,7 +298,7 @@ module Svn2Git
|
|
291
298
|
end
|
292
299
|
end
|
293
300
|
|
294
|
-
|
301
|
+
if exit_on_error && ($?.exitstatus != 0)
|
295
302
|
$stderr.puts "command failed:\n#{cmd}"
|
296
303
|
exit -1
|
297
304
|
end
|
data/svn2git.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "svn2git"
|
8
|
-
s.version = "2.2.
|
8
|
+
s.version = "2.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["James Coglan", "Kevin Menard"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-02-25"
|
13
13
|
s.email = "nirvdrum@gmail.com"
|
14
14
|
s.executables = ["svn2git"]
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svn2git
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-02-25 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description:
|
16
16
|
email: nirvdrum@gmail.com
|