This class just provides two globally accessible Perforce client instances
without the use of global variables. One P4 client runs in tagged mode and
one in untagged mode. Most of the queries need tagged mode, but when we
want to run a "p4 job -o" to archive the job, we need it in plain
text.
This class is also the reason why P4Table is not
thread safe as all of the other classes that execute commands use it
directly. I wanted to avoid excessive passing of P4 objects but in the end
I'll probably have to go that way.
Set the username for both tagged and untagged mode
# File P4table.rb, line 138
def P4Global.p4user=( user )
@@p4t.user = user
@@p4u.user = user
end
Set the port for both tagged and untagged mode
# File P4table.rb, line 144
def P4Global.p4port=( port )
@@p4t.port = port
@@p4u.port = port
end
Set the password for both tagged and untagged mode
# File P4table.rb, line 150
def P4Global.p4passwd=( password )
@@p4t.password = password
@@p4u.password = password
end
Set the clientspec for both tagged and untagged mode
# File P4table.rb, line 156
def P4Global.p4client=( client )
@@p4t.client = client
@@p4u.client = client
end
Connect both tagged and untagged clients to the server
# File P4table.rb, line 162
def P4Global.connect
@@p4t.connect
@@p4u.connect
end
Disconnect both tagged and untagged mode clients
# File P4table.rb, line 168
def P4Global.disconnect
@@p4t.disconnect
@@p4u.disconnect
end
Returns the tagged mode client
# File P4table.rb, line 174
def P4Global.tagged
@@p4t
end
Returns the untagged mode client
# File P4table.rb, line 179
def P4Global.plain
@@p4u
end
Sets the debug level for both tagged and untagged mode (2 is good)
# File P4table.rb, line 184
def P4Global.debug=( level )
@@p4t.debug = level
@@p4u.debug = level
end