Class: Origen::RevisionControl::Perforce
- Inherits:
-
Base
- Object
- Base
- Origen::RevisionControl::Perforce
- Defined in:
- lib/origen_perforce/origen_ext/revision_control/perforce.rb
Instance Attribute Summary collapse
-
#p4 ⇒ Object
readonly
P4 session.
-
#remote_file ⇒ Object
e.g.
Instance Method Summary collapse
- #_initialize_(options) ⇒ Object
- #build ⇒ Object
- #changes ⇒ Object
- #checkin ⇒ Object
- #checkout(path = nil, options = {}) ⇒ Object
- #current_branch ⇒ Object
- #diff_cmd ⇒ Object
- #local_modifications ⇒ Object
-
#print(options = {}) ⇒ Object
Downloads a file to a local directory, no workspace/client is created.
- #root ⇒ Object
- #unmanaged ⇒ Object
Instance Attribute Details
#p4 ⇒ Object (readonly)
P4 session
6 7 8 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 6 def p4 @p4 end |
#remote_file ⇒ Object
e.g. myfile.txt
9 10 11 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 9 def remote_file @remote_file end |
Instance Method Details
#_initialize_(options) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 11 def _initialize_() @remotes_method = :print @p4 = P4.new @p4.maxresults = 1 parse_remote @p4.connect unless @p4.connected? Origen.log.error("Could not connect to port #{@p4.port} on client #{@p4.client}!") fail end @p4.password = User.current.password @p4.run_login end |
#build ⇒ Object
68 69 70 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 68 def build not_yet_supported(__method__) end |
#changes ⇒ Object
60 61 62 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 60 def changes not_yet_supported(__method__) end |
#checkin ⇒ Object
64 65 66 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 64 def checkin not_yet_supported(__method__) end |
#checkout(path = nil, options = {}) ⇒ Object
36 37 38 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 36 def checkout(path = nil, = {}) not_yet_supported(__method__) end |
#current_branch ⇒ Object
44 45 46 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 44 def current_branch not_yet_supported(__method__) end |
#diff_cmd ⇒ Object
48 49 50 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 48 def diff_cmd not_yet_supported(__method__) end |
#local_modifications ⇒ Object
56 57 58 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 56 def local_modifications not_yet_supported(__method__) end |
#print(options = {}) ⇒ Object
Downloads a file to a local directory, no workspace/client is created. Perfect for read-only access like an application remote
27 28 29 30 31 32 33 34 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 27 def print( = {}) = { verbose: true, version: 'Latest' }.merge() cmd = [__method__.to_s, '-o', "#{@local}/#{@remote_file.to_s.split('/')[-1]}", @remote_file.to_s] run cmd end |
#root ⇒ Object
40 41 42 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 40 def root not_yet_supported(__method__) end |
#unmanaged ⇒ Object
52 53 54 |
# File 'lib/origen_perforce/origen_ext/revision_control/perforce.rb', line 52 def unmanaged not_yet_supported(__method__) end |