In: |
p4table.rb
|
Parent: | Object |
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.
Connect both tagged and untagged clients to the server
# File p4table.rb, line 162 162: def P4Global.connect 163: @@p4t.connect 164: @@p4u.connect 165: end
Sets the debug level for both tagged and untagged mode (2 is good)
# File p4table.rb, line 184 184: def P4Global.debug=( level ) 185: @@p4t.debug = level 186: @@p4u.debug = level 187: end
Disconnect both tagged and untagged mode clients
# File p4table.rb, line 168 168: def P4Global.disconnect 169: @@p4t.disconnect 170: @@p4u.disconnect 171: end
Set the clientspec for both tagged and untagged mode
# File p4table.rb, line 156 156: def P4Global.p4client=( client ) 157: @@p4t.client = client 158: @@p4u.client = client 159: end
Set the password for both tagged and untagged mode
# File p4table.rb, line 150 150: def P4Global.p4passwd=( password ) 151: @@p4t.password = password 152: @@p4u.password = password 153: end
Set the port for both tagged and untagged mode
# File p4table.rb, line 144 144: def P4Global.p4port=( port ) 145: @@p4t.port = port 146: @@p4u.port = port 147: end
Set the username for both tagged and untagged mode
# File p4table.rb, line 138 138: def P4Global.p4user=( user ) 139: @@p4t.user = user 140: @@p4u.user = user 141: end