clearcase_helper 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +6 -0
- data/.hgignore +8 -0
- data/.hgtags +1 -0
- data/ChangeLog.md +11 -0
- data/Gemfile +1 -0
- data/LICENSE +19 -0
- data/README.md +52 -0
- data/Rakefile +1 -0
- data/bin/cch +8 -0
- data/clearcase_helper.gemspec +41 -0
- data/lib/clearcase_helper.rb +11 -0
- data/lib/clearcase_helper/cc_file.rb +123 -0
- data/lib/clearcase_helper/cli.rb +106 -0
- data/lib/clearcase_helper/executables.rb +22 -0
- data/lib/clearcase_helper/version.rb +3 -0
- data/lib/clearcase_helper/view.rb +137 -0
- metadata +103 -0
data/.gitignore
ADDED
data/.hgignore
ADDED
data/.hgtags
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
8366d2e2a96a82def065e71d4f3382087a215105 github/master
|
data/ChangeLog.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
ClearCase Helper is a small command line utility to make some aspects of ClearCase more accessible.
|
4
|
+
|
5
|
+
gem install clearcase_helper
|
6
|
+
cch help
|
7
|
+
|
8
|
+
## v0.4.9
|
9
|
+
|
10
|
+
* added .ccignore file support to control which files and directories should not be tracked [thx @TyMi]
|
11
|
+
* some gem build cleanups
|
data/Gemfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
gemspec
|
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2013 Thomas Steinhausen
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
ClearCase Helper
|
2
|
+
================
|
3
|
+
|
4
|
+
ClearCase Helper is a small command line utility to make some aspects of ClearCase more accessible.
|
5
|
+
|
6
|
+
It originated from the wish to use a distributed version control system (hg, git) as the primary VCS and the need to update the clearcase repository in regular intervals.
|
7
|
+
|
8
|
+
Clearcase Helper wraps cleartool and builds upon its command set some new ones.
|
9
|
+
These commands especially allow you to add, remove, checkout hijacked and checkin files in a recursive manner.
|
10
|
+
Additionally you can view the status of the view files in a familiar way and add labels (tag) a bunch of files in one go.
|
11
|
+
|
12
|
+
By default files and directories that match .hg*, .svn* and .git* are ignored by all operations.
|
13
|
+
To control this behaviour it is possible to supply a .ccignore file with regexp patterns for files/directories that should be ignored.
|
14
|
+
|
15
|
+
Beware that ClearCase Helper is only an addition to the clearcase toolchain and not a substitute.
|
16
|
+
|
17
|
+
|
18
|
+
Install
|
19
|
+
-------
|
20
|
+
|
21
|
+
gem install clearcase_helper
|
22
|
+
|
23
|
+
|
24
|
+
Usage
|
25
|
+
-----
|
26
|
+
|
27
|
+
cch help
|
28
|
+
|
29
|
+
To recursively ignore some files, it is possible to create a .ccignore file with regexp patterns ([ruby Regexp](http://rubular.com)).
|
30
|
+
.ccignore files are only evaluated in the current working directory of cch.
|
31
|
+
|
32
|
+
Prerequesites
|
33
|
+
------------
|
34
|
+
|
35
|
+
- cleartool
|
36
|
+
- ruby 1.9.2
|
37
|
+
- a snapshot view
|
38
|
+
|
39
|
+
Tested with cleartool version 7.1.1.2 on Windows 7 with ruby 1.9.2p0.
|
40
|
+
|
41
|
+
|
42
|
+
Build
|
43
|
+
-----
|
44
|
+
|
45
|
+
rake build # this creates the gem in pkg/
|
46
|
+
rake install # this task creates and installs the gem
|
47
|
+
|
48
|
+
|
49
|
+
Licence
|
50
|
+
-------
|
51
|
+
|
52
|
+
See LICENSE
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/cch
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "clearcase_helper/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "clearcase_helper"
|
7
|
+
s.version = ClearcaseHelper::VERSION
|
8
|
+
s.authors = ["Thomas Steinhausen"]
|
9
|
+
s.email = ["ts@image-addicts.de"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{A tool to help on some aspects of clearcase annoyances.}
|
12
|
+
s.description = <<-D
|
13
|
+
Clearcase has no simple to use command line tool
|
14
|
+
|
15
|
+
- to find and add view only files in a recursive manner
|
16
|
+
- to checkout and checkin hijacked files.
|
17
|
+
|
18
|
+
This tool is a simple wrapper to cleartool which allows just that.
|
19
|
+
|
20
|
+
Usage:
|
21
|
+
|
22
|
+
$ cch help
|
23
|
+
D
|
24
|
+
|
25
|
+
files = if File.directory?('.git')
|
26
|
+
`git ls-files`.split($/)
|
27
|
+
elsif File.directory?('.hg')
|
28
|
+
`hg manifest`.split("\n").collect {|f| f.gsub(/^[0-9]+\s+/, '')}
|
29
|
+
else
|
30
|
+
Dir.glob(%w(* bin/* lib/**/*))
|
31
|
+
end
|
32
|
+
|
33
|
+
s.files = files
|
34
|
+
s.test_files = []
|
35
|
+
s.executables = s.files.select {|f| f.match /bin\// }.map{ |f| File.basename(f) }
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
|
38
|
+
# specify any dependencies here; for example:
|
39
|
+
s.add_development_dependency "rake"
|
40
|
+
s.add_runtime_dependency "thor", "~>0.17"
|
41
|
+
end
|
@@ -0,0 +1,123 @@
|
|
1
|
+
module ClearcaseHelper
|
2
|
+
class CCFile
|
3
|
+
include Executables
|
4
|
+
|
5
|
+
attr_accessor :file
|
6
|
+
attr_accessor :view
|
7
|
+
|
8
|
+
def initialize(file_name, view)
|
9
|
+
@file = file_name
|
10
|
+
@view = view
|
11
|
+
end
|
12
|
+
|
13
|
+
def is_hijacked?
|
14
|
+
file.match /\[hijacked\]/
|
15
|
+
end
|
16
|
+
|
17
|
+
def is_view_only?
|
18
|
+
!file.match /@@/
|
19
|
+
end
|
20
|
+
|
21
|
+
def is_checkedout?
|
22
|
+
file.match /@@[^\s]+CHECKEDOUT/
|
23
|
+
end
|
24
|
+
|
25
|
+
def is_missing?
|
26
|
+
file.match /\[loaded but missing\]/
|
27
|
+
end
|
28
|
+
|
29
|
+
def is_checkedin?
|
30
|
+
short_status.strip.empty?
|
31
|
+
end
|
32
|
+
|
33
|
+
def short_status
|
34
|
+
return 'HI' if is_hijacked?
|
35
|
+
return 'CO' if is_checkedout?
|
36
|
+
return '~ ' if is_missing?
|
37
|
+
return '? ' if is_view_only?
|
38
|
+
return ' '
|
39
|
+
end
|
40
|
+
|
41
|
+
def file?
|
42
|
+
File.file?(self.to_s)
|
43
|
+
end
|
44
|
+
|
45
|
+
def directory?
|
46
|
+
File.directory?(self.to_s)
|
47
|
+
end
|
48
|
+
|
49
|
+
def parent_dirname
|
50
|
+
File.dirname(self.to_s)
|
51
|
+
end
|
52
|
+
|
53
|
+
# Refreshes state and returns self.
|
54
|
+
#
|
55
|
+
# @return [CCFile]
|
56
|
+
def refresh_status(options={})
|
57
|
+
success, stdout = cleartool("ls #{directory? ? '-directory' : ''} #{self.to_s.shellescape}", options)
|
58
|
+
@file = stdout.strip
|
59
|
+
|
60
|
+
self
|
61
|
+
end
|
62
|
+
|
63
|
+
def add!(options={})
|
64
|
+
parent = view.file_for(parent_dirname, options)
|
65
|
+
if parent.is_view_only?
|
66
|
+
parent.add!(options)
|
67
|
+
parent.refresh_status(options)
|
68
|
+
end
|
69
|
+
|
70
|
+
parent.checkout!(options) unless parent.is_checkedout?
|
71
|
+
success, stdout = cleartool("mkelem -c \"\" -ptime #{file.to_s.shellescape}", options)
|
72
|
+
|
73
|
+
refresh_status(options)
|
74
|
+
|
75
|
+
success
|
76
|
+
end
|
77
|
+
|
78
|
+
def remove!(options={})
|
79
|
+
parent = view.file_for(parent_dirname, options)
|
80
|
+
|
81
|
+
parent.checkout!(options) unless parent.is_checkedout?
|
82
|
+
success, stdout = cleartool("rmname -c \"\" #{self.to_s.shellescape}", options)
|
83
|
+
|
84
|
+
|
85
|
+
if success
|
86
|
+
# no need to refresh file because this file does not exist anymore,
|
87
|
+
# so just remove it from the identity map
|
88
|
+
view.forget_file(self)
|
89
|
+
else
|
90
|
+
# do refresh status since deletion failed
|
91
|
+
refresh_status(options)
|
92
|
+
end
|
93
|
+
|
94
|
+
success
|
95
|
+
end
|
96
|
+
|
97
|
+
# @param Hash[Symbol => String] - :comment => 'some comment'
|
98
|
+
def checkin!(options={})
|
99
|
+
comment = options[:comment] || ''
|
100
|
+
success, stdout = cleartool("ci -c \"#{comment.shellescape}\" -identical -ptime #{self.to_s.shellescape}", options)
|
101
|
+
|
102
|
+
refresh_status(options)
|
103
|
+
|
104
|
+
success
|
105
|
+
end
|
106
|
+
|
107
|
+
def checkout!(options={})
|
108
|
+
success, stdout = cleartool("co -c \"\" -ptime -nwarn #{is_hijacked? ? '-usehijack' : ''} #{self.to_s.shellescape}", options)
|
109
|
+
|
110
|
+
refresh_status(options)
|
111
|
+
|
112
|
+
success
|
113
|
+
end
|
114
|
+
|
115
|
+
def to_s
|
116
|
+
@file_as_string ||= file.gsub(/@@.*$/, '')
|
117
|
+
end
|
118
|
+
|
119
|
+
def <=>(other)
|
120
|
+
self.to_s <=> other.to_s
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
module ClearcaseHelper
|
4
|
+
class CLI < Thor
|
5
|
+
class_option :verbose, :default => false, :type => :boolean, :desc => "Show executed cleartool commands and its results on stdout."
|
6
|
+
class_option :noop, :default => false, :type => :boolean, :desc => "Do nothing to the clearcase view. cleartool is not executed."
|
7
|
+
class_option :nostdout,:default => false, :type => :boolean, :desc => "Do not show the cleartool output when verbose is on."
|
8
|
+
|
9
|
+
desc "status [PATH]", "Shows files in this view prefixed with its short status (CO: checkedout, HI: hijacked, ~: loaded but missing, ?: only in view)."
|
10
|
+
method_option :long, :default => false, :aliases => ['-l'], :desc => 'Show all files, including those that have no special state.'
|
11
|
+
def all_files(path='.')
|
12
|
+
view = ClearcaseHelper::View.new(path)
|
13
|
+
puts view.all_files_with_status(false, options)
|
14
|
+
end
|
15
|
+
map ['st'] => :all_files
|
16
|
+
|
17
|
+
desc "view_only_files [PATH]", "Shows all files that are not added to this view (unversioned files)."
|
18
|
+
def view_only_files(path='.')
|
19
|
+
view = ClearcaseHelper::View.new(path)
|
20
|
+
puts view.view_only_files(false, options)
|
21
|
+
end
|
22
|
+
map 'vof' => :view_only_files
|
23
|
+
|
24
|
+
desc "hijacked_files [PATH]", "Shows all files that are hijacked."
|
25
|
+
def hijacked_files(path='.')
|
26
|
+
view = ClearcaseHelper::View.new(path)
|
27
|
+
puts view.hijacked_files(false, options)
|
28
|
+
end
|
29
|
+
map 'hif' => :hijacked_files
|
30
|
+
|
31
|
+
desc "checkedout_files [PATH]", "Shows all files that are checked out."
|
32
|
+
def checkedout_files(path='.')
|
33
|
+
view = ClearcaseHelper::View.new(path)
|
34
|
+
puts view.checkedout_files(false, options)
|
35
|
+
end
|
36
|
+
map 'cof' => :checkedout_files
|
37
|
+
|
38
|
+
desc "missing_files [PATH]", "Shows all files that are loaded but missing in view."
|
39
|
+
def missing_files(path='.')
|
40
|
+
view = ClearcaseHelper::View.new(path)
|
41
|
+
puts view.missing_files(false, options)
|
42
|
+
end
|
43
|
+
map 'mf' => :missing_files
|
44
|
+
|
45
|
+
desc "checkout_highjacked [PATH]", "Checks out all highjacked files."
|
46
|
+
def checkout_highjacked(path='.')
|
47
|
+
view = ClearcaseHelper::View.new(path)
|
48
|
+
puts view.checkout_highjacked!(options)
|
49
|
+
end
|
50
|
+
map 'cohi' => :checkout_highjacked
|
51
|
+
|
52
|
+
desc "checkin [PATH]", "Checks in all checked out files."
|
53
|
+
method_option :comment, :default => '', :aliases => ['-c', '-m'], :desc => 'use <comment> as commit message'
|
54
|
+
def checkin_checkedout(path='.')
|
55
|
+
view = ClearcaseHelper::View.new(path)
|
56
|
+
puts view.checkin_checkedout!(options)
|
57
|
+
end
|
58
|
+
map ['ci', 'checkin'] => :checkin_checkedout
|
59
|
+
|
60
|
+
desc "checkin_hijacked [PATH]", "Checks hijacked files out and in again."
|
61
|
+
method_option :comment, :default => '', :aliases => ['-c', '-m'], :desc => 'use <comment> as commit message'
|
62
|
+
def checkin_hijacked(path='.')
|
63
|
+
view = ClearcaseHelper::View.new(path)
|
64
|
+
puts view.checkin_hijacked!(options)
|
65
|
+
end
|
66
|
+
map 'cihi' => :checkin_hijacked
|
67
|
+
|
68
|
+
desc "add_view_only_files [PATH]", "Recursively adds and checks in files that are not yet versioned."
|
69
|
+
def add_view_only_files(path='.')
|
70
|
+
view = ClearcaseHelper::View.new(path)
|
71
|
+
puts view.add_view_only_files!(options)
|
72
|
+
end
|
73
|
+
map ['avo', 'add'] => :add_view_only_files
|
74
|
+
|
75
|
+
desc "remove_missing_files [PATH]", "Removes files (rmname) that are loaded but deleted from view."
|
76
|
+
def remove_missing_files(path='.')
|
77
|
+
view = ClearcaseHelper::View.new(path)
|
78
|
+
puts view.remove_missing_files!(options)
|
79
|
+
end
|
80
|
+
|
81
|
+
desc "create_and_add_label label [PATH]", "Creates a label type and adds it recursively to all files in current view path."
|
82
|
+
method_option :comment, :default => '', :aliases => ['-c', '-m'], :desc => 'use <comment> as commit message'
|
83
|
+
def create_and_add_label(label, path='.')
|
84
|
+
view = ClearcaseHelper::View.new(path)
|
85
|
+
puts view.make_label_type(label, options)
|
86
|
+
puts view.make_label(label, options)
|
87
|
+
end
|
88
|
+
|
89
|
+
desc "add_label label [PATH]", "Adds an existing label recursively to all files in current view path."
|
90
|
+
method_option :comment, :default => '', :aliases => ['-c', '-m'], :desc => 'use <comment> as commit message'
|
91
|
+
def add_label(label, path='.')
|
92
|
+
view = ClearcaseHelper::View.new(path)
|
93
|
+
puts view.make_label(label, options)
|
94
|
+
end
|
95
|
+
|
96
|
+
desc "heaven", "Show real help."
|
97
|
+
def heaven
|
98
|
+
$stderr.puts 'NO HEAVEN HERE - use a proper VCS!'
|
99
|
+
end
|
100
|
+
|
101
|
+
desc "version", "Show the version"
|
102
|
+
def version
|
103
|
+
puts VERSION
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module ClearcaseHelper
|
2
|
+
module Executables
|
3
|
+
# @param [String] command for dleartool to execute. including all cleartool options.
|
4
|
+
# @param [Hash] options :noop => boolean, :vebose => boolean, :nostdout => boolean
|
5
|
+
# @return [Array[Boolean, String]] success, stdout
|
6
|
+
def cleartool(command, options={})
|
7
|
+
cmd = "cleartool #{command}"
|
8
|
+
|
9
|
+
stdout = options[:noop] ? '' : `#{cmd}`
|
10
|
+
success = $? == 0
|
11
|
+
|
12
|
+
puts "# #{cmd} (#{$?}, #{success})=>" if options[:verbose]
|
13
|
+
if options[:verbose] && !options[:nostdout] && !stdout.empty?
|
14
|
+
puts stdout.split("\n").collect {|l| " #{l}"}.join("\n")
|
15
|
+
end
|
16
|
+
|
17
|
+
$stdout.flush
|
18
|
+
|
19
|
+
return success, stdout
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,137 @@
|
|
1
|
+
module ClearcaseHelper
|
2
|
+
class View
|
3
|
+
include Executables
|
4
|
+
|
5
|
+
attr_reader :view_path
|
6
|
+
attr_reader :identity_map
|
7
|
+
|
8
|
+
def initialize(view_path)
|
9
|
+
@view_path = view_path
|
10
|
+
end
|
11
|
+
|
12
|
+
def files(refresh=false, options={})
|
13
|
+
if @files and !refresh
|
14
|
+
return @files
|
15
|
+
end
|
16
|
+
|
17
|
+
success, stdout = cleartool("ls -recurse #{@view_path.shellescape}", options)
|
18
|
+
|
19
|
+
# load excludes from .ccignore
|
20
|
+
ccignore_file = File.join(@view_path,'.ccignore')
|
21
|
+
ccignore = if File.exist?(ccignore_file)
|
22
|
+
File.readlines(ccignore_file).map {|ignore| ignore.strip}
|
23
|
+
else
|
24
|
+
%w(\.hg|\.git|\.svn)
|
25
|
+
end
|
26
|
+
|
27
|
+
raw_files = stdout.split(/\n/)
|
28
|
+
raw_files.reject! do |f|
|
29
|
+
ccignore.any? do |ignore|
|
30
|
+
f.match(/#{ignore}/)
|
31
|
+
end
|
32
|
+
end # filter excluded files / folders
|
33
|
+
|
34
|
+
@files = raw_files.map {|f| CCFile.new(f, self)}
|
35
|
+
@identity_map = @files.inject({}) {|memo, file| memo[file.to_s] = file; memo}
|
36
|
+
|
37
|
+
@files
|
38
|
+
end
|
39
|
+
|
40
|
+
def view_only_files(refresh=false, options={})
|
41
|
+
files(refresh, options).select {|f| f.is_view_only?}
|
42
|
+
end
|
43
|
+
|
44
|
+
def hijacked_files(refresh=false, options={})
|
45
|
+
files(refresh, options).select {|f| f.is_hijacked?}
|
46
|
+
end
|
47
|
+
|
48
|
+
def checkedout_files(refresh=false, options={})
|
49
|
+
files(refresh, options).select {|f| f.is_checkedout?}
|
50
|
+
end
|
51
|
+
|
52
|
+
def missing_files(refresh=false, options={})
|
53
|
+
files(refresh, options).select {|f| f.is_missing?}
|
54
|
+
end
|
55
|
+
|
56
|
+
def all_files_with_status(refresh=false, options={})
|
57
|
+
show_short = !options[:long]
|
58
|
+
|
59
|
+
files(refresh, options).reject {|file| show_short and file.is_checkedin?}.collect do |file|
|
60
|
+
"#{file.short_status} #{file}"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# @param [String, CCFile] file to get from the identity map. If the file is missing a new instance is added to the map and returned.
|
65
|
+
# @return [CCFile]
|
66
|
+
def file_for(file, options={})
|
67
|
+
file = file.to_s.strip
|
68
|
+
|
69
|
+
cc_file = @identity_map[file]
|
70
|
+
|
71
|
+
if cc_file.nil? && !file.empty?
|
72
|
+
cc_file = @identity_map[file] = CCFile.new(file, self).refresh_status(options)
|
73
|
+
end
|
74
|
+
|
75
|
+
cc_file
|
76
|
+
end
|
77
|
+
|
78
|
+
# Removes given file from this views identity map.
|
79
|
+
# Used by the remove! file action to cleanup view state on success.
|
80
|
+
#
|
81
|
+
# @param [String, CCFile] file to forget in the identity map.
|
82
|
+
# @return [CCFile] the file that has been removed from the identity map.
|
83
|
+
def forget_file(file)
|
84
|
+
@identity_map.delete(file)
|
85
|
+
end
|
86
|
+
|
87
|
+
# @param Hash[Symbol => String] - :comment => 'some comment', :debug => boolean, :noop => :boolean
|
88
|
+
def checkin_checkedout!(options={})
|
89
|
+
checkedout_files(false, options.merge(:nostdout => true, :noop => false)).each do |file|
|
90
|
+
file.checkin!(options)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# @param Hash[Symbol => String] - :debug => boolean, :noop => :boolean
|
95
|
+
def checkout_highjacked!(options={})
|
96
|
+
hijacked_files(false, options.merge(:nostdout => true, :noop => false)).each do |file|
|
97
|
+
file.checkout!(options)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
# @param Hash[Symbol => String] - :debug => boolean, :noop => :boolean
|
102
|
+
def checkin_hijacked!(options={})
|
103
|
+
hijacked_files(false, options.merge(:nostdout => true, :noop => false)).each do |file|
|
104
|
+
file.checkout!(options)
|
105
|
+
file.checkin!(options)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# @param Hash[Symbol => String] - :debug => boolean, :noop => :boolean
|
110
|
+
def add_view_only_files!(options={})
|
111
|
+
view_only_files(false, options.merge(:nostdout => true, :noop => false)).sort.each do |file|
|
112
|
+
file.add!(options)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
# @param Hash[Symbol => String] - :debug => boolean, :noop => :boolean
|
117
|
+
def remove_missing_files!(options={})
|
118
|
+
missing_files(false, options.merge(:nostdout => true, :noop => false)).sort.reverse.each do |file|
|
119
|
+
file.remove!(options)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
# @param String label - the label type name to create
|
124
|
+
# @param Hash[Symbol => String] - :debug => boolean, :noop => :boolean
|
125
|
+
def make_label_type(label, options={})
|
126
|
+
comment = (options[:comment] || '') + ": #{@view_path}"
|
127
|
+
cleartool("mklbtype -c \"#{comment.shellescape}\" #{label.shellescape}", options)
|
128
|
+
end
|
129
|
+
|
130
|
+
# @param String label - the label name to apply recursively to all files in actual view path
|
131
|
+
# @param Hash[Symbol => String] - :debug => boolean, :noop => :boolean
|
132
|
+
def make_label(label, options={})
|
133
|
+
comment = options[:comment] || ''
|
134
|
+
cleartool("mklabel -c \"#{comment.shellescape}\" -recurse #{label.shellescape} #{@view_path.shellescape}", options)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: clearcase_helper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.9
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Thomas Steinhausen
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-05-17 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: thor
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0.17'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0.17'
|
46
|
+
description: ! " Clearcase has no simple to use command line tool\n\n - to
|
47
|
+
find and add view only files in a recursive manner\n - to checkout and checkin
|
48
|
+
hijacked files.\n\n This tool is a simple wrapper to cleartool which allows just
|
49
|
+
that.\n\n Usage:\n\n $ cch help\n"
|
50
|
+
email:
|
51
|
+
- ts@image-addicts.de
|
52
|
+
executables:
|
53
|
+
- cch
|
54
|
+
extensions: []
|
55
|
+
extra_rdoc_files: []
|
56
|
+
files:
|
57
|
+
- .gitignore
|
58
|
+
- .hgignore
|
59
|
+
- .hgtags
|
60
|
+
- ChangeLog.md
|
61
|
+
- Gemfile
|
62
|
+
- LICENSE
|
63
|
+
- README.md
|
64
|
+
- Rakefile
|
65
|
+
- bin/cch
|
66
|
+
- clearcase_helper.gemspec
|
67
|
+
- lib/clearcase_helper.rb
|
68
|
+
- lib/clearcase_helper/cc_file.rb
|
69
|
+
- lib/clearcase_helper/cli.rb
|
70
|
+
- lib/clearcase_helper/executables.rb
|
71
|
+
- lib/clearcase_helper/version.rb
|
72
|
+
- lib/clearcase_helper/view.rb
|
73
|
+
homepage: ''
|
74
|
+
licenses: []
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ! '>='
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
hash: 4122144388664280151
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
segments:
|
95
|
+
- 0
|
96
|
+
hash: 4122144388664280151
|
97
|
+
requirements: []
|
98
|
+
rubyforge_project:
|
99
|
+
rubygems_version: 1.8.24
|
100
|
+
signing_key:
|
101
|
+
specification_version: 3
|
102
|
+
summary: A tool to help on some aspects of clearcase annoyances.
|
103
|
+
test_files: []
|