motomike-bnr_tools 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/bnr_tools/mergeinator.rb +13 -16
  3. metadata +1 -1
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 0
3
- :patch: 3
3
+ :patch: 4
4
4
  :major: 0
@@ -38,7 +38,7 @@ class Mergeinator
38
38
  candidateVersions = preExistingVersions.find_all { |version| version.major == self.releaseBranchVersion.major && version.minor == self.releaseBranchVersion.minor }
39
39
  highestCandidateVersion = candidateVersions.sort.last
40
40
  puts "Highest existing version: #{highestCandidateVersion}"
41
- ask("LOL{z,cat} version to tag?") { |q|
41
+ ask("LOL{z,cat} version to tag? ") { |q|
42
42
  q.default = highestCandidateVersion.next_after_patchlevel_increment.to_s
43
43
  q.validate = /#{self.releaseBranchVersion.major}\.#{self.releaseBranchVersion.minor}\.\d+/
44
44
  }
@@ -47,11 +47,11 @@ class Mergeinator
47
47
 
48
48
  def tagLOLCat
49
49
  ref_msg = self.ticketsToMerge ? "Refs #{(self.ticketsToMerge.map {|t| "#{t}"}).join(", ")}" : "No tickets referenced"
50
- if agree("References: #{ref_msg}\nOkay to tag branch #{self.releaseBranch} as version #{self.version}?")
50
+ if agree("Tagging version #{self.version}. #{ref_msg}\nOkay to proceed? (NB: This will commit to SVN) ")
51
51
  SvnCommands.copy("LOLcat/branches/#{self.releaseBranch}","LOLcat/tags/#{version}", nil, nil, "Tagged LOLcat-#{version}. #{ref_msg}")
52
52
  SvnCommands.copy("LOLz/branches/#{self.releaseBranch}","LOLz/tags/#{version}", nil, nil, "Tagged LOLz-#{version}. #{ref_msg}")
53
53
  else
54
- exit(1) unless agree("Oh. Well, would you like to keep going anyway, even though we can't commit anything?")
54
+ exit(1) unless agree("Oh. Well, would you like to keep going anyway? ")
55
55
  end
56
56
  SvnCommands::Update.new("LOLcat/tags/#{version}",nil,true,true,self.wcPath) # shallowly checkout the new tag to ~/diggRepository/, no extra args for svn, force update
57
57
  t = Tempfile.new("svn_externals").open { |tempfile|
@@ -63,10 +63,6 @@ class Mergeinator
63
63
  puts IO.popen(cmd).readlines
64
64
  end
65
65
 
66
- def svnMergeCommand(project, changeset)
67
- "svn merge -c #{changeset.revision} svn+ssh://svn.digg.internal/repository/#{project}/trunk"
68
- end
69
-
70
66
  def mergeStuff
71
67
  modules = Set.new
72
68
  allChangesets = Set.new
@@ -75,9 +71,7 @@ class Mergeinator
75
71
  allChangesets.merge(ticket.changesets)
76
72
  modules.merge(ticket.affectedModules)
77
73
  }
78
- puts "Affected modules: #{modules.to_a.join(", ")}."
79
- commitMessage = "Refs #{(ticketsToMerge.sort.map {|ticket| ticket.to_s(false)}).join(", ")} : Merged #{(allChangesets.sort.map {|c| c.to_s }).join(", ")} from trunk"
80
- puts "Commit message = #{commitMessage}"
74
+ #puts "Affected modules: #{modules.to_a.join(", ")}."
81
75
  allChangesets.sort.each { |changeset|
82
76
  # We could check paths and such, but that's just an extra step for the cat ...
83
77
  SvnCommands.merge("LOLcat/trunk",self.catPath,changeset.revision,nil,nil,self.wcPath)
@@ -99,25 +93,28 @@ class Mergeinator
99
93
  Dir.chdir(self.branchWorkingDir) { |cwd|
100
94
  puts IO.popen(%Q{ svn st && svn diff . modules }).readlines
101
95
  @module_upload_cmds.each { |cmd| puts cmd }
102
- puts "Before I commit - does everything look okay?"
103
- if agree("Commit message: #{commitMessage}")
96
+ commitMessage = "Refs #{(ticketsToMerge.sort.map {|ticket| ticket.to_s(true)}).join(", ")}"
97
+ unless modules.empty?
98
+ commitMessage += ", updated modules : #{(modules.map {|m| "#{m.moduleName}-#{m.getVersion}"}).join(", ")}"
99
+ end
100
+ if agree("Commit message: #{commitMessage}\nOkay to proceed? (NB: This will commit to SVN) ")
104
101
  system %Q{ svn st | awk '/^\s?[MAD]/ { print $NF } ' | xargs svn commit -m'#{commitMessage}' }
105
102
  else
106
- exit(1) unless agree("Oh. Well, would you like to keep going anyway, even though we can't commit anything?")
103
+ exit(1) unless agree("Oh. Well, would you like to keep going anyway? ")
107
104
  end
108
105
  }
109
106
  tagLOLCat
110
- if agree("Upload modified modules now?")
107
+ if agree("Upload modified modules now? ")
111
108
  @module_upload_cmds.each { |cmd|
112
109
  puts IO.popen(cmd).readlines
113
110
  }
114
111
  else
115
- exit(1) unless agree("Oh. Well, would you like to keep going anyway, even though we can't commit anything?")
112
+ exit(1) unless agree("Oh. Well, would you like to keep going anyway? ")
116
113
  end
117
114
  end
118
115
 
119
116
  def cleanWorkingCopy(force=false)
120
- if (force || agree("Clean working copy now?")) then
117
+ if (force || agree("Clean working copy now? ")) then
121
118
  SvnCommands::Update.new(self.catPath, nil, true, false, self.wcPath) # update the current working copy to be sure the dir is there
122
119
  Dir.chdir(branchWorkingDir) {
123
120
  puts IO.popen(%Q{ svn revert -R . && svn revert -R modules && svn stat | grep "^\?" | cut -c8- | xargs rm -rf }).readlines
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motomike-bnr_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Ashmore