Megatest

Check-in [1ec830e201]
Login
Overview
Comment:added nexttag.rb script
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.64 | bbtest123
Files: files | file ages | folders
SHA1: 1ec830e201752c3ba78f52582e9bd5a681fba744
User & Date: bjbarcla on 2017-07-06 10:34:16
Other Links: branch diff | manifest | tags
Context
2017-07-06
11:07
updated nexttag.rb with action placeholders check-in: e821f05608 user: bjbarcla tags: v1.64
10:34
added nexttag.rb script check-in: 1ec830e201 user: bjbarcla tags: v1.64, bbtest123
2017-07-05
18:18
bumped version check-in: 16723fd972 user: bjbarcla tags: v1.64
Changes

Added nexttag.rb version [b43e7a8f64].

































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env ruby


def get_next_tag


  this_branch = `fossil branch`.sub(/\A.*\* /m,'').sub(/\n.*\z/m,'')
  abort "Not on a version branch like v1.64 (got: >#{this_branch}<)" unless this_branch.match(/^v\d\.\d\d$/)
  
  #puts "this branch: #{this_branch}"

  tag_pat = /#{this_branch}(\d\d)/
  remote=`fsl remote`.chomp.sub(/^file:\/\//,'') # get tagset from origin
  cmd="fossil tag -R '#{remote}' list"
  tags = `#{cmd}`.split /\n/
  abort "fossil command failed [#{cmd}]" if $? != 0
  branch_tags = tags.find_all{|x| x.match(tag_pat) }.sort
  if branch_tags.length == 0
    return this_branch + "01"
  else
    latest_tag = branch_tags.last
    m1 = latest_tag.match(tag_pat)
    minor_digits = m1[1].to_i + 1
    if (minor_digits % 10) == 0
      minor_digits += 1
    end
    new_tag=sprintf("%s%02d", this_branch, minor_digits)
    return new_tag
  end
end

print get_next_tag