Megatest

Check-in [e821f05608]
Login
Overview
Comment:updated nexttag.rb with action placeholders
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.64
Files: files | file ages | folders
SHA1: e821f056086d11d0a8ff2fa6ae58f5a44678f707
User & Date: bjbarcla on 2017-07-06 11:07:35
Other Links: branch diff | manifest | tags
Context
2017-07-07
10:35
updated warning message for load limit check-in: 5ba0a35d1b user: bjbarcla tags: v1.64
2017-07-06
16:35
Merged recent changes to v1.64 into v1.65 check-in: fc84397e48 user: mrwellan tags: v1.65
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
Changes

Modified nexttag.rb from [b43e7a8f64] to [5485fb1ee4].

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
















|


|
|

|

|






|







|




>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env ruby


def get_next_tag(branch)



  abort "Not on a version branch like v1.64 (got: >#{branch}<)" unless branch.match(/^v\d\.\d\d$/)
  
  #puts "this branch: #{branch}"

  tag_pat = /#{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 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", branch, minor_digits)
    return new_tag
  end
end

branch = `fossil branch`.sub(/\A.*\* /m,'').sub(/\n.*\z/m,'')
tag= get_next_tag(branch)

puts "TODO: Write to megatest-version.scm:"
puts ";; Always use two or four digit decimal
;; 1.01, 1.02...1.10,1.11,1.1101 ... 1.99,2.00..

(declare (unit megatest-version))

(define megatest-version #{tag.sub(/^v/,'')})

"

puts "TODO: fossil tag add #{tag} #{branch}"
puts ""