summaryrefslogtreecommitdiff
blob: c79c96405dc6fd25bcdf9f467d8ffcded0cbeb10 (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/ruby -w

$: << File.dirname(__FILE__)
require 'changelog'
require 'repoman'

def isSvn
    File.directory? '.svn'
end

def display_heading(message)
    max = 80
    filler = '#######################'
    remaining = max - filler.length * 2
    leader = (remaining - message.length ) / 2
    puts filler + ' ' * (leader) + message + ' ' * leader + filler
end

def hr
    max = 80
    puts '#' * max
end

display_heading('eshowkw')
system('eshowkw')
display_heading('diff')
if isSvn:
    system('svn diff')
else
    system('cvs diff')
end
puts 'Exit status: ' + $?.to_s
$? == 2 && exit()

display_heading 'repoman full'
Repoman.full()
puts 'Exit status: ' + $?.to_s
$? != 0 && exit()

# use log entry from command line
logentry = ARGV[0]
# or default to your last ChangeLog entry
if File.file?('ChangeLog') && logentry.nil? :
    logentry = ChangeLog.getLastEntry()
end

# escape the log entry
escaped = logentry.gsub("'") { "\\'" }

display_heading('ChangeLog')
puts logentry
display_heading('Continue? (yes/no)')

if gets.match(/y|yes/i)
    display_heading('Committing...')
    if isSvn
        system("svn commit -m \"#{escaped}\"")
    else
        Repoman.commit(escaped)
    end
end