Class: PVN::BaseRevisionOption
Constant Summary
collapse
- REVISION_DESCRIPTION =
[ "revision to apply.",
"ARG can be relative, of the form:",
" +N : N revisions from the BASE",
" -N : N revisions from the HEAD,",
" when -1 is the previous revision" ,
]
Constants inherited
from BaseOption
PVN::BaseOption::NO_CMDLINE_OPTION
Instance Attribute Summary
Attributes inherited from BaseOption
#default, #description, #name, #negate, #regexp, #tag
Instance Method Summary
collapse
Methods inherited from BaseOption
#exact_match?, #initialize, #negative_match?, #next_argument, #post_process, #process, #regexp_match?, #set_value, #takes_value?, #to_command_line, #to_doc, #to_s, #unset, #value
Instance Method Details
#entry ⇒ Object
45
46
|
# File 'lib/pvn/revision/base_option.rb', line 45
def entry
end
|
#head? ⇒ Boolean
18
19
20
|
# File 'lib/pvn/revision/base_option.rb', line 18
def head?
value.nil? || value == 'HEAD'
end
|
#relative_to_absolute(rel, path) ⇒ Object
29
30
31
32
33
34
35
36
37
|
# File 'lib/pvn/revision/base_option.rb', line 29
def relative_to_absolute rel, path
limit = rel[0, 1] == '-' ? rel.to_i.abs : nil
xmllines = run_log_command limit, path
reventry = PVN::Revision::Argument.new rel, xmllines
revval = reventry.value.to_s
revval
end
|
#resolve_value(optset, unprocessed) ⇒ Object
22
23
24
25
26
27
|
# File 'lib/pvn/revision/base_option.rb', line 22
def resolve_value optset, unprocessed
val = value
if PVN::Revision::RELATIVE_REVISION_RE.match val
@value = relative_to_absolute val, unprocessed[0]
end
end
|
#run_log_command(limit, path) ⇒ Object
39
40
41
42
43
|
# File 'lib/pvn/revision/base_option.rb', line 39
def run_log_command limit, path
cmdargs = SVNx::LogCommandArgs.new :limit => limit, :path => path, :use_cache => false
cmd = SVNx::LogCommand.new cmdargs
cmd.execute
end
|