p4ruby 2014.2.0.pre5 → 2015.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/ext/P4/extconf.rb CHANGED
@@ -7,6 +7,10 @@ require 'net/ftp'
7
7
  require 'P4/version'
8
8
  require 'rbconfig'
9
9
 
10
+ # Set this to the main version directory we look up in ftp.perforce.com for the P4API
11
+ # This is ignored if you specify the version on the command line.
12
+ P4API_VERSION_DIR = 'r15.1'
13
+
10
14
  #==============================================================================
11
15
  # Provide platform variables in P4-specific format
12
16
 
@@ -370,6 +374,24 @@ def resolve_p4api_dir
370
374
  p4api_dir
371
375
  end
372
376
 
377
+ def resolve_ssl_dirs
378
+ ssl_dir = nil
379
+ # When running rake compile, use this instead of other options, I'm not sure how
380
+ # gem/bundler options are passed through via rake
381
+ if ENV.has_key?('ssl_dir')
382
+ ssl_dir = ENV['ssl_dir']
383
+ dir_config('ssl', "#{ssl_dir}/include", "#{ssl_dir}/lib")
384
+ puts "SSL Path #{ssl_dir}"
385
+ end
386
+ if ENV.has_key?('ssl_include_dir') && ENV.has_key?('ssl_lib_dir')
387
+ ssl_include_dir = ENV['ssl_include_dir']
388
+ ssl_lib_dir = ENV['ssl_lib_dir']
389
+ dir_config('ssl', ssl_include_dir, ssl_lib_dir)
390
+ puts "SSL Includes #{ssl_include_dir} Lib #{ssl_lib_dir}"
391
+ end
392
+ ssl_dir
393
+ end
394
+
373
395
  # Our 'cpu' label we use as part of the directory name on ftp.perforce.com
374
396
  def p4_cpu(os)
375
397
  cpu = RbConfig::CONFIG['target_cpu']
@@ -398,9 +420,11 @@ def p4_platform_label
398
420
  # Ruby on windows is only MinGW via Rubyinstaller.org, though this may
399
421
  # not work on all rubies.
400
422
  if RbConfig::CONFIG['MAJOR'].to_i >= 2
401
- raise 'We do not support Ruby 2.0+ on Windows, due to MinGW incompatibility with the C++ API'
423
+ # Note that x64 or x86 needs to be suffixed to this
424
+ 'mingw64'
425
+ else
426
+ 'mingwx86'
402
427
  end
403
- 'mingwx86'
404
428
  when /darwin/
405
429
  "darwin90#{p4_cpu(:darwin)}"
406
430
  when /solaris/
@@ -472,7 +496,10 @@ def download_api_via_ftp
472
496
  ftp.passive=true
473
497
  ftp.login
474
498
 
475
- version_dir = find_latest_version_dir(ftp)
499
+ # At one point, we allowed the gem build to just find the most recent p4api build.
500
+ # P4Ruby probably shouldn't do that by default.
501
+ #version_dir = find_latest_version_dir(ftp)
502
+ version_dir = P4API_VERSION_DIR
476
503
 
477
504
  dir = ftp_download_dir(version_dir)
478
505
  ftp.chdir(dir)
@@ -496,7 +523,6 @@ def downloaded_p4api_dir
496
523
  File.absolute_path(Dir.entries('.').select { |x| x =~ /^p4api/ and File.directory?(x) }.first)
497
524
  end
498
525
 
499
-
500
526
  #==============================================================================
501
527
  # Main script
502
528
 
@@ -523,7 +549,14 @@ puts "$LDFLAGS #{$LDFLAGS}"
523
549
  p4api_dir = resolve_p4api_dir
524
550
  puts "P4API Path #{p4api_dir}"
525
551
 
526
- do_ssl = have_library('ssl') and have_library('crypto')
552
+ resolve_ssl_dirs
553
+
554
+ # If we happen to need SSL on Windows, we also need gdi32
555
+ if RbConfig::CONFIG['target_os'].downcase =~ /mingw/
556
+ have_library('gdi32') or raise
557
+ end
558
+
559
+ do_ssl = have_library('crypto') and have_library('ssl')
527
560
 
528
561
  unless do_ssl
529
562
  have_library('p4sslstub') or raise
@@ -145,10 +145,12 @@ P4ClientApi::SetApiLevel( int level )
145
145
  int
146
146
  P4ClientApi::SetCharset( const char *c )
147
147
  {
148
+ StrRef cs_none( "none" );
149
+
148
150
  if( P4RDB_COMMANDS )
149
151
  fprintf( stderr, "[P4] Setting charset: %s\n", c );
150
152
 
151
- if( c )
153
+ if( c && cs_none != c )
152
154
  {
153
155
  CharSetApi::CharSet cs = CharSetApi::Lookup( c );
154
156
  if( cs < 0 )
@@ -198,9 +200,14 @@ P4ClientApi::SetDebug( int d )
198
200
  specMgr.SetDebug( d );
199
201
 
200
202
  if( P4RDB_RPC )
201
- p4debug.SetLevel( "rpc=5" );
203
+ p4debug.SetLevel( "rpc=5" );
202
204
  else
203
- p4debug.SetLevel( "rpc=0" );
205
+ p4debug.SetLevel( "rpc=0" );
206
+
207
+ if( P4RDB_SSL )
208
+ p4debug.SetLevel( "ssl=3" );
209
+ else
210
+ p4debug.SetLevel( "ssl=0" );
204
211
  }
205
212
 
206
213
  void
@@ -213,7 +220,7 @@ VALUE
213
220
  P4ClientApi::SetEnv( const char *var, const char *val )
214
221
  {
215
222
  Error e;
216
-
223
+
217
224
  enviro->Set( var, val, &e );
218
225
  if( e.Test() && exceptionLevel )
219
226
  {
@@ -223,7 +230,8 @@ P4ClientApi::SetEnv( const char *var, const char *val )
223
230
  if( e.Test() )
224
231
  return Qfalse;
225
232
 
226
- // Fixes an issue on OS X where the next enviro->Get
233
+ // Fixes an issue on OS X where the next enviro->Get doesn't return the
234
+ // cached value
227
235
  enviro->Reload();
228
236
 
229
237
  return Qtrue;
data/ext/P4/p4rubydebug.h CHANGED
@@ -41,5 +41,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41
41
  #define P4RDB_DATA ( debug > 2 )
42
42
  #define P4RDB_GC ( debug > 3 )
43
43
  #define P4RDB_RPC ( debug > 8 )
44
+ #define P4RDB_SSL ( debug > 10 )
44
45
 
45
46
  #endif
data/ext/P4/specmgr.cpp CHANGED
@@ -72,6 +72,8 @@ struct defaultspec {
72
72
  "Status;code:205;ro;fmt:R;seq:5;len:10;;"
73
73
  "Type;code:211;seq:6;type:select;fmt:L;len:10;"
74
74
  "val:public/restricted;;"
75
+ "ImportedBy;code:212;type:line;ro;fmt:L;len:32;;"
76
+ "Identity;code:213;type:line;;"
75
77
  "Description;code:206;type:text;rq;;"
76
78
  "Jobs;code:209;type:wlist;words:2;len:32;;"
77
79
  "Files;code:210;type:llist;len:64;;"
@@ -170,6 +172,9 @@ struct defaultspec {
170
172
  "MaxLockTime;code:407;type:word;len:12;;"
171
173
  "Timeout;code:406;type:word;len:12;;"
172
174
  "PasswordTimeout;code:409;type:word;len:12;;"
175
+ "LdapConfig;code:410;type:line;len:128;;"
176
+ "LdapSearchQuery;code:411;type:line;len:128;;"
177
+ "LdapUserAttribute;code:412;type:line;len:128;;"
173
178
  "Subgroups;code:404;type:wlist;len:32;opt:default;;"
174
179
  "Owners;code:408;type:wlist;len:32;opt:default;;"
175
180
  "Users;code:405;type:wlist;len:32;opt:default;;"
@@ -236,6 +241,20 @@ struct defaultspec {
236
241
  "protect",
237
242
  "Protections;code:501;type:wlist;words:5;opt:default;len:64;;"
238
243
  },
244
+ {
245
+ "remote",
246
+ "RemoteID;code:851;rq;ro;len:32;;"
247
+ "Address;code:852;rq;type:line;len:32;;"
248
+ "Owner;code:853;fmt:R;len:32;;"
249
+ "Options;code:854;type:line;len:32;val:"
250
+ "unlocked/lockednocompress/compress;;"
251
+ "Update;code:855;type:date;ro;fmt:L;len:20;;"
252
+ "Access;code:856;type:date;ro;fmt:L;len:20;;"
253
+ "Description;code:857;type:text;len:128;;"
254
+ "LastFetch;code:858;fmt:L;len:10;;"
255
+ "LastPush;code:859;fmt:L;len:10;;"
256
+ "DepotMap;code:860;type:wlist;words:2;len:64;;"
257
+ },
239
258
  {
240
259
  "specW",
241
260
  "Fields;code:351;type:wlist;words:5;rq;;"
@@ -268,7 +287,8 @@ struct defaultspec {
268
287
  "Description;code:709;type:text;len:128;;"
269
288
  "Options;code:707;type:line;len:64;val:"
270
289
  "allsubmit/ownersubmit,unlocked/locked,"
271
- "toparent/notoparent,fromparent/nofromparent;;"
290
+ "toparent/notoparent,fromparent/nofromparent,"
291
+ "mergedown/mergeany;;"
272
292
  "Paths;code:710;rq;type:wlist;words:2;maxwords:3;len:64;;"
273
293
  "Remapped;code:711;type:wlist;words:2;len:64;;"
274
294
  "Ignored;code:712;type:wlist;words:1;len:64;;"
@@ -302,12 +322,13 @@ struct defaultspec {
302
322
  "Type;code:752;rq;len:32;;"
303
323
  "Name;code:753;type:line;len:32;;"
304
324
  "Address;code:754;type:line;len:32;;"
305
- "Services;code:755;rq;len:128;;"
306
- "Description;code:756;type:text;len:128;;"
307
- "User;code:760;type:line;len:64;;"
308
- "ClientDataFilter;code:757;type:wlist;len:64;;"
309
- "RevisionDataFilter;code:758;type:wlist;len:64;;"
310
- "ArchiveDataFilter;code:759;type:wlist;len:64;;"
325
+ "ExternalAddress;code:755;type:line;len:32;;"
326
+ "Services;code:756;rq;len:128;;"
327
+ "Description;code:757;type:text;len:128;;"
328
+ "User;code:761;type:line;len:64;;"
329
+ "ClientDataFilter;code:758;type:wlist;len:64;;"
330
+ "RevisionDataFilter;code:759;type:wlist;len:64;;"
331
+ "ArchiveDataFilter;code:760;type:wlist;len:64;;"
311
332
  },
312
333
  { 0, 0 }
313
334
  };
data/lib/P4.rb CHANGED
@@ -133,14 +133,6 @@ class P4
133
133
  "servers" => ["server", "Name"],
134
134
  }
135
135
 
136
- def initialize
137
- # This will (eventually) call ClientApi::SetTrans(0) which should happen
138
- # when we have not set a charset or the environment detects the 'none'
139
- # setting. For whatever reason this is not done automatically by the API
140
- # logic.
141
- self.charset = nil if !self.charset or self.charset == 'none'
142
- end
143
-
144
136
  def method_missing( m, *a )
145
137
 
146
138
  # Generic run_* methods
data/lib/P4/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class P4
2
- Version = VERSION = '2014.2.0.pre5'
2
+ Version = VERSION = '2015.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: p4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2014.2.0.pre5
4
+ version: 2015.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perforce Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-09 00:00:00.000000000 Z
11
+ date: 2015-07-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby extensions to the C++ Perforce API.
14
14
  email: support@perforce.com
@@ -18,7 +18,7 @@ extensions:
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - LICENSE.txt
21
- - README
21
+ - README.md
22
22
  - ext/P4/clientprogressruby.cpp
23
23
  - ext/P4/clientprogressruby.h
24
24
  - ext/P4/clientuserruby.cpp
@@ -46,7 +46,7 @@ files:
46
46
  - ext/P4/undefdups.h
47
47
  - lib/P4.rb
48
48
  - lib/P4/version.rb
49
- homepage: http://www.perforce.com/product/components/apis
49
+ homepage: https://swarm.workshop.perforce.com/projects/perforce-software-p4ruby/
50
50
  licenses:
51
51
  - MIT
52
52
  metadata: {}
@@ -56,17 +56,17 @@ require_paths:
56
56
  - lib
57
57
  required_ruby_version: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - ">"
64
+ - - '>='
65
65
  - !ruby/object:Gem::Version
66
- version: 1.3.1
66
+ version: '0'
67
67
  requirements: []
68
68
  rubyforge_project:
69
- rubygems_version: 2.4.5
69
+ rubygems_version: 2.4.6
70
70
  signing_key:
71
71
  specification_version: 4
72
72
  summary: Ruby extensions to the C++ Perforce API
data/README DELETED
@@ -1,858 +0,0 @@
1
- Release Notes for
2
- P4Ruby, Perforce's script API for Ruby
3
-
4
- Version 2014.2
5
-
6
- Introduction
7
-
8
- This document lists all user-visible changes to P4Ruby
9
- from release 2007.3, the first supported P4Ruby release.
10
-
11
- Perforce numbers releases YYYY.R/CCCCC, e.g. 2002.1/30547.
12
- YYYY is the year; R is the release of that year; CCCCC is the
13
- bug fix change level. Each bug fix in these release notes is
14
- marked by its change number. Any build includes (1) all bug fixes
15
- of all previous releases and (2) all bug fixes of the current
16
- release up to the bug fix change level.
17
-
18
- P4Ruby is precompiled against a corresponding version of the Perforce
19
- C++ API, e.g., P4Ruby 2014.2 will be compiled using a 2014.2 version
20
- of the P4API. You can always install P4Ruby using a source-only
21
- variation, selecting a specific version of the P4API.
22
-
23
- To determine the version of your P4Ruby, and which version of the
24
- P4API it has been built with, issue the following command:
25
- ruby -rP4 -e "puts P4.identify"
26
-
27
- --------------------------------------------------------------------------
28
-
29
- Installing P4Ruby
30
-
31
- As of 2014.2, the recommended mechanism for installing P4Ruby is via gems.
32
-
33
- Outside of Windows, p4ruby gem installs must be compiled locally against
34
- your installation of Ruby. If you can build the core Ruby distribution
35
- locally, you likely can install P4Ruby without incident.
36
-
37
- On Windows, precompiled gems will be made available.
38
-
39
- The main command to install p4ruby is via gem or bundle.
40
-
41
- gem install p4ruby -- --with-p4api-dir=DIR
42
-
43
- In this case, the DIR above is the path to the C++ API distribution that
44
- should match the major and minor version of P4Ruby. If you omit the
45
- --with-p4api-dir option, the gem will attempt to download a version of the
46
- API itself from ftp.perforce.com.
47
-
48
- Alternatively, you can use Bundler (http://bundler.io). In your Gemfile,
49
- specify
50
-
51
- gem 'p4_web_api_client', '~> 2014.2'
52
-
53
- And then execute:
54
-
55
- bundle --with-p4api-dir=DIR
56
-
57
- Installing a prerelease version of P4Ruby
58
-
59
- Prereleases of upcoming versions are available also from RubyGems. The
60
- syntax for prereleases typically involves adding the '.preN' suffix to your
61
- version string, and indicating it directly.
62
-
63
- For example:
64
-
65
- # gem command line
66
- gem install p4ruby --version=2014.2.0.pre5 -- --with-p4api-dir=DIR
67
-
68
- # Gemfile, using range syntax
69
- gem 'p4ruby', '~> 2014.2.0.pre'
70
-
71
- --------------------------------------------------------------------------
72
-
73
- Building P4Ruby from Source
74
-
75
- 1. Download the Perforce C++ API from the Perforce FTP site at
76
- "ftp://ftp.perforce.com/perforce". The API archive is located
77
- in release and platform-specific subdirectories and is named
78
- "p4api.tgz".
79
-
80
- IMPORTANT: Mac OS X users MUST use the 'darwin' variant
81
- of the Perforce API. Using the 'macos' variant
82
- does not work.
83
-
84
- TODO - Document the correct directory for Ruby 2.0 and 2.1 on
85
- Windows when it is made available.
86
-
87
- Note: 32-bit builds of P4Ruby require a 32-bit version of the
88
- C++ API and a 32-bit version of Ruby. 64-bit builds of
89
- P4Ruby require a 64-bit version of the C++ API and a
90
- 64-bit version of Ruby.
91
-
92
- Unzip the archive into an empty directory.
93
-
94
- 2. Extract the P4Ruby API archive into a new, empty directory.
95
-
96
- 3. Execute the command:
97
-
98
- rake compile --p4api_dir=<absolute path to Perforce C++ API>
99
-
100
- 4. Test your distribution, which relies on a locally installed p4d,
101
- easily made available via the p4util project:
102
-
103
- # This downloads a matching p4d executable and puts it into the local
104
- # path work/p4d. You can replace these commands if you already have
105
- # the p4d version you want to test against.
106
- gem install p4util
107
- p4util download p4d
108
-
109
- # Run local tests
110
- rake test
111
-
112
- 5. Install P4Ruby into your local gem cache:
113
-
114
- rake install
115
-
116
- SSL support
117
- -----------
118
-
119
- Perforce Server 2012.1 and later supports SSL connections and the
120
- C++ API has been compiled with this support. For applications that
121
- do not requireSSL support the C++ API provides a stub library
122
- (libp4sslstub.*) to satisfy the linker requirements.
123
-
124
- If the P4Ruby build detects that OpenSSL is available, it will be
125
- included by default. To disable, execute the gem command using
126
- --without-ssllib. If you want to use libraries deployed to nonstandard
127
- paths, you will have to alter ext/P4/extconf.rb and include the
128
- dir_config() directives appropriate for your system.
129
-
130
- --------------------------------------------------------------------------
131
-
132
- Compatibility Statements
133
-
134
- Server Compatibility
135
-
136
- You can use any release of P4Ruby with any release of the
137
- Perforce server later than 2001.1
138
-
139
- API Compatibility
140
-
141
- The 2014.2 release of P4Ruby supports the 2014.2 Perforce API.
142
- Older releases might work but are not supported.
143
-
144
- Ruby Compatibility
145
-
146
- The 2014.2 release of P4Ruby is supported by installing the gem
147
- with Ruby MRI releases 2.0, 2.1, and 2.2 with shared library
148
- support.
149
-
150
- For detailed compatibility, please check the following table:
151
-
152
- Ruby Release | P4Ruby Release
153
- ===================================
154
- 1.6 | up to 2009.2 (unsupported)
155
- 1.8 | 2007.3 or later (unsupported)
156
- 1.9 | 2011.1 or later
157
- 2.0 | 2014.1 or later
158
- 2.1 | 2014.2 or later
159
- 2.2 | 2014.2 or later
160
-
161
- TODO 2014.2.0.pre4 needs mingw-w64 builds to support Ruby on windows
162
-
163
- It is recommended that you use a Ruby distribution that can deploy
164
- native gems easily, which, outside of Windows means obtaining a source
165
- distribution of ruby and building it locally. This is easily done via RVM,
166
- and can be installed system-wide, with other features (like wrappers) that
167
- allow you to update the local installation of Ruby as security patches are
168
- released. If using RVM, be sure to use --disable-binary when installing
169
- your version of Ruby, to avoid any precompiled distributions that may not
170
- have shared library support configured, which is needed for Ruby
171
- extensions.
172
-
173
- In general, Ruby VMs installed via package managers are not officially
174
- coordinated with the MRI releases available on ruby-lang.org. You will
175
- have to investigate the reliability of the source of your Ruby
176
- distribution. In general, Ruby web application deployments avoid default
177
- installations of Ruby, though your requirements may vary.
178
-
179
- OpenSSL Compatibility
180
-
181
- To build P4Ruby with encrypted communication support, you must
182
- use the version of OpenSSL that Perforce C/C++ API has been
183
- built against. Running P4Ruby linked to an older library will
184
- fail with the error:
185
-
186
- "SSL library must be at least version 1.0.1."
187
-
188
- The 2014.1 release of P4Ruby is supported with OpenSSL 1.0.1
189
-
190
- For detailed compatibility, please check the following table:
191
-
192
- Perforce C/C++ API Version | OpenSSL Release
193
- ============================================
194
- 2012.1 | 1.0.0
195
- 2012.2 | 1.0.1g+
196
- 2014.1 | 1.0.1g+
197
- 2014.2 | 1.0.1i+
198
-
199
- Platform Compatibility
200
-
201
- While P4Ruby is generally portable, this release is certified
202
- only on the following platforms:
203
-
204
- Linux 2.6 Intel (x86, x86_64)
205
- Windows XP SP2+, 2003, Vista, 7, 2008 Intel (x86), 8.1
206
- Mac OS X 10.6, 10.7, 10.8 (x86_64), 10.9 (x86_64), 10.10 (x86_64)
207
-
208
- Note: As of 2012.1, a universal build of the Perforce C/C++
209
- API is no longer available for Darwin. P4Ruby is now
210
- a 64-bit only library on Darwin and must be built with
211
- a 64-bit version of the Perforce C/C++ API for Darwin.
212
- This has been tested with a universal build of Ruby and
213
- is known to work.
214
-
215
- Compiler Compatibility
216
-
217
- To build P4Ruby from source, you must use a version of Ruby that
218
- has been compiled with the same compiler used to build the
219
- Perforce C++ API: for most platforms, use gcc/g++.
220
-
221
- Attempting to use a different compiler or a different version
222
- of the compiler causes linker errors due to differences in name
223
- handling between compilers.
224
-
225
- Compatibility with Previous Releases
226
-
227
- Unless otherwise stated below, the 2014.1 release of P4Ruby is
228
- compatible with previous releases from Perforce Software.
229
-
230
- Known Limitations
231
-
232
- The Perforce client-server protocol is not designed to support
233
- multiple concurrent queries over the same connection. For this
234
- reason, multi-threaded applications using the C++ API or the
235
- script APIs (P4Perl, P4Ruby, etc.) should ensure that a
236
- separate connection is used for each thread or that only one
237
- thread may use a shared connection at a time.
238
-
239
- Compatibility with P4Ruby from the Public Depot
240
-
241
- Perforce P4Ruby is significantly different from the P4Ruby in
242
- the Perforce Public Depot. It contains several improvements and
243
- interface changes intended to make P4Ruby consistent with the
244
- other scripting interfaces, and with Ruby in general.
245
-
246
- If you are migrating from Public Depot P4Ruby, edit your
247
- scripts to ensure that they comply with the new interface.
248
- The differences are detailed below.
249
-
250
- Deleted Methods
251
- ---------------
252
- The following methods have been deleted from the P4 class and
253
- are no longer available:
254
-
255
- output The output is returned by the run* methods
256
- parse_forms Form parsing is now always on
257
- tagged See tagged? and tagged= below.
258
-
259
- Public Depot P4Ruby also contained compatibility interfaces
260
- for the following methods, all of which have been removed. In
261
- these cases, the method on the right-hand side has also been in
262
- Public Depot P4Ruby for some time, and most scripts use
263
- that form already.
264
-
265
- Public Depot Method Perforce P4Ruby Method
266
- ------------------- ----------------------
267
- cwd cwd=
268
- client client=
269
- host host=
270
- port port=
271
- user user=
272
- debug debug=
273
- exception_level exception_level=
274
-
275
- NOTE: Some of these method names have been re-used as
276
- attribute readers (instead of writers). See the following
277
- list of new methods.
278
-
279
- New Methods
280
- -----------
281
- The following methods are new to Perforce P4Ruby:
282
-
283
- api_level Returns the API compatibility level
284
- connected? Returns true if the client is connected
285
- maxresults Returns the current maxresults limit
286
- maxscanrows Returns the current maxscanrows limit
287
- maxlocktime Returns the current maxlocktime limit
288
- maxlocktime= Sets the current maxlocktime limit
289
- p4config_file Returns the path of the P4CONFIG file
290
- prog Returns the name of the program (if set)
291
- server_level Returns the (numeric) level of the server
292
- tagged? Returns true if tagged mode is enabled
293
- tagged= Enable or disable tagged mode
294
- ticket_file Returns the path to the current ticket file
295
- ticket_file= Sets the path to the current ticket file
296
- version Returns the version of the script
297
- version= Sets the version of the script
298
-
299
- Renamed Methods
300
- ---------------
301
- In Public Depot P4Ruby, many methods were assigned names
302
- that end in a question mark (?), but the convention in
303
- Ruby is that only methods that return booleans have names
304
- ending with a question mark. Perforce P4Ruby follows this
305
- convention, so the following methods in Public Depot
306
- P4Ruby have been renamed according to the table below:
307
-
308
- Public Depot Method Perforce P4Ruby Method
309
- ------------------- ----------------------
310
- charset? charset
311
- client? client
312
- cwd? cwd
313
- exception_level? exception_level
314
- host? host
315
- password? password
316
- port? port
317
- user? user
318
-
319
- In addition, the following methods have been renamed for clarity
320
- and consistency across the Perforce scripting interfaces:
321
-
322
- Old name New name
323
- -------- --------
324
- api= api_level=
325
- submit_spec run_submit
326
-
327
- Tagged Mode and Form Parsing
328
- ----------------------------
329
- In Public Depot P4Ruby, tagged output and form parsing mode were
330
- off by default, but most scripts turned them on immediately. In
331
- Perforce P4Ruby, both form parsing and tagged output are on by
332
- default.
333
-
334
- Form parsing cannot be explicitly disabled, but tagged output can
335
- be turned on and off by setting p4.tagged as follows:
336
-
337
- p4.tagged = false # Disabled
338
- p4.tagged = true # Enabled
339
-
340
- Because form parsing does not work when tagged output is disabled,
341
- this method can be used to disable form parsing if necessary.
342
-
343
- --------------------------------------------------------------------------
344
-
345
- Key to symbols used in change notes below.
346
-
347
- * -- requires new P4Ruby
348
- ** -- requires P4Ruby built with new P4API
349
- *** -- requires new p4d server program
350
-
351
- --------------------------------------------------------------------------
352
-
353
- New functionality in 2014.2
354
-
355
- # (SIR#28879 / P4RUBY-25)
356
- Release P4Ruby as Gem. Until this point, the gems available
357
- on rubygems.org were unofficial builds, and prone to fail in
358
- non-interactive environments like bundler.
359
-
360
- # (SIR#75097 / P4RUBY-169)
361
- Add `enviro_file` property to P4 object, which underneath, uses the
362
- new `SetEnviroFile`/`GetEnviroFile` mechanism from the 14.2 C++ API.
363
-
364
- Changes in 2014.2.0.pre5
365
-
366
- * Fixed an issue where using the --with-p4api-dir option to gem install
367
- would not actually set up the include and lib compilation directory
368
- correctly.
369
-
370
- * No longer distributing precompiled builds for linux or OS X due to
371
- inadequate information from gem to match the Ruby distribution correctly.
372
-
373
- * No longer embedding the C++ P4API to keep the total file size down to
374
- allow the gem to be distributed via RubyGems.org.
375
-
376
- * Changed logic to call p4.charset=nil if charset is already nil or resolves
377
- to 'none'. Internally, this will trigger a call to ClientApi::SetTrans(0),
378
- which should disable character set autodetection.
379
-
380
- Bugs fixed in 2014.2.0.pre4
381
-
382
- * (BUG#77207 / P4RUBY-176)
383
- If the user has specified 'P4CHARSET=none' in a configuration file, or
384
- has not set p4.charset='auto' (and it's default value was initialized to
385
- 'none' by the C++ API), automatically disable character set detection.
386
- This can cause the API to break when connecting to non-unicode servers
387
- even though it appears to be configured to not be a unicode client.
388
-
389
- * The default C++ API version should be included with the gem source, to
390
- avoid calls to ftp.perforce.com.
391
-
392
- Bugs fixed in 2014.2.0.pre3
393
-
394
- * (BUG#75096 / P4RUBY-168)
395
- Spec mappings updated to 14.2 definitions.
396
-
397
- * (TASK#76795 / P4RUBY-176)
398
- Configuring pre-compiled gems for Linux and OS X, for supported
399
- Ruby versions (2.0, 2.1, 2.2).
400
-
401
- Bugs fixed in 2014.2.0.pre2
402
-
403
- # (BUG#76321 / P4RUBY-171)
404
- `gem install` fails using source gem distribution inside of a Docker
405
- environment due to passive FTP mode not enabled early enough.
406
-
407
- New functionality in 2014.1
408
-
409
- # 807216 (SIR#70070) * ***
410
- P4Ruby now supports the P4IGNORE file feature introduced
411
- in the 2013.2 server. Three new methods have been added
412
- to support this functionality:
413
-
414
- P4#ignore_file - Report current file
415
- P4#ignore_file= - Set ignore file
416
- P4#ignored?( <file> ) - Test if <file> is
417
- ignored
418
-
419
- # 807216, 750979 (SIR#70093) *
420
- P4Ruby now supports the Ruby 2.0 series of rubies.
421
-
422
- Bugs fixed in 2013.1
423
-
424
- #733921 (Bug#63887) *
425
- P4Ruby no longer crashes when an exception is raised from
426
- the block passed to P4#run_resolve.
427
-
428
- New functionality in 2012.2
429
-
430
- #525301 (Bug #59803) *
431
- P4Ruby now supports Apple Mountain Lion (10.8).
432
-
433
- #509253 (Bug #56480) *
434
- Added P4#run_tickets() method to list local tickets.
435
- Note that P4.run('tickets') still gives the old error
436
- message "Must upgrade to 2004.2 p4 to access tickets."
437
-
438
- #505980 (Bug #56514) * ** ***
439
- Support for the new progress indicator API. P4Ruby
440
- supplies a new progress attribute, which can take an
441
- instance of P4::Progress class or subclass. Progress
442
- information is currently only supported for submits and
443
- 'sync -q'. Details can be found in the documentation.
444
-
445
- #499586 (Bug #56520) *
446
- New convenience method P4#each_<specs>() that allows
447
- easy iteration through some or all spec objects such as
448
- clients or changes. Details can be found in the documentation.
449
-
450
- Bugs fixed in 2012.2
451
-
452
- #525097 (Bug #59786) *
453
- Building P4Ruby with MinGW could generate the link error.
454
-
455
- g++: unrecognized option '-static-libstdc++'
456
-
457
- This has been fixed.
458
-
459
- #505548 (Bug #58649) *
460
- P4#parse_client could raise the exception "Unknown field name
461
- 'StreamAtChange'." when parsing a stream client workspace.
462
- Internal spec definition has been updated to resolve this.
463
-
464
- --------------------------------------------------------------------------
465
- --------------------------------------------------------------------------
466
-
467
- New functionality in 2012.1
468
-
469
- #419591 (Bug #51895) * ** ***
470
- P4Ruby supports SSL connections if compiled with SSL support.
471
- Instructions on how to compile with SSL support can be found
472
- at the top of this document under "Building P4Ruby from Source"
473
- and in the documentation.
474
-
475
- P4.identify will report the version of the OpenSSL library
476
- used to build the Perforce C++ API (not the version P4Ruby
477
- is linked against).
478
-
479
- #415643 *
480
- P4Ruby will now only build a 64-bit version of the library
481
- on Darwin.
482
-
483
- #413362 (Bug #51899) * **
484
- Enable "action resolve" to support resolves of branches,
485
- deletes and file types. The existing P4::MergeData class
486
- has been extended and the additional attributes will be
487
- populated for an 'action resolve'. Details of the
488
- additional attributes can be found in the documentation.
489
-
490
- Bugs fixed in 2012.1
491
-
492
- #420839 (Bug #52952) *
493
- Accessing the base_name attribute of a P4::MergeData
494
- object resulted in a segmentation fault when resolving
495
- binary files. This has now been fixed and all empty
496
- fields will return Nil.
497
-
498
- #410916
499
- #410702 (Bug #52320) *
500
- Exceptions thrown during P4.run_resolve are now raised
501
- up to the user. If an exception is encountered during the
502
- block's execution, P4Ruby will skip the remaining files.
503
-
504
- --------------------------------------------------------------------------
505
- --------------------------------------------------------------------------
506
-
507
- New functionality in 2011.1
508
-
509
- #405913 *
510
- New method P4#messages() returns all messages from the
511
- server as objects. Script writers can test the severity
512
- of the messages to know if they are output messages (E_INFO),
513
- warnings (E_WARN), or errors (E_FAILED/E_FATAL).
514
-
515
- P4#errors() and P4#warnings still return the errors and
516
- warnings as strings for backwards compatibility.
517
-
518
- P4::Message objects have the following methods:
519
-
520
- P4::Message#severity - Returns the severity of the
521
- message, which may be one of the
522
- following values:
523
-
524
- E_EMPTY # nothing yet
525
- E_INFO # something good happened
526
- E_WARN # something not good happened
527
- E_FAILED # user did something wrong
528
- E_FATAL # system broken -- nothing can continue
529
-
530
- P4::Message#generic - Returns the generic class of
531
- the error, which may be one
532
- of the following values:
533
-
534
- EV_NONE # misc
535
- EV_USAGE # request not consistent with dox
536
- EV_UNKNOWN # using unknown entity
537
- EV_CONTEXT # using entity in wrong context
538
- EV_ILLEGAL # trying to do something you can't
539
- EV_NOTYET # something must be corrected first
540
- EV_PROTECT # protections prevented operation
541
- EV_EMPTY # action returned empty results
542
- EV_FAULT # inexplicable program fault
543
- EV_CLIENT # client side program errors
544
- EV_ADMIN # server administrative action required
545
- EV_CONFIG # client configuration inadequate
546
- EV_UPGRADE # client or server too old to interact
547
- EV_COMM # communications error
548
- EV_TOOBIG # not even Perforce can handle this much
549
-
550
- P4::Message#msgid - Return the unique ID of the
551
- message.
552
-
553
- P4::Message#to_s - Convert the object to a string
554
-
555
- P4::Message#inspect - Debugging support
556
-
557
-
558
- #338410 (Bug #47374) *
559
- P4Ruby supports setting values in the registry (on those
560
- platforms that support it).
561
- The command P4#set_env( var, val ) will set a registry
562
- variable on platforms that support this action or raise
563
- a P4Exception for those that don't.
564
- The command P4#set_env( var, "" ) unsets a registry variable.
565
-
566
- #333292 (Bug #36121) *
567
- P4Ruby now supports Ruby 1.9
568
-
569
- #331384 *
570
- P4Ruby can now be compiled with the Mingw compiler using
571
- the MinGW P4Api build.
572
-
573
- #328203 (Bug #45861) * **
574
- Enable streams in P4Ruby by default. With this change,
575
- streams specific specs such as streams depots are listed.
576
- Disable the listing of streams specific specs by either
577
- setting the api_level to a value below 70 or by disabling
578
- stream handling explicitly through the P4.streams attribute:
579
-
580
- p4.streams = false
581
-
582
- #322353 (Bug #42250) *
583
- P4Ruby supports a callback interface by providing a
584
- P4#handler attribute. Set P4#handler to an instance of a
585
- subclass of P4::OutputHandler to enable callbacks.
586
- When a handler is defined, P4Ruby will invoke the handler
587
- for every response it receives from the Perforce Server
588
- immediately instead of collecting all results together in
589
- an array first. This can be used to make applications more
590
- scalable and more responsive if large results are expected.
591
- See the documentation for details on the OutputHandler class.
592
-
593
- Bugs fixed in 2011.1
594
-
595
- #405913 (Bug #43426) *
596
- Running 'print' on a file that started with '---' would
597
- cause an exception in Ruby. This is now fixed.
598
- There is still an oddity when p4.track = 1 and a user runs
599
- p4.run_print() on a file that only has lines starting with
600
- '--- '. In that case, the output of the print is lost.
601
- Disable tracking by setting p4.track = 0 (the default) will
602
- solve this problem.
603
-
604
- #405913 (Bug #41350) *
605
- Info messages now shown in P4#Messages.
606
-
607
- #385159 (Bug #49324) **
608
- On Windows Vista, Windows 7, or Windows 2008, a client running as
609
- Administrator would fail to properly process file names in
610
- non-ASCII character sets (such as Shift-JIS).
611
-
612
- #338903 (Bug #44589) *
613
- Extra dot at the end of the extracted directory path has been
614
- removed.
615
-
616
- #338437 (Bug #39580) *
617
- P4#identify() reports the platform on AMD64 as X86_64
618
- in line with all other Perforce products.
619
-
620
- #332453 *
621
- Updated the stored spec templates for client, change, group,
622
- spec and user. Added spec template for new spec type
623
- streams. These are required, for example, for form-triggers
624
- that do not connect to the server first.
625
-
626
- #329351 (Bug #41271) *
627
- Include 'extraTag' fields in P4::Spec objects
628
-
629
- #328578 (Bug #39264) *
630
- P4#identify() now reports P4Ruby as P4RUBY in line with all
631
- other Perforce products. It will also include the build
632
- number of the Perforce C/C++ API that it is built with.
633
-
634
- --------------------------------------------------------------------------
635
- --------------------------------------------------------------------------
636
-
637
- New functionality in 2010.2
638
-
639
- #260859 *
640
- Added new SetTrack() and GetTrack() methods.
641
- For more details about server performance tracking see:
642
- http://kb.perforce.com/article/883
643
-
644
- #255945 *
645
- #255949 *
646
- #269012 *
647
- New method P4#messages() returns all messages from the
648
- server as objects. Script writers can test the severity
649
- of the messages to know if they are output messages (E_INFO),
650
- warnings (E_WARN), or errors (E_FAILED/E_FATAL).
651
-
652
- P4#errors() and P4#warnings still return the errors and
653
- warnings as strings for backwards compatibility.
654
-
655
- P4::Message objects have the following methods:
656
-
657
- P4::Message#severity - Returns the severity of the
658
- message, which may be one of the
659
- following values:
660
-
661
- E_EMPTY # nothing yet
662
- E_INFO # something good happened
663
- E_WARN # something not good happened
664
- E_FAILED # user did something wrong
665
- E_FATAL # system broken -- nothing can continue
666
-
667
- P4::Message#generic - Returns the generic class of
668
- the error, which may be one
669
- of the following values:
670
-
671
- EV_NONE # misc
672
- EV_USAGE # request not consistent with dox
673
- EV_UNKNOWN # using unknown entity
674
- EV_CONTEXT # using entity in wrong context
675
- EV_ILLEGAL # trying to do something you can't
676
- EV_NOTYET # something must be corrected first
677
- EV_PROTECT # protections prevented operation
678
- EV_EMPTY # action returned empty results
679
- EV_FAULT # inexplicable program fault
680
- EV_CLIENT # client side program errors
681
- EV_ADMIN # server administrative action required
682
- EV_CONFIG # client configuration inadequate
683
- EV_UPGRADE # client or server too old to interact
684
- EV_COMM # communications error
685
- EV_TOOBIG # not even Perforce can handle this much
686
-
687
- P4::Message#msgid - Return the unique ID of the
688
- message.
689
-
690
- P4::Message#to_s - Convert the object to a string
691
-
692
- P4::Message#inspect - Debugging support
693
-
694
- Bugs fixed in 2010.2
695
-
696
- #287185 (Bug #43426)
697
- Running 'print' on a file that started with '---' would
698
- cause an exception in Ruby. This is now fixed.
699
- There is still an oddity when p4.track = 1 and a user runs
700
- p4.run_print() on a file that only has lines starting with
701
- '--- '. In that case, the output of the print is lost.
702
- Disable tracking by setting p4.track = 0 (the default) will
703
- solve this problem.
704
-
705
- --------------------------------------------------------------------------
706
- --------------------------------------------------------------------------
707
-
708
- New functionality in 2010.1
709
-
710
- #232984 *
711
- Removed old Ruby 1.6 compatibility code that was no longer
712
- required. This paves the way for Ruby 1.9 compatibility.
713
-
714
- #230644 *
715
- It's now unnecessary to run a command before calling the
716
- following methods:
717
-
718
- P4#server_level
719
- P4#server_case_sensitive?
720
- P4#server_unicode?
721
-
722
- If no command has been run, P4Ruby will automatically run a
723
- 'p4 info' in order to gather the required information.
724
-
725
- #230191 *
726
- Added new P4#server_unicode? method that allows script
727
- writers to test whether or not a Perforce Server is in
728
- internationalized (unicode) mode. At least one Perforce
729
- command must have been executed against the server before
730
- this method can be called.
731
-
732
- #230190 *
733
- Added new P4::VERSION, P4::OS, and P4::PATCHLEVEL constants
734
- so that script writers can test the installation of P4Ruby
735
- without having to parse the output of P4::Identify()
736
-
737
- Bugs fixed in 2010.1
738
-
739
- (none)
740
-
741
- --------------------------------------------------------------------------
742
- --------------------------------------------------------------------------
743
-
744
- New functionality in 2009.2
745
-
746
- #214454 (Bug #32916) *
747
- P4#port= now raises a P4Exception if called after P4#connect().
748
-
749
- #214449 (Bug #35416) *
750
- Added a P4#server_case_sensitive? method that enables scripts
751
- to detect whether the server is case-sensitive. Cannot be
752
- called until a command has been issued to the server.
753
-
754
- Bugs fixed in 2009.2
755
-
756
- #214445,214999 (Bug #35410) *
757
- P4Ruby now correctly tracks disconnects from the server.
758
-
759
- #222727 (Bug #36568) *
760
- The Map class removed '-' and '+' from the path if the
761
- form Map.insert(lhs, rhs) was used, even if these characters
762
- did not appear at the beginning of the path.
763
- Now dashes and pluses are preserved within the path.
764
-
765
- --------------------------------------------------------------------------
766
- --------------------------------------------------------------------------
767
-
768
- New functionality in 2009.1
769
-
770
- #191900 (Bug #26729) *
771
- A new method:
772
-
773
- P4#tagged( aBool ) { block }
774
-
775
- has been added to the P4 class. This method temporarily
776
- toggles the use of tagged output for the duration of
777
- the block and resets it when the block terminates.
778
-
779
- Bugs fixed in 2009.1
780
-
781
- #191889 (Bug #29911) *
782
- Calling P4#run_resolve() or P4#run( 'resolve' ) without
783
- a block or a previous call to P4#input no longer causes an
784
- infinite loop.
785
-
786
- #191623,191627 (Bug #32918) *
787
- P4Ruby now correctly parses jobs when the jobspec contains
788
- field names ending in numbers.
789
-
790
- --------------------------------------------------------------------------
791
- --------------------------------------------------------------------------
792
-
793
- New functionality in 2008.2
794
-
795
- #162422 (Bug #30364) *
796
- #166158 *
797
- A new class, P4::Map, enables users to
798
- create and use Perforce mappings without requiring
799
- a connection to a server. Methods in the P4::Map class are:
800
-
801
- P4::Map.new Constructor
802
- P4::Map.join Join two maps to create a third
803
- P4::Map#clear Empty a map
804
- P4::Map#count Return the number of entries
805
- P4::Map#empty? Tests whether a map object is empty
806
- P4::Map#insert Inserts an entry into the map
807
- P4::Map#translate Translate a string through a map
808
- P4::Map#includes? Tests whether a path is mapped
809
- P4::Map#reverse Swap left and right sides of the mapping
810
- P4::Map#lhs Returns the left side as an array
811
- P4::Map#rhs Returns the right side as an array
812
- P4::Map#to_a Returns the map as an array
813
-
814
- Bugs fixed in 2008.2
815
-
816
- #169159 (Bug #29935, Bug #31096) *
817
- #165338 *
818
- P4Ruby now correctly loads the value of P4CHARSET from the
819
- environment.
820
-
821
- --------------------------------------------------------------------------
822
- --------------------------------------------------------------------------
823
-
824
- New functionality in 2008.1
825
-
826
- #152356 (Bug #29022) *
827
- A new method 'P4#env( var )' method has been added to
828
- the P4 class. This instance method enables the caller
829
- to interrogate the Perforce environment, including
830
- reading Perforce variables from P4CONFIG files and,
831
- on Windows, the registry. P4#cwd= now loads any
832
- P4CONFIG file settings that are appropriate to the
833
- new working directory.
834
-
835
- #153005 (Bug #29308) *
836
- P4Ruby now supports Mac OS X 10.5.
837
-
838
- --------------------------------------------------------------------------
839
- --------------------------------------------------------------------------
840
-
841
- Bugs fixed in 2007.3
842
-
843
- #151167 (Bug #28774) *
844
- The Makefile generated on some Linux platforms (notably
845
- Ubuntu 7.10) was not correct, and attempted to link P4Ruby
846
- using 'cc' instead of 'c++', causing an 'undefined symbol'
847
- error (typically '_ZTVN10__cxxabiv120__si_class_type_infoE') ,
848
- when attempting to use P4Ruby. This problem has been corrected.
849
-
850
- #150577 (Bug #28704) *
851
- The presence of deleted revisions in a file's history
852
- might lead to incorrect fileSize and digest
853
- attributes for other revisions in the output of
854
- P4#run_filelog. This problem has been corrected.
855
-
856
- #150576 (Bug #28773) *
857
- P4::Revision#filesize() always returned nil. This
858
- problem has been corrected.