p4ruby 2015.2.1313860-x64-mingw32 → 2017.1.1653916-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73e4b9f6234827fbec3f47789391b824fcc33502
4
- data.tar.gz: 74b12eed0d47beb88a40f4daa7586d526c18ad14
3
+ metadata.gz: 2254ac296f5f9bd45f373043f5bcc39b5fbf3493
4
+ data.tar.gz: f0844a9b06ac508f98d0f04ff45358b828b3748c
5
5
  SHA512:
6
- metadata.gz: d4645757dc65a3cd6e84ae77484c6717efecaa1645c3df99d0d3f3e13b17f9bfa54a3674013f3d90ee594ebb03af1e2fd4bf38ef6b92c37dee5d8be12f1bd2c9
7
- data.tar.gz: 98848a88e3ffa087b3529c0784486e5e67db2947f774797e6388a32f7dadc52cf4060732629e40935519717b18be39e803a29ed327f7ea442bdbde1dd8fe7142
6
+ metadata.gz: 664fab4633c90a33ab31655c261093a0949e8ea9c12b41ce7b1d9a9cb2ead12c18b2875fa37c831acb37025d757e3915cf976bdaba9153d6d7a6210d1b9c6f1f
7
+ data.tar.gz: 0a7a454ac7d60165c833ee218a181ff7e35785afcc7b9c9df645b180fc65623dc8d43c1edd058bca2ddc4a92b0f8cc3cfa53c4ad9ecb0ac250d41a594fb4034f
data/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # Release Notes for P4Ruby, Perforce's script API for Ruby
2
2
 
3
- Version 2015.2
3
+ Version 2017.1
4
4
 
5
5
  ## Introduction
6
6
 
7
- P4Ruby is a native Ruby gem that allows you to run Perforce commands from
7
+ P4Ruby is a native Ruby gem that allows you to run Perforce commands from
8
8
  Ruby applications, and retrieve the results in a Ruby-friendly format.
9
9
 
10
10
  P4Ruby is intended to work against a corresponding version of the Perforce
11
- C++ API, e.g., P4Ruby 2015.2 will be compiled using a 2015.2 version
12
- of the P4API. You can always install P4Ruby specifying a specific version of
11
+ C++ API, e.g., P4Ruby 2017.1 will be compiled using a 2017.1 version
12
+ of the P4API. You can always install P4Ruby specifying a specific version of
13
13
  the P4API.
14
14
 
15
15
  To determine the version of your P4Ruby, and which version of the
@@ -21,13 +21,13 @@ P4API it has been built with, issue the following command:
21
21
 
22
22
  ### Installing P4Ruby
23
23
 
24
- As of 2014.2, the recommended mechanism for installing P4Ruby is via
24
+ As of 2014.2, the recommended mechanism for installing P4Ruby is via
25
25
  rubygems.org.
26
26
 
27
27
  Before installing, please take care that any older version of P4Ruby that
28
28
  may have been installed outside of the Gem process is removed from your
29
29
  gempath. The older installation process can not be easily removed and may
30
- conflict with a gem-based install. Make sure that both P4.rb and P4.so (or
30
+ conflict with a gem-based install. Make sure that both P4.rb and P4.so (or
31
31
  P4.bundle on OS X) are not available within the load path of Ruby. You can
32
32
  use the `puts $:` command in `irb` to determine your current load path.
33
33
 
@@ -36,8 +36,8 @@ your installation of Ruby. If you can build the core Ruby distribution
36
36
  locally, you likely can install P4Ruby without incident. On Windows,
37
37
  precompiled gems are available, which already include the P4API and OpenSSL.
38
38
 
39
- The main command to install p4ruby is via gem or bundler. (When using the
40
- default system rubies from OS X or the CentOS Software Collections Library,
39
+ The main command to install p4ruby is via gem or bundler. (When using the
40
+ default system rubies from OS X or the CentOS Software Collections Library,
41
41
  see 'Problems Specifying P4API' below.)
42
42
 
43
43
  gem install p4ruby
@@ -58,15 +58,15 @@ API itself from ftp.perforce.com.
58
58
  Alternatively, you can use Bundler (http://bundler.io). In your Gemfile,
59
59
  specify
60
60
 
61
- gem 'p4ruby', '~> 2015.2'
61
+ gem 'p4ruby', '~> 2017.1'
62
62
 
63
63
  And then execute:
64
64
 
65
65
  bundle --with-p4api-dir=DIR
66
66
 
67
67
  #### Problems Specifying P4API
68
-
69
- On older Ruby platforms, such as the default OS X or ruby193 CentOS
68
+
69
+ On older Ruby platforms, such as the default OS X or ruby193 CentOS
70
70
  distributions, issues can arise when specifying the P4API directly via
71
71
  the command line.
72
72
 
@@ -77,7 +77,7 @@ directly:
77
77
  --with-p4-api-include=DIR/include \
78
78
  --with-p4-api-lib=DIR/lib
79
79
 
80
- An alternative is to specify the P4API directory using the `p4api_dir`
80
+ An alternative is to specify the P4API directory using the `p4api_dir`
81
81
  environment variable.
82
82
 
83
83
 
@@ -89,16 +89,16 @@ environment variable.
89
89
  "ftp://ftp.perforce.com/perforce". The API archive is located
90
90
  in release and platform-specific subdirectories and is named
91
91
  "p4api.tgz".
92
-
92
+
93
93
  __IMPORTANT__: Mac OS X users MUST use the 'darwin' variant
94
94
  of the Perforce API. Using the 'macos' variant
95
95
  does not work.
96
-
96
+
97
97
  Note: 32-bit builds of P4Ruby require a 32-bit version of the
98
98
  C++ API and a 32-bit version of Ruby. 64-bit builds of
99
99
  P4Ruby require a 64-bit version of the C++ API and a
100
100
  64-bit version of Ruby.
101
-
101
+
102
102
  Unzip the archive into an empty directory.
103
103
 
104
104
  2. Extract the P4Ruby API archive into a new, empty directory.
@@ -106,16 +106,16 @@ environment variable.
106
106
  3. In the p4ruby source directory, install dependencies:
107
107
 
108
108
  bundle install
109
-
109
+
110
110
  3. In the p4ruby source directory, build the gem:
111
111
 
112
- p4api_dir=<absolute path to Perforce C++ API> rake compile
112
+ p4api_dir=<absolute path to Perforce C++ API> rake compile
113
113
 
114
114
  4. Test your distribution, which relies on a locally installed p4d.
115
115
 
116
116
  rake test
117
-
118
- If `p4d` is not available on your path, indicate it via the `P4D_BIN`
117
+
118
+ If `p4d` is not available on your path, indicate it via the `P4D_BIN`
119
119
  environment variable before running `rake test`.
120
120
 
121
121
  5. Install P4Ruby into your local gem cache:
@@ -147,30 +147,29 @@ Perforce server later than 2001.1
147
147
  You should use a version of P4Ruby built against a corresponding version
148
148
  of the P4API that matches your Perforce server version. Since 2014.2,
149
149
  you should try to use the same major and minor variation of P4Ruby as
150
- used by the Perforce server. Ergo, against Perforce server version 2015.2,
151
- you would want a P4Ruby version that starts with 2015.2.
150
+ used by the Perforce server. Ergo, against Perforce server version 2017.1,
151
+ you would want a P4Ruby version that starts with 2017.1.
152
152
 
153
153
  #### API Compatibility
154
154
 
155
- The 2015.2 release of P4Ruby supports the 2015.2 Perforce API.
155
+ The 2017.1 release of P4Ruby supports the 2017.1 Perforce API.
156
156
  Older releases might work but are not supported.
157
157
 
158
158
  #### Ruby Compatibility
159
159
 
160
- The 2015.2 release of P4Ruby is supported by installing the gem
161
- with Ruby MRI releases 2.0, 2.1, and 2.2 with shared library
160
+ The 2017.1 release of P4Ruby is supported by installing the gem
161
+ with Ruby MRI releases 2.0, 2.1, 2.2, and 2.3, with shared library
162
162
  support.
163
163
 
164
164
  For detailed compatibility, please check the following table:
165
165
 
166
166
  Ruby Release | P4Ruby Release
167
167
  ===================================
168
- 1.6 | up to 2009.2 (unsupported)
169
- 1.8 | 2007.3 or later (unsupported)
170
- 1.9 | 2011.1 or later
168
+ <2.0 | 2011.1 or later (unsupported)
171
169
  2.0 | 2014.1 or later
172
170
  2.1 | 2014.2 or later
173
171
  2.2 | 2014.2 or later
172
+ 2.3 | 2017.1 or later
174
173
 
175
174
  It is recommended that you use a Ruby distribution that can deploy
176
175
  native gems easily, which, outside of Windows means obtaining a source
@@ -183,12 +182,12 @@ have shared library support configured, which is needed for Ruby
183
182
  extensions.
184
183
 
185
184
  In general, Ruby VMs installed via package managers are not officially
186
- coordinated with the MRI releases available on ruby-lang.org.
187
-
185
+ coordinated with the MRI releases available on ruby-lang.org.
186
+
188
187
  We do verify that p4ruby works with Ruby 1.9 on Debian (and Ubuntu), and
189
- on CentOS 6 using the Software Collections Library. These are considered
188
+ on CentOS 6 using the Software Collections Library. These are considered
190
189
  "stable" distributions, and do receive security updates.
191
-
190
+
192
191
  Other versions of Ruby, such as the default distribution of OS X may not
193
192
  work. The default OS X Ruby is infrequently updated by Apple, and is known
194
193
  to contain issues that do not seem to be patched.
@@ -202,7 +201,7 @@ fail with the error:
202
201
 
203
202
  "SSL library must be at least version 1.0.1."
204
203
 
205
- The 2015.2 release of P4Ruby is supported with OpenSSL 1.0.1
204
+ The 2017.1 release of P4Ruby is supported with OpenSSL 1.0.2
206
205
 
207
206
  For detailed compatibility, please check the following table:
208
207
 
@@ -214,6 +213,7 @@ For detailed compatibility, please check the following table:
214
213
  2014.2 | 1.0.1i+
215
214
  2015.1 | 1.0.1i+
216
215
  2015.2 | 1.0.1i+
216
+ 2017.1 | 1.0.2l+
217
217
 
218
218
 
219
219
  #### Platform Compatibility
@@ -237,7 +237,7 @@ handling between compilers.
237
237
 
238
238
  #### Compatibility with Previous Releases
239
239
 
240
- Unless otherwise stated below, the 2015.2 release of P4Ruby is
240
+ Unless otherwise stated below, the 2017.1 release of P4Ruby is
241
241
  compatible with previous releases from Perforce Software.
242
242
 
243
243
  #### Known Limitations
@@ -288,6 +288,17 @@ release up to the bug fix change level.
288
288
 
289
289
  --------------------------------------------------------------------------
290
290
 
291
+ New functionality in 2017.1
292
+
293
+ - (SIR#93993 / P4RUBY-206)
294
+
295
+ Add a reset() method for resetting p4 client data (messages, output, etc.)
296
+ between calls to run
297
+
298
+ - (SIR#92235 / P4RUBY-204)
299
+
300
+ Support graph depot commands
301
+
291
302
  New functionality in 2015.2
292
303
 
293
304
  - (SIR#78548 / P4RUBY-193)
@@ -302,7 +313,7 @@ Changes in both 2015.2.0.pre0 and 2015.1.0
302
313
  - Applied change to P4ClientApi::SetCharset, that if it is set to "none", then
303
314
  we will ignore the setting. The P4API enviro file handling seems to always
304
315
  create this setting and apply it in various circumstances.
305
-
316
+
306
317
  Changes in 2015.1.0
307
318
 
308
319
  - Updated spec mappings in specmgr.cpp to be up to date with the 2015.1 P4API
@@ -375,7 +386,7 @@ Bugs fixed in 2014.2.0.pre2
375
386
 
376
387
  New functionality in 2014.1
377
388
 
378
- - 807216 (SIR#70070)
389
+ - 807216 (SIR#70070)
379
390
 
380
391
  P4Ruby now supports the P4IGNORE file feature introduced
381
392
  in the 2013.2 server. Three new methods have been added
@@ -398,7 +409,7 @@ Bugs fixed in 2013.1
398
409
 
399
410
  P4Ruby no longer crashes when an exception is raised from
400
411
  the block passed to P4#run_resolve.
401
-
412
+
402
413
  --------------------------------------------------------------------------
403
414
 
404
415
  New functionality in 2012.2
@@ -544,11 +555,11 @@ New functionality in 2011.1
544
555
 
545
556
  P4Ruby supports setting values in the registry (on those
546
557
  platforms that support it).
547
-
558
+
548
559
  The command P4#set_env( var, val ) will set a registry
549
560
  variable on platforms that support this action or raise
550
561
  a P4Exception for those that don't.
551
-
562
+
552
563
  The command P4#set_env( var, "" ) unsets a registry variable.
553
564
 
554
565
  - 333292 (Bug #36121)
@@ -717,7 +728,7 @@ New functionality in 2010.1
717
728
 
718
729
  It's now unnecessary to run a command before calling the
719
730
  following methods:
720
-
731
+
721
732
  P4#server_level
722
733
  P4#server_case_sensitive?
723
734
  P4#server_unicode?
data/ext/P4/extconf.rb CHANGED
@@ -9,7 +9,7 @@ require 'rbconfig'
9
9
 
10
10
  # Set this to the main version directory we look up in ftp.perforce.com for the P4API
11
11
  # This is ignored if you specify the version on the command line.
12
- P4API_VERSION_DIR = 'r15.2'
12
+ P4API_VERSION_DIR = 'r17.2'
13
13
 
14
14
  #==============================================================================
15
15
  # Provide platform variables in P4-specific format
data/ext/P4/p4.cpp CHANGED
@@ -30,7 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
30
  *
31
31
  * Author : Tony Smith <tony@perforce.com> or <tony@smee.org>
32
32
  *
33
- * Description : Ruby bindings for the Perforce API.
33
+ * Description : Ruby bindings for the Perforce API.
34
34
  *
35
35
  * vim:ts=8:sw=4
36
36
  ******************************************************************************/
@@ -160,7 +160,7 @@ static VALUE p4_run_tagged( VALUE self, VALUE tagged )
160
160
  flag = 0;
161
161
  else
162
162
  flag = NUM2INT( tagged ) ? 1 : 0;
163
-
163
+
164
164
  int old_value = p4->IsTagged();
165
165
  p4->Tagged( flag );
166
166
 
@@ -196,7 +196,7 @@ static VALUE p4_set_tagged( VALUE self, VALUE toggle )
196
196
  flag = 0;
197
197
  else
198
198
  flag = NUM2INT( toggle ) ? 1 : 0;
199
-
199
+
200
200
  p4->Tagged( flag );
201
201
  return flag ? Qtrue : Qfalse; // Seems to be ignored...
202
202
  }
@@ -541,7 +541,7 @@ static VALUE p4_set_track( VALUE self, VALUE toggle )
541
541
  flag = 0;
542
542
  else
543
543
  flag = NUM2INT( toggle ) ? 1 : 0;
544
-
544
+
545
545
  p4->SetTrack( flag );
546
546
  return flag ? Qtrue : Qfalse; // Seems to be ignored...
547
547
  }
@@ -567,11 +567,37 @@ static VALUE p4_set_streams( VALUE self, VALUE toggle )
567
567
  flag = 0;
568
568
  else
569
569
  flag = NUM2INT( toggle ) ? 1 : 0;
570
-
570
+
571
571
  p4->SetStreams( flag );
572
572
  return flag ? Qtrue : Qfalse; // Seems to be ignored...
573
573
  }
574
574
 
575
+ static VALUE p4_get_graph( VALUE self )
576
+ {
577
+ P4ClientApi *p4;
578
+ Data_Get_Struct( self, P4ClientApi, p4 );
579
+ return p4->IsGraph() ? Qtrue : Qfalse;
580
+ }
581
+
582
+ static VALUE p4_set_graph( VALUE self, VALUE toggle )
583
+ {
584
+ P4ClientApi *p4;
585
+ Data_Get_Struct( self, P4ClientApi, p4 );
586
+
587
+ // The user might have passed an integer, or it might be a boolean,
588
+ // we convert to int for consistency.
589
+ int flag = 0;
590
+ if( toggle == Qtrue )
591
+ flag = 1;
592
+ else if( toggle == Qfalse )
593
+ flag = 0;
594
+ else
595
+ flag = NUM2INT( toggle ) ? 1 : 0;
596
+
597
+ p4->SetGraph( flag );
598
+ return flag ? Qtrue : Qfalse; // Seems to be ignored...
599
+ }
600
+
575
601
  /*******************************************************************************
576
602
  * Running commands. General purpose Run method and method for supplying
577
603
  * input to "p4 xxx -i" commands
@@ -599,7 +625,7 @@ static VALUE p4_run( VALUE self, VALUE args )
599
625
  char *cmd = StringValuePtr( v );
600
626
  argc = NUM2INT( rb_funcall( flatArgs, idLength, 0 ) );
601
627
 
602
- // Allocate storage on the stack so it's automatically reclaimed
628
+ // Allocate storage on the stack so it's automatically reclaimed
603
629
  // when we exit.
604
630
  char **p4args = ALLOCA_N( char *, argc + 1 );
605
631
 
@@ -638,6 +664,13 @@ static VALUE p4_get_messages( VALUE self )
638
664
  return p4->GetMessages();
639
665
  }
640
666
 
667
+ static VALUE p4_reset( VALUE self )
668
+ {
669
+ P4ClientApi *p4;
670
+ Data_Get_Struct( self, P4ClientApi, p4 );
671
+ return p4->Reset();
672
+ }
673
+
641
674
  static VALUE p4_get_warnings( VALUE self )
642
675
  {
643
676
  P4ClientApi *p4;
@@ -917,7 +950,7 @@ static VALUE p4map_new( int argc, VALUE *argv, VALUE pClass )
917
950
 
918
951
  // First arg is the class
919
952
  // pClass = argv[ 0 ];
920
-
953
+
921
954
  // Now instantiate the new object.
922
955
  self = Data_Wrap_Struct( pClass, 0, p4map_free, m );
923
956
  rb_obj_call_init( self, 0, argv );
@@ -1066,7 +1099,7 @@ static VALUE p4map_reverse( VALUE self )
1066
1099
  return rval;
1067
1100
  }
1068
1101
 
1069
- //
1102
+ //
1070
1103
  // P4::Map#translate( string, fwd=true )
1071
1104
  //
1072
1105
  static VALUE p4map_trans( int argc, VALUE *argv, VALUE self )
@@ -1076,7 +1109,7 @@ static VALUE p4map_trans( int argc, VALUE *argv, VALUE self )
1076
1109
  VALUE string;
1077
1110
 
1078
1111
  if( argc < 1 || argc > 2 )
1079
- rb_raise( rb_eArgError,
1112
+ rb_raise( rb_eArgError,
1080
1113
  "Invalid arguments to P4::Map#translate. "
1081
1114
  "Pass the string you wish to translate, and an optional "
1082
1115
  "boolean to indicate whether translation should be in "
@@ -1197,6 +1230,8 @@ void Init_P4()
1197
1230
  rb_define_method( cP4, "tagged=", RUBY_METHOD_FUNC(p4_set_tagged), 1 );
1198
1231
  rb_define_method( cP4, "track?", RUBY_METHOD_FUNC(p4_get_track) , 0 );
1199
1232
  rb_define_method( cP4, "track=", RUBY_METHOD_FUNC(p4_set_track) , 1 );
1233
+ rb_define_method( cP4, "graph?", RUBY_METHOD_FUNC(p4_get_graph) , 0 );
1234
+ rb_define_method( cP4, "graph=", RUBY_METHOD_FUNC(p4_set_graph) , 1 );
1200
1235
 
1201
1236
 
1202
1237
  // Perforce client settings.
@@ -1245,6 +1280,7 @@ void Init_P4()
1245
1280
  rb_define_method( cP4, "connect", RUBY_METHOD_FUNC(p4_connect) , 0 );
1246
1281
  rb_define_method( cP4, "connected?",RUBY_METHOD_FUNC(p4_connected) , 0 );
1247
1282
  rb_define_method( cP4, "disconnect", RUBY_METHOD_FUNC(p4_disconnect) , 0 );
1283
+ rb_define_method( cP4, "reset", RUBY_METHOD_FUNC(p4_reset), 0 );
1248
1284
 
1249
1285
  // Running commands - general purpose commands
1250
1286
  rb_define_method( cP4, "run", RUBY_METHOD_FUNC(p4_run) ,-2 );
@@ -92,7 +92,7 @@ P4ClientApi::P4ClientApi() : ui( &specMgr )
92
92
  const char *t;
93
93
 
94
94
  henv.GetTicketFile( ticketFile );
95
-
95
+
96
96
  if( (t = enviro->Get("P4TICKETS")) )
97
97
  ticketFile = t;
98
98
 
@@ -132,7 +132,7 @@ P4ClientApi::GetEnviroFile()
132
132
  return enviro->GetEnviroFile();
133
133
  }
134
134
 
135
- void
135
+ void
136
136
  P4ClientApi::SetApiLevel( int level )
137
137
  {
138
138
  StrBuf b;
@@ -192,7 +192,7 @@ P4ClientApi::SetTicketFile( const char *p )
192
192
  ticketFile = p;
193
193
  }
194
194
 
195
- void
195
+ void
196
196
  P4ClientApi::SetDebug( int d )
197
197
  {
198
198
  debug = d;
@@ -241,7 +241,7 @@ P4ClientApi::SetEnv( const char *var, const char *val )
241
241
  // connect to the Perforce server.
242
242
  //
243
243
 
244
- VALUE
244
+ VALUE
245
245
  P4ClientApi::Connect()
246
246
  {
247
247
  if ( P4RDB_COMMANDS )
@@ -288,7 +288,7 @@ P4ClientApi::ConnectOrReconnect()
288
288
  //
289
289
  // Disconnect session
290
290
  //
291
- VALUE
291
+ VALUE
292
292
  P4ClientApi::Disconnect()
293
293
  {
294
294
  if ( P4RDB_COMMANDS )
@@ -322,7 +322,7 @@ P4ClientApi::Connected()
322
322
  return Qfalse;
323
323
  }
324
324
 
325
- void
325
+ void
326
326
  P4ClientApi::Tagged( int enable )
327
327
  {
328
328
  if( enable )
@@ -359,6 +359,14 @@ void P4ClientApi::SetStreams( int enable )
359
359
  ClearStreamsMode();
360
360
  }
361
361
 
362
+ void P4ClientApi::SetGraph( int enable )
363
+ {
364
+ if ( enable )
365
+ SetGraphMode();
366
+ else
367
+ ClearGraphMode();
368
+ }
369
+
362
370
  int
363
371
  P4ClientApi::GetServerLevel()
364
372
  {
@@ -401,6 +409,12 @@ P4ClientApi::IsIgnored( const char *path )
401
409
  return ignore->Reject( p, client.GetIgnoreFile() );
402
410
  }
403
411
 
412
+ VALUE
413
+ P4ClientApi::Reset()
414
+ {
415
+ ui.Reset();
416
+ }
417
+
404
418
  //
405
419
  // Run returns the results of the command. If the client has not been
406
420
  // connected, then an exception is raised but errors from Perforce
@@ -410,7 +424,7 @@ P4ClientApi::IsIgnored( const char *path )
410
424
  // is raised.
411
425
  //
412
426
 
413
- VALUE
427
+ VALUE
414
428
  P4ClientApi::Run( const char *cmd, int argc, char * const *argv )
415
429
  {
416
430
  // Save the entire command string for our error messages. Makes it
@@ -480,6 +494,9 @@ P4ClientApi::RunCmd( const char *cmd, ClientUser *ui, int argc, char * const *ar
480
494
  if ( IsStreams() && apiLevel > 69 )
481
495
  client.SetVar( "enableStreams", "" );
482
496
 
497
+ if ( IsGraph() && apiLevel > 81 )
498
+ client.SetVar( "enableGraph", "" );
499
+
483
500
  // If maxresults or maxscanrows is set, enforce them now
484
501
  if( maxResults ) client.SetVar( "maxResults", maxResults );
485
502
  if( maxScanRows ) client.SetVar( "maxScanRows", maxScanRows );
@@ -512,7 +529,7 @@ P4ClientApi::RunCmd( const char *cmd, ClientUser *ui, int argc, char * const *ar
512
529
 
513
530
  //
514
531
  // Parses a string supplied by the user into a hash. To do this we need
515
- // the specstring from the server. We try to cache those as we see them,
532
+ // the specstring from the server. We try to cache those as we see them,
516
533
  // but the user may not have executed any commands to allow us to cache
517
534
  // them so we may have to fetch the spec first.
518
535
  //
@@ -540,7 +557,7 @@ P4ClientApi::ParseSpec( const char * type, const char *form )
540
557
  Error e;
541
558
  VALUE v;
542
559
  v = specMgr.StringToSpec( type, form, &e );
543
-
560
+
544
561
  if ( e.Test() )
545
562
  {
546
563
  if( exceptionLevel )
@@ -551,7 +568,7 @@ P4ClientApi::ParseSpec( const char * type, const char *form )
551
568
 
552
569
  return v;
553
570
  }
554
-
571
+
555
572
 
556
573
  //
557
574
  // Converts a hash supplied by the user into a string using the specstring
@@ -577,14 +594,14 @@ P4ClientApi::FormatSpec( const char * type, VALUE hash )
577
594
  }
578
595
  }
579
596
 
580
- // Got a specdef so now we can attempt to convert.
597
+ // Got a specdef so now we can attempt to convert.
581
598
  StrBuf buf;
582
599
  Error e;
583
600
 
584
601
  specMgr.SpecToString( type, hash, buf, &e );
585
602
  if( !e.Test() )
586
603
  return P4Utils::ruby_string( buf.Text() );
587
-
604
+
588
605
  if( exceptionLevel )
589
606
  {
590
607
  StrBuf m;
@@ -620,7 +637,7 @@ P4ClientApi::SpecFields( const char * type )
620
637
 
621
638
  return specMgr.SpecFields( type );
622
639
  }
623
-
640
+
624
641
  //
625
642
  // Raises an exception or returns Qfalse on bad input
626
643
  //
@@ -686,13 +703,13 @@ P4ClientApi::Except( const char *func, const char *msg )
686
703
  StrBuf errors;
687
704
  StrBuf warnings;
688
705
  int terminate = 0;
689
-
706
+
690
707
  m << "[" << func << "] " << msg;
691
708
 
692
709
  // Now append any errors and warnings to the text
693
710
  ui.GetResults().FmtErrors( errors );
694
711
  ui.GetResults().FmtWarnings( warnings );
695
-
712
+
696
713
  if( errors.Length() )
697
714
  {
698
715
  m << "\n" << errors;
data/ext/P4/p4clientapi.h CHANGED
@@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
37
 
38
38
 
39
39
  /*******************************************************************************
40
- * P4ClientApi class - where we register our Ruby classes and plumb together
40
+ * P4ClientApi class - where we register our Ruby classes and plumb together
41
41
  * the components
42
42
  ******************************************************************************/
43
43
 
@@ -56,11 +56,14 @@ public:
56
56
  int SetTrack( int enable );
57
57
  int GetTrack() { return IsTrackMode() != 0; }
58
58
 
59
- // Set streams mode
60
-
59
+ // Set streams mode
61
60
  void SetStreams( int enable );
62
61
  int IsStreams() { return IsStreamsMode() != 0; };
63
62
 
63
+ // Set graph mode
64
+ void SetGraph( int enable );
65
+ int IsGraph() { return IsGraphMode() != 0; };
66
+
64
67
  // Returns bool, but may raise exception
65
68
  int SetCharset( const char *c );
66
69
 
@@ -75,7 +78,7 @@ public:
75
78
  void SetMaxResults( int v ) { maxResults = v; }
76
79
  void SetMaxScanRows( int v ) { maxScanRows = v; }
77
80
  void SetMaxLockTime( int v ) { maxLockTime = v; }
78
- VALUE SetEnv( const char *var, const char *val );
81
+ VALUE SetEnv( const char *var, const char *val );
79
82
  void SetLanguage( const char *l ) { client.SetLanguage( l ); }
80
83
  void SetPassword( const char *p ) { client.SetPassword( p ); }
81
84
  void SetPort( const char *p ) { client.SetPort( p ); }
@@ -116,8 +119,9 @@ public:
116
119
  VALUE Connect(); // P4Exception on error
117
120
  VALUE Connected(); // Return true if connected and not dropped.
118
121
  VALUE Disconnect();
122
+ VALUE Reset(); // Clear out any results from the previous command
119
123
 
120
- // Executing commands.
124
+ // Executing commands.
121
125
  VALUE Run( const char *cmd, int argc, char * const *argv );
122
126
  VALUE SetInput( VALUE input );
123
127
 
@@ -182,8 +186,9 @@ private:
182
186
  S_CASEFOLDING = 0x0010,
183
187
  S_TRACK = 0x0020,
184
188
  S_STREAMS = 0x0040,
189
+ S_GRAPH = 0x0080,
185
190
 
186
- S_INITIAL_STATE = 0x0041,
191
+ S_INITIAL_STATE = 0x00C1, // Streams, Graph, and Tagged enabled by default
187
192
  S_RESET_MASK = 0x001E,
188
193
  };
189
194
 
@@ -218,6 +223,10 @@ private:
218
223
  void ClearStreamsMode() { flags &= ~S_STREAMS; }
219
224
  int IsStreamsMode() { return flags & S_STREAMS; }
220
225
 
226
+ void SetGraphMode() { flags |= S_GRAPH; }
227
+ void ClearGraphMode() { flags &= ~S_GRAPH; }
228
+ int IsGraphMode() { return flags & S_GRAPH; }
229
+
221
230
  private:
222
231
  ClientApi client;
223
232
  ClientUserRuby ui;
data/lib/2.0/P4.so CHANGED
Binary file
data/lib/2.1/P4.so CHANGED
Binary file
data/lib/2.2/P4.so CHANGED
Binary file
data/lib/2.3/P4.so ADDED
Binary file
data/lib/2.4/P4.so ADDED
Binary file
data/lib/P4/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class P4
2
- Version = VERSION = '2015.2.1313860'
3
- end
2
+ Version = VERSION = '2017.1.1653916'
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: 2015.2.1313860
4
+ version: 2017.1.1653916
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Perforce Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-09 00:00:00.000000000 Z
11
+ date: 2018-04-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby extensions to the C++ Perforce API.
14
14
  email: support@perforce.com
@@ -46,6 +46,8 @@ files:
46
46
  - lib/2.0/P4.so
47
47
  - lib/2.1/P4.so
48
48
  - lib/2.2/P4.so
49
+ - lib/2.3/P4.so
50
+ - lib/2.4/P4.so
49
51
  - lib/P4.rb
50
52
  - lib/P4/version.rb
51
53
  homepage: https://swarm.workshop.perforce.com/projects/perforce-software-p4ruby/