ebm 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/commands/prepare.rb +18 -2
  3. data/lib/info.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- data.tar.gz: 367cd483688c378a1979e31d5a54c5ace5b147c4
4
- metadata.gz: 49faf13adbf47da860c7f57af3f7fc34d7525422
3
+ data.tar.gz: 72a6a8df2a47c113752bae24f81204061cc199af
4
+ metadata.gz: 5da175684eb49bf3cf36acf77fa0862f3e6d634e
5
5
  SHA512:
6
- data.tar.gz: 7ec095e60931d255776b90fca492af8f6910a3401e4fc9b17b2ea338d40433ff81724010ae4a73e7b3619b8734bae5ff78f1bbfdfe7decd3dbc155cf2a148a4d
7
- metadata.gz: 40d95b1f00c62395c9bbd6af7224c9e158afca688e9073875bf89b86b9799b3e0c15000874bee290f5fdceb756f5b8737233abfb59722442de8d9d1320fb2813
6
+ data.tar.gz: 34809f027513421967f3cd4c3f15b64ce40450bdba487b1a46e5112e7149db14e1489973b04721fa2c14077e0788e6ff96aafec39a754d26acd37a828c0423f5
7
+ metadata.gz: 0f0d2605a34c2218fe6a5f8173d9751b64e9aa30a463dc2654071bf2b2ce16cc82e3236115761fec287ef373c5b1cde67bbf16cdb330375300d0d45067f38f0a
@@ -38,13 +38,17 @@ module Commands
38
38
  options[:nobranch] = v
39
39
  end
40
40
 
41
+ opts.on("--with_local_version", "Also include a local version branch, only applies with the -i option.") do |v|
42
+ options[:with_local_version] = v
43
+ end
44
+
41
45
  end
42
46
 
43
47
  # prepare a single repo and create a local and tracking branch if it should have one
44
48
  # if the repo specifies a branch then we will do the initial fetch from that branch
45
49
  # if the create_dev_branch flag is set, we will create a local and tracking branch with
46
50
  # the developer initials prepended
47
- def prepare_repo(repo, top_dir, initials, nobranch)
51
+ def prepare_repo(repo, top_dir, initials, nobranch, with_local_version)
48
52
  git_path = repo[:git_path]
49
53
  branch = repo[:branch]
50
54
  create_dev_branch = (repo[:create_dev_branch] == true) && (!nobranch)
@@ -96,6 +100,13 @@ module Commands
96
100
  raise "Unable to create local and tracking developer branch #{dev_branch_name} for #{repo_name}."
97
101
  end
98
102
  end
103
+ if with_local_version == false
104
+ # they don't want the local version branch so drop it
105
+ cmd = "git branch -D #{branch}"
106
+ if EbmSharedLib::CL.do_cmd_result(cmd, repo_path) != 0
107
+ raise "Unable to delete local version branch #{branch} for #{repo_name}."
108
+ end
109
+ end
99
110
  end
100
111
  elsif tag
101
112
  # they are using a tag so don't create dev branches
@@ -120,6 +131,7 @@ module Commands
120
131
  config_name = options[:config]
121
132
  initials = options[:initials]
122
133
  nobranch = !!options[:nobranch]
134
+ with_local_version = !!options[:with_local_version]
123
135
 
124
136
  if (nobranch && initials)
125
137
  raise "You must specify either the --initials or --nobranch, not both."
@@ -129,6 +141,10 @@ module Commands
129
141
  raise "You must specify either --initials or --nobranch"
130
142
  end
131
143
 
144
+ if (with_local_version && initials.nil?)
145
+ raise "Using --with_local_version is only applicable if you are also creating a developer branch -i."
146
+ end
147
+
132
148
  # try to make sure the repo is available
133
149
  EbmSharedLib.prepare_config_repo
134
150
  info = EbmSharedLib.read_repo_config(config_name)
@@ -143,7 +159,7 @@ module Commands
143
159
 
144
160
  repos = info[:repos]
145
161
  repos.each do |repo|
146
- prepare_repo(repo, top_dir, initials, nobranch)
162
+ prepare_repo(repo, top_dir, initials, nobranch, with_local_version)
147
163
  end
148
164
 
149
165
  end
data/lib/info.rb CHANGED
@@ -7,6 +7,6 @@
7
7
  #
8
8
  class Info
9
9
  def self.version
10
- "0.0.16"
10
+ "0.0.17"
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ebm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Seitz
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2013-06-27 00:00:00 Z
12
+ date: 2013-07-01 00:00:00 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: subcommand