prick 0.2.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +6 -5
  3. data/Gemfile +4 -1
  4. data/TODO +10 -0
  5. data/doc/prick.txt +114 -0
  6. data/exe/prick +328 -402
  7. data/lib/ext/fileutils.rb +18 -0
  8. data/lib/ext/forward_method.rb +18 -0
  9. data/lib/ext/shortest_path.rb +44 -0
  10. data/lib/prick.rb +20 -10
  11. data/lib/prick/branch.rb +254 -0
  12. data/lib/prick/builder.rb +164 -0
  13. data/lib/prick/cache.rb +34 -0
  14. data/lib/prick/command.rb +19 -11
  15. data/lib/prick/constants.rb +122 -48
  16. data/lib/prick/database.rb +28 -20
  17. data/lib/prick/diff.rb +125 -0
  18. data/lib/prick/exceptions.rb +15 -3
  19. data/lib/prick/git.rb +77 -30
  20. data/lib/prick/head.rb +183 -0
  21. data/lib/prick/migration.rb +40 -200
  22. data/lib/prick/program.rb +493 -0
  23. data/lib/prick/project.rb +523 -351
  24. data/lib/prick/rdbms.rb +4 -13
  25. data/lib/prick/schema.rb +16 -90
  26. data/lib/prick/share.rb +64 -0
  27. data/lib/prick/state.rb +192 -0
  28. data/lib/prick/version.rb +62 -29
  29. data/libexec/strip-comments +33 -0
  30. data/make_releases +48 -345
  31. data/make_schema +10 -0
  32. data/prick.gemspec +14 -23
  33. data/share/diff/diff.after-tables.sql +4 -0
  34. data/share/diff/diff.before-tables.sql +4 -0
  35. data/share/diff/diff.tables.sql +8 -0
  36. data/share/migration/diff.tables.sql +8 -0
  37. data/share/migration/features.yml +6 -0
  38. data/share/migration/migrate.sql +3 -0
  39. data/share/migration/migrate.yml +8 -0
  40. data/share/migration/tables.sql +3 -0
  41. data/share/schema/build.yml +14 -0
  42. data/share/schema/schema.sql +5 -0
  43. data/share/schema/schema/build.yml +3 -0
  44. data/share/schema/schema/prick/build.yml +14 -0
  45. data/share/schema/schema/prick/data.sql +7 -0
  46. data/share/schema/schema/prick/schema.sql +5 -0
  47. data/share/{schemas/prick/schema.sql → schema/schema/prick/tables.sql} +2 -5
  48. data/{file → share/schema/schema/public/.keep} +0 -0
  49. data/share/schema/schema/public/build.yml +14 -0
  50. data/share/schema/schema/public/schema.sql +3 -0
  51. data/test_assorted +192 -0
  52. data/test_feature +112 -0
  53. data/test_refactor +34 -0
  54. data/test_single_dev +83 -0
  55. metadata +43 -68
  56. data/lib/prick/build.rb +0 -376
  57. data/lib/prick/migra.rb +0 -22
  58. data/share/schemas/prick/data.sql +0 -8
data/test_refactor ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/bash
2
+
3
+ function add_table() {
4
+ local name=$1
5
+ echo "Creating table $name"
6
+ echo "create table $name (id integer);" >>schema/public/tables.sql
7
+ git add schema/public/tables.sql
8
+ git commit -m "Added table $name" >/dev/null
9
+ }
10
+
11
+ function add_migration() {
12
+ echo "Creating migration"
13
+ cp schema/public/tables.sql migration/diff.sql
14
+ echo '\i diff.sql' >migration/migrate.sql
15
+ git commit -am "Added migration"
16
+ }
17
+
18
+ set -e
19
+ clear
20
+
21
+ if [ -d dir ]; then
22
+ find dir -type f -delete
23
+ else
24
+ mkdir dir
25
+ fi
26
+
27
+ cd dir
28
+ prick --name prj init "."
29
+
30
+ prick prepare release
31
+ add_table a
32
+ add_migration
33
+ prick create release 0.1.0
34
+
data/test_single_dev ADDED
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/bash
2
+
3
+ function add_table() {
4
+ local name=$1
5
+ echo "create table $name (id integer);" >>schemas/public/tables.sql
6
+ git add schemas/public/tables.sql
7
+ git commit -m "Added table $name" >/dev/null
8
+ }
9
+
10
+ set -e
11
+ clear
12
+
13
+ rm -rf dir
14
+ prick --name prj init dir
15
+ echo
16
+ (
17
+ echo "*** DEVELOP ON UNNAMED RELEASES"
18
+ echo "***"
19
+
20
+ cd dir
21
+ echo "Prepare an unnamed release"
22
+ prick prepare release
23
+ echo
24
+
25
+ echo "Add table a"
26
+ add_table a
27
+ echo
28
+
29
+ echo "Bring current database up to date"
30
+ prick build
31
+ echo
32
+
33
+ echo "Prepare diff"
34
+ prick prepare diff
35
+ echo
36
+
37
+ echo "Commit diff"
38
+ git commit -am "Committed diff"
39
+ echo
40
+
41
+ echo "Update migrations"
42
+ echo "\\i diff.sql" >>releases/0.0.0/migrate.sql
43
+ git commit -am "Updated migrations.sql"
44
+ echo
45
+
46
+ echo "Create release 0.1.0"
47
+ prick create release 0.1.0
48
+ echo
49
+
50
+ echo "Prepare an unnamed release"
51
+ prick prepare release
52
+ echo
53
+
54
+ echo "Add table b"
55
+ add_table b
56
+ echo
57
+
58
+ echo "Bring current database up to date"
59
+ prick build
60
+ echo
61
+
62
+ echo "Prepare diff"
63
+ prick prepare diff
64
+ echo
65
+
66
+ echo "Commit diff"
67
+ git commit -am "Committed diff"
68
+ echo
69
+
70
+ echo "Update migrations"
71
+ echo "\\i diff.sql" >>releases/0.1.0/migrate.sql
72
+ git commit -am "Updated migrations.sql"
73
+ echo
74
+
75
+ echo "Create release 0.2.0"
76
+ prick create release 0.2.0
77
+ echo
78
+
79
+
80
+ tree -a -I .git
81
+ )
82
+
83
+
metadata CHANGED
@@ -1,85 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-23 00:00:00.000000000 Z
11
+ date: 2021-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.1'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '2.1'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '10.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '10.0'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '3.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '3.0'
55
- - !ruby/object:Gem::Dependency
56
- name: pg
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
13
  - !ruby/object:Gem::Dependency
70
14
  name: shellopts
71
15
  requirement: !ruby/object:Gem::Requirement
72
16
  requirements:
73
17
  - - '='
74
18
  - !ruby/object:Gem::Version
75
- version: 2.0.0.pre.11
19
+ version: 2.0.0.pre.14
76
20
  type: :runtime
77
21
  prerelease: false
78
22
  version_requirements: !ruby/object:Gem::Requirement
79
23
  requirements:
80
24
  - - '='
81
25
  - !ruby/object:Gem::Version
82
- version: 2.0.0.pre.11
26
+ version: 2.0.0.pre.14
83
27
  - !ruby/object:Gem::Dependency
84
28
  name: semantic
85
29
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +52,7 @@ dependencies:
108
52
  - - ">="
109
53
  - !ruby/object:Gem::Version
110
54
  version: '0'
111
- description: prick gem
55
+ description: A release control and management system for postgresql
112
56
  email:
113
57
  - claus.l.rasmussen@gmail.com
114
58
  executables:
@@ -123,6 +67,7 @@ files:
123
67
  - Gemfile
124
68
  - README.md
125
69
  - Rakefile
70
+ - TODO
126
71
  - bin/console
127
72
  - bin/setup
128
73
  - doc/create_release.txt
@@ -130,30 +75,43 @@ files:
130
75
  - doc/migra
131
76
  - doc/migrations.txt
132
77
  - doc/notes.txt
78
+ - doc/prick.txt
133
79
  - doc/sh.prick
134
80
  - exe/prick
135
- - file
136
81
  - lib/ext/algorithm.rb
137
82
  - lib/ext/fileutils.rb
83
+ - lib/ext/forward_method.rb
138
84
  - lib/ext/pg.rb
85
+ - lib/ext/shortest_path.rb
139
86
  - lib/prick.rb
140
87
  - lib/prick/archive.rb
141
- - lib/prick/build.rb
88
+ - lib/prick/branch.rb
89
+ - lib/prick/builder.rb
90
+ - lib/prick/cache.rb
142
91
  - lib/prick/command.rb
143
92
  - lib/prick/constants.rb
144
93
  - lib/prick/database.rb
94
+ - lib/prick/diff.rb
145
95
  - lib/prick/dsort.rb
146
96
  - lib/prick/ensure.rb
147
97
  - lib/prick/exceptions.rb
148
98
  - lib/prick/git.rb
149
- - lib/prick/migra.rb
99
+ - lib/prick/head.rb
150
100
  - lib/prick/migration.rb
101
+ - lib/prick/program.rb
151
102
  - lib/prick/project.rb
152
103
  - lib/prick/rdbms.rb
153
104
  - lib/prick/schema.rb
105
+ - lib/prick/share.rb
106
+ - lib/prick/state.rb
154
107
  - lib/prick/version.rb
108
+ - libexec/strip-comments
155
109
  - make_releases
110
+ - make_schema
156
111
  - prick.gemspec
112
+ - share/diff/diff.after-tables.sql
113
+ - share/diff/diff.before-tables.sql
114
+ - share/diff/diff.tables.sql
157
115
  - share/features/diff.sql
158
116
  - share/features/feature/diff.sql
159
117
  - share/features/feature/migrate.sql
@@ -161,8 +119,25 @@ files:
161
119
  - share/features/features.yml
162
120
  - share/features/migrations.sql
163
121
  - share/gitignore
164
- - share/schemas/prick/data.sql
165
- - share/schemas/prick/schema.sql
122
+ - share/migration/diff.tables.sql
123
+ - share/migration/features.yml
124
+ - share/migration/migrate.sql
125
+ - share/migration/migrate.yml
126
+ - share/migration/tables.sql
127
+ - share/schema/build.yml
128
+ - share/schema/schema.sql
129
+ - share/schema/schema/build.yml
130
+ - share/schema/schema/prick/build.yml
131
+ - share/schema/schema/prick/data.sql
132
+ - share/schema/schema/prick/schema.sql
133
+ - share/schema/schema/prick/tables.sql
134
+ - share/schema/schema/public/.keep
135
+ - share/schema/schema/public/build.yml
136
+ - share/schema/schema/public/schema.sql
137
+ - test_assorted
138
+ - test_feature
139
+ - test_refactor
140
+ - test_single_dev
166
141
  homepage: http://www.nowhere.com/
167
142
  licenses: []
168
143
  metadata: {}
@@ -174,7 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
149
  requirements:
175
150
  - - ">="
176
151
  - !ruby/object:Gem::Version
177
- version: '0'
152
+ version: 2.7.1
178
153
  required_rubygems_version: !ruby/object:Gem::Requirement
179
154
  requirements:
180
155
  - - ">="
@@ -184,5 +159,5 @@ requirements: []
184
159
  rubygems_version: 3.1.4
185
160
  signing_key:
186
161
  specification_version: 4
187
- summary: prick gem
162
+ summary: A release control and management system for postgresql
188
163
  test_files: []
data/lib/prick/build.rb DELETED
@@ -1,376 +0,0 @@
1
-
2
- require "prick/ensure.rb"
3
- require "prick/dsort.rb"
4
- require "ext/fileutils.rb" # for ::touch_p
5
-
6
- module Prick
7
- class Build
8
- include Ensure
9
-
10
- # The associated project object
11
- attr_reader :project
12
-
13
- # Version
14
- attr_reader :version
15
-
16
- # Build name. Same as `version.to_s`
17
- def name() version.to_s end
18
-
19
- # Associated database object
20
- attr_reader :database
21
-
22
- # Schema object. Only defined when the build has been checked out
23
- attr_reader :schema
24
-
25
- # Migration object. Running the migration on a base release database will
26
- # mutate it into the current release
27
- attr_reader :migration
28
-
29
- # Path to a filesystem node that represents the build on disk. Used to
30
- # detect if a build is present in the current release's tree. It is
31
- # possible to infer the base release from the node - either by a naming
32
- # convention or by reading the file. Build::deref_node_file does that
33
- def node() raise AbstractMethod end
34
-
35
- # Base release. Returns nil if version is 0.0.0. Raises an exception if
36
- # branch is not represented on disk and it can't be inferred from the
37
- # version (only features)
38
- def base_release()
39
- return nil if version.zero?
40
- @base_release.present? or raise Internal, "Release #{name} is not present"
41
- @base_release
42
- end
43
-
44
- # List of features in this build. This requires the build to be present on disk
45
- def features()
46
- present? or raise "Build #{name} is not present"
47
- version.zero? ? [] : migration.feature_versions.map { |version| project[version] }
48
- end
49
-
50
- # Return the build's history as a hash from release to list of features
51
- def history()
52
- h = {}
53
- Algorithm.follow(self, :base_release).each { |release|
54
- h[release] = []
55
- indent {
56
- release.features.each { |feature| h[release] << feature }
57
- }
58
- }
59
- h
60
- end
61
-
62
- def initialize(project, base_release, version, migration, database: nil, schema: nil)
63
- base_release.nil? || base_release.is_a?(Release) or
64
- raise Internal, "Expected a Release object, got #{base_release.class}"
65
- version.is_a?(Version) or raise Internal, "Expected a Version object, got #{version.class}"
66
- @project = project
67
- @base_release = base_release
68
- @version = version
69
- @migration = migration
70
- @schema = Schema.new(project)
71
- @database = database || Database.new("#{project.name}-#{name}", project.user)
72
- project[name] = self
73
- end
74
-
75
- # Return true if the build exists as a branch in git
76
- def exist?() Git.branch?(name) end
77
-
78
- # Create and checkout the branch
79
- def create()
80
- !present? or raise Fail, "Build #{name} is already present on disk"
81
- !exist? or raise Fail, "Build #{name} is already present in git"
82
- Git.create_branch(name)
83
- Git.checkout_branch(name)
84
- end
85
-
86
- # FIXME: Kills the current branch under the feets of the application. Also doesn't update
87
- # internal structures in Project
88
- def destroy()
89
- project.release != self or raise Error, "Can't destroy current branch - #{self.version}"
90
- Git.delete_branch(name)
91
- end
92
-
93
- # True if the release is present in this git branch
94
- def present?() File.exist?(node) end
95
-
96
- # True if the release is the active branch
97
- def active?() Git.current_branch == name end
98
-
99
- def checkout()
100
- Git.checkout(name)
101
- end
102
-
103
- def checkback() # Doubtfull - creates strange results on Release and Prerelease branches
104
- base_release.checkout
105
- end
106
-
107
- def built?()
108
- active? && @schema.built?(@database)
109
- end
110
-
111
- def build()
112
- active? or raise Error, "Can't build: Not active"
113
- @schema.build(@database)
114
- end
115
-
116
- def rebuild()
117
- active? or raise Error, "Can't rebuild: Not active"
118
- @database.recreate
119
- build
120
- end
121
-
122
- def include_feature(feature)
123
- migration.include_feature(feature.migration)
124
- end
125
-
126
- def remove_feature(feature)
127
- raise NotYet
128
- end
129
-
130
- # Create a copy of the project in tmp/ and checkout the branch. Used to build
131
- # releases. Returns the path to the copy
132
- def snapshot() end
133
-
134
- # Sorting
135
- def <=>(other) version <=> other.version end
136
-
137
- # Use #name for String conversion
138
- def to_s() name end
139
-
140
- # Reads the name of the base release from a node (see Build#node)
141
- def self.deref_node_file(node)
142
- if File.basename(node) == "0.0.0"
143
- nil
144
- elsif File.symlink?(node) # Releases and prereleases
145
- symlink = Command.command("readlink -v #{node}").first
146
- value = File.basename(symlink.sub(/\/$/, ""))
147
- value == "/dev/null" ? nil : value
148
- elsif File.directory?(node) # Migrations
149
- name = File.basename(node)
150
- name =~ MIGRATION_RE or raise "Illegal migration name: #{name}"
151
- $1
152
- end
153
- end
154
-
155
- private
156
- @states = {
157
- exist: [:create, :destroy],
158
- initialized: [:exist, :initialize, false], # ???
159
- active: [:exist, :checkout, :checkback],
160
- # built: [:active, :build, lambda { |this| this.database.recreate } ],
161
- }
162
- end
163
-
164
- class AbstractRelease < Build
165
- # Tag
166
- def tag() [version.custom, "v#{version.semver}"].compact.join("-") end
167
-
168
- # Cache object
169
- attr_reader :archive
170
-
171
- # Redefine Build#node
172
- attr_reader :node
173
-
174
- # The directory representing this release. It is initially empty. It is the
175
- # same as the next release's migration directory and contains features that
176
- # require this release
177
- def release_dir() raise AbstractMethod end
178
-
179
- def initialize(project, base_release, version, migration, **opts)
180
- super
181
- @node = File.join(RELEASE_DIR, name)
182
- @archive = DumpFile.new(project, version.to_s)
183
- end
184
-
185
- def cached?() archive.exist? end
186
- def cache() database.save(archive.path) end
187
- def uncache() FileUtils.rm_f(archive.path) end
188
-
189
- def loaded?() schema.loaded?(database) end
190
- def load() database.ensure(:loaded, archive.file) end
191
- def unload() database.ensure(:loaded, expect: false) end
192
-
193
- def prepare(commit: true)
194
- migration.prepare
195
- Git.commit("Prepared next release") if commit
196
- end
197
-
198
- def <=>(other) version <=> other.version end
199
-
200
- # Create the release in Git and on the disk
201
- def create(create_release_link_file: true)
202
- super()
203
-
204
- # Create release link file (eg. releases/0.1.0)
205
- if create_release_link_file
206
- base_release_dir = (version.zero? ? "/dev/null" : "../#{migration.path}")
207
- Dir.chdir(RELEASE_DIR) {
208
- FileUtils.ln_s(base_release_dir, File.basename(node))
209
- }
210
- Git.add(node)
211
- end
212
-
213
- # Set schema version
214
- project.schema.version = version
215
- Git.add(project.schema.path)
216
- end
217
-
218
- def dump
219
- return self
220
- $stderr.puts "#{self.class} #{version}"
221
- $stderr.indent { |f|
222
- f.puts "node : #{node.inspect}"
223
- f.puts "base_release: #{base_release&.version.inspect}"
224
- f.puts "migration : #{migration&.path.inspect}"
225
- f.puts "release_dir : #{release_dir.inspect}"
226
- }
227
- self
228
- end
229
-
230
- private
231
- @ensure_states = {
232
- # cached: [:built, :cache, :uncache],
233
- loaded: [:cached, :load, :unload]
234
- }
235
- end
236
-
237
- class Release < AbstractRelease
238
- def release_dir() File.join(FEATURE_DIR, name) end
239
-
240
- def initialize(project, base_release, version)
241
- migration = base_release && ReleaseMigration.new(base_release.release_dir)
242
- super(project, base_release, version, migration)
243
- end
244
-
245
- # Create the release in Git and on the disk. We assume that the migration exists
246
- def create
247
- super
248
-
249
- # Create migration link file
250
- if !version.zero?
251
- migration_version = "#{base_release.version}_#{version}"
252
- features = "../#{migration.path}"
253
- Dir.chdir(MIGRATION_DIR) {
254
- FileUtils.ln_s(features, migration_version)
255
- Git.add(migration_version)
256
- }
257
- end
258
-
259
- # Create new empty feature directory
260
- ReleaseMigration.new(release_dir).create
261
-
262
- Git.commit("Release #{version}")
263
- Git.create_tag(version)
264
- dump
265
- migration.dump if migration
266
- self
267
- end
268
- end
269
-
270
- # TODO: Rename to PreRelease
271
- class Prerelease < AbstractRelease
272
- attr_reader :target_release
273
-
274
- def release_dir() base_release.release_dir end
275
-
276
- def initialize(project, base_release, version, target_version = version.truncate(:pre))
277
- @target_release = Release.new(project, base_release, target_version)
278
- migration = ReleaseMigration.new(target_release.migration.path)
279
- super(project, base_release, version, migration)
280
- end
281
-
282
- # Create the pre-release in Git and on disk
283
- def create
284
- super
285
- migration.prepare
286
- Git.commit("Pre-release #{version}")
287
- dump
288
- self
289
- end
290
-
291
- # Create a migration for this release
292
- def prepare_migration
293
- base_release.built? or raise "Base release #{base_release} is not built"
294
- puts "Prerelease#generate_migration"
295
- end
296
- end
297
-
298
- class MigrationPrerelease < Prerelease
299
- def initialize(project, base_release, version, target_version = version.truncate(:pre))
300
- release_dir = "/migrations/..."
301
- end
302
- end
303
-
304
- class MigrationRelease < AbstractRelease
305
- def create
306
- # does not call super because migrations belong to the release they migrate to
307
- #
308
- # code, code, code
309
- end
310
-
311
- def include_feature
312
- raise NotYet
313
- end
314
- end
315
-
316
- class Feature < Build
317
- # Name of feature
318
- def feature() version.feature end
319
-
320
- # A feature's node is the feature directory
321
- def node() release_dir end
322
-
323
- def release_dir() migration.path end
324
-
325
- def initialize(project, base_release, name)
326
- base_release.is_a?(Release) || base_release.is_a?(Prerelease) or
327
- raise Internal, "Expected a Release object, got #{base_release.class}"
328
- version = Version.new(base_release.version, feature: name)
329
- migration = FeatureMigration.new(Migration.path(version))
330
- super(project, base_release, version, migration)
331
- end
332
-
333
- def checkout()
334
- super
335
- # FileUtils.ln_sf(feature, "feature")
336
- end
337
-
338
- def create
339
- super
340
- migration.create
341
- migration.prepare
342
- Git.commit("Created feature #{feature}")
343
- migration.dump
344
- self
345
- end
346
-
347
- # features/
348
- # 0.0.0/
349
- # feature_a
350
- # feature_b/
351
- # base_release.prick
352
- # name.yml <- 0.2.0/feature_b
353
- # rebased.yml <- reads base_release here
354
- #
355
- # 0.2.0/
356
- # feature_a -> 0.0.0/feature_a <- not rebased
357
- # feature_b -> 0.0.0/feature_b <- rebased
358
-
359
-
360
- def rebase(new_base_release)
361
- # Checkout new_base_release
362
- # Merge feature
363
- # Establish symlinks
364
- # Create as branch
365
-
366
- # new_base > base_release or
367
- # raise Error, "Can't rebase from #{base_release.version} to #{new_base.version}"
368
- # new_feature = Feature.new(project, base_release, base.version, base: base)
369
- # new_feature.ensure(:active)
370
- # schema.version = version
371
- # FileUtils.ln_sf("../#{feature.release_dir}", new_feature.release_dir)
372
- # Git.add(new_feature.release_dir)
373
- # new_feature
374
- end
375
- end
376
- end