p4ruby 2017.1.1599185 → 2017.1.1609394

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: 6c726609fc009f798f611b395f1b73782d33a951
4
- data.tar.gz: f40e6deeb256912813dea61449903fe33223aa69
3
+ metadata.gz: ab4de4ec29badd93efa2dda82673a85e0a911383
4
+ data.tar.gz: 1c3e8ce22d36a1a842f7e41e9818e9edf9a36be1
5
5
  SHA512:
6
- metadata.gz: 30e137fbe3274e5e80454adbb1c0aa8b6d6515e866b63129750da07048e47110d96f34510766e466ba571b1c26577d75e66135e5e08ad4784ddbaf98815859a7
7
- data.tar.gz: f2009d6583e53a4702bc4409be915cb73cb39830c432c174c4a0f623b37d870b4439e2d8789620cd2485fe3edfcf907c34ae0569f00cc67bd2af2937552d363b
6
+ metadata.gz: eb1ff6ad9fe56ee19482daeebe76eea35418699d9e7d2412afede429f7ad4c960e64036f880c2341507e460cc7d6b94ad345afe668ef6687f482ffa9028ed4ec
7
+ data.tar.gz: 0fb948e569e0fb5707a8b53a28412831c9ffaaf42384f543ee865f6e981b5267ead68e390824b5d7b14f88ad93842ea7afd788e53fc334225cd8eea2068d0529
data/README.md CHANGED
@@ -290,6 +290,11 @@ release up to the bug fix change level.
290
290
 
291
291
  New functionality in 2017.1
292
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
+
293
298
  - (SIR#92235 / P4RUBY-204)
294
299
 
295
300
  Support graph depot commands
data/ext/P4/p4.cpp CHANGED
@@ -664,6 +664,13 @@ static VALUE p4_get_messages( VALUE self )
664
664
  return p4->GetMessages();
665
665
  }
666
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
+
667
674
  static VALUE p4_get_warnings( VALUE self )
668
675
  {
669
676
  P4ClientApi *p4;
@@ -1273,6 +1280,7 @@ void Init_P4()
1273
1280
  rb_define_method( cP4, "connect", RUBY_METHOD_FUNC(p4_connect) , 0 );
1274
1281
  rb_define_method( cP4, "connected?",RUBY_METHOD_FUNC(p4_connected) , 0 );
1275
1282
  rb_define_method( cP4, "disconnect", RUBY_METHOD_FUNC(p4_disconnect) , 0 );
1283
+ rb_define_method( cP4, "reset", RUBY_METHOD_FUNC(p4_reset), 0 );
1276
1284
 
1277
1285
  // Running commands - general purpose commands
1278
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 )
@@ -409,6 +409,12 @@ P4ClientApi::IsIgnored( const char *path )
409
409
  return ignore->Reject( p, client.GetIgnoreFile() );
410
410
  }
411
411
 
412
+ VALUE
413
+ P4ClientApi::Reset()
414
+ {
415
+ ui.Reset();
416
+ }
417
+
412
418
  //
413
419
  // Run returns the results of the command. If the client has not been
414
420
  // connected, then an exception is raised but errors from Perforce
@@ -418,7 +424,7 @@ P4ClientApi::IsIgnored( const char *path )
418
424
  // is raised.
419
425
  //
420
426
 
421
- VALUE
427
+ VALUE
422
428
  P4ClientApi::Run( const char *cmd, int argc, char * const *argv )
423
429
  {
424
430
  // Save the entire command string for our error messages. Makes it
@@ -523,7 +529,7 @@ P4ClientApi::RunCmd( const char *cmd, ClientUser *ui, int argc, char * const *ar
523
529
 
524
530
  //
525
531
  // Parses a string supplied by the user into a hash. To do this we need
526
- // 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,
527
533
  // but the user may not have executed any commands to allow us to cache
528
534
  // them so we may have to fetch the spec first.
529
535
  //
@@ -551,7 +557,7 @@ P4ClientApi::ParseSpec( const char * type, const char *form )
551
557
  Error e;
552
558
  VALUE v;
553
559
  v = specMgr.StringToSpec( type, form, &e );
554
-
560
+
555
561
  if ( e.Test() )
556
562
  {
557
563
  if( exceptionLevel )
@@ -562,7 +568,7 @@ P4ClientApi::ParseSpec( const char * type, const char *form )
562
568
 
563
569
  return v;
564
570
  }
565
-
571
+
566
572
 
567
573
  //
568
574
  // Converts a hash supplied by the user into a string using the specstring
@@ -588,14 +594,14 @@ P4ClientApi::FormatSpec( const char * type, VALUE hash )
588
594
  }
589
595
  }
590
596
 
591
- // Got a specdef so now we can attempt to convert.
597
+ // Got a specdef so now we can attempt to convert.
592
598
  StrBuf buf;
593
599
  Error e;
594
600
 
595
601
  specMgr.SpecToString( type, hash, buf, &e );
596
602
  if( !e.Test() )
597
603
  return P4Utils::ruby_string( buf.Text() );
598
-
604
+
599
605
  if( exceptionLevel )
600
606
  {
601
607
  StrBuf m;
@@ -631,7 +637,7 @@ P4ClientApi::SpecFields( const char * type )
631
637
 
632
638
  return specMgr.SpecFields( type );
633
639
  }
634
-
640
+
635
641
  //
636
642
  // Raises an exception or returns Qfalse on bad input
637
643
  //
@@ -697,13 +703,13 @@ P4ClientApi::Except( const char *func, const char *msg )
697
703
  StrBuf errors;
698
704
  StrBuf warnings;
699
705
  int terminate = 0;
700
-
706
+
701
707
  m << "[" << func << "] " << msg;
702
708
 
703
709
  // Now append any errors and warnings to the text
704
710
  ui.GetResults().FmtErrors( errors );
705
711
  ui.GetResults().FmtWarnings( warnings );
706
-
712
+
707
713
  if( errors.Length() )
708
714
  {
709
715
  m << "\n" << errors;
data/ext/P4/p4clientapi.h CHANGED
@@ -119,6 +119,7 @@ public:
119
119
  VALUE Connect(); // P4Exception on error
120
120
  VALUE Connected(); // Return true if connected and not dropped.
121
121
  VALUE Disconnect();
122
+ VALUE Reset(); // Clear out any results from the previous command
122
123
 
123
124
  // Executing commands.
124
125
  VALUE Run( const char *cmd, int argc, char * const *argv );
data/lib/P4/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class P4
2
- Version = VERSION = '2017.1.1599185'
2
+ Version = VERSION = '2017.1.1609394'
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: 2017.1.1599185
4
+ version: 2017.1.1609394
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: 2017-12-11 00:00:00.000000000 Z
11
+ date: 2018-01-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby extensions to the C++ Perforce API.
14
14
  email: support@perforce.com