-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathRELNOTES.txt
919 lines (667 loc) · 32.6 KB
/
RELNOTES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
Release Notes for
P4Python, Perforce's script API for Python
Version 2013.1
Introduction
This document lists all user-visible changes to P4Python starting
from release 2007.3, the first supported P4Python release.
Perforce numbers releases YYYY.R/CCCCC, for example, 2007.3/30547.
YYYY is the year; R is the release of that year; CCCCC is the
bug fix change level. Each bug fix in these release notes is
marked by its change number. Any build includes all bug fixes
of all previous releases and all bug fixes of the current
release up to the bug fix change level.
To display the version of P4Python you have installed,
start Python and issue the following commands:
>>> import P4
>>> print(P4.P4.identify())
--------------------------------------------------------------------------
Installing P4Python
Windows users can download an installer containing pre-built
packages for P4Python from the Perforce FTP site at
ftp://ftp.perforce.com/perforce. Users on other platforms must
build from source, as detailed below.
--------------------------------------------------------------------------
Upgrading P4Python
Before installing P4Python 2012.3, uninstall any older versions of
P4Python. Some earlier versions of P4Python consisted of the
following files, which must be deleted before installing a later
version:
p4.py
p4.pyc
p4.pyo
P4Client.pyd
--------------------------------------------------------------------------
Building P4Python from Source
1. Download the Perforce C++ API from the Perforce FTP site at
"ftp://ftp.perforce.com/perforce". The API archive is located
in release and platform-specific subdirectories and is named
"p4api.tgz" for non-Windows platforms and "p4api_vs2008_static.zip"
for Windows. Mac OS X users should get the API from either the
"bin.darwin90x86" or "bin.darwin90x86_64" platform directory.
Note: 32-bit builds of P4Python require a 32-bit version of the
C++ API and a 32-bit version of Python. 64-bit builds of
P4Python require a 64-bit version of the C++ API and a
64-bit version of Python.
Unzip the archive into an empty directory.
2. Extract the P4Python API archive into a new, empty directory.
3. To build P4Python, run the following command:
python setup.py build --apidir <Perforce C++ API absolute path>
Note: in order to reinstall cleanly P4Python, remove the
directory named "build".
4. To test your P4Python build, run the following command:
python p4test.py
Note: the test harness requires the Perforce server executable
p4d to be installed and in the PATH.
5. To install P4Python, run the following command:
python setup.py install --apidir <Perforce C++ API absolute path>
Note: on Unix/Mac platforms, the installation must be performed
as the root user. Also ensure that the umask is set
correctly (typically 0022) before running the install.
With a umask of 027, for example, the resulting installed
files are accessible only by users of group root.
SSL support
-----------
Perforce Server 2012.1 and later supports SSL connections and the
C++ API has been compiled with this support. For applications that
do not require SSL support the C++ API provides a stub library
(libp4sslstub.*) to satisfy the linker requirements.
P4Python will build with the stub library by default. To enable
SSL support, provide the switch --ssl [librarypath] to the build.
Without [librarypath] the linker will use the default ssl libraries
provided by the operating system. If a library path is provided,
the linker will be instructed to look there first.
--------------------------------------------------------------------------
Compatibility Statements
Server Compatibility
You can use any release of P4Python with any release of the
Perforce server later than 2001.1
API Compatibility
The 2013.1 release of P4Python requires either the 2012.2 or
2013.1 Perforce API. Older releases will not compile and are not
supported.
Python Compatibility
The 2013.1 release of P4Python is supported building from
source with Python 2.7, 3.3. Python 3.0, 3.1 and 3.2 are not
supported.
For detailed compatibility, please check the following table:
Python Release | P4Python Release
======================================
2.3 or earlier | not supported
2.4 | 2008.2 (unsupported)
2.5 | 2007.3 up to 2009.2 (unsupported)
2.6 | 2009.1 up to 2012.2
2.7 | 2010.1 or later
3.0 | 2010.1 up to 2012.3 (unsupported)
3.1 | 2010.2 up to 2012.3 (unsupported)
3.2 | 2011.1 up to 2012.3
3.3 | 2012.3 or later
The P4Python 32-bit Windows installer requires Python 3.3 32-bit.
The P4Python 64-bit Windows installer requires Python 3.3 64-bit.
The P4Python installer on Windows requires that the location of the
Python interpreter can be found in the PATH environment variable.
OpenSSL Compatibility
To build P4Python with encrypted communication support, you must
use the version of OpenSSL that Perforce C/C++ API has been
built against. Running P4Python linked to an older library will
fail with the error:
"SSL library must be at least version 1.0.1."
The 2013.1 release of P4Python is supported with OpenSSL 1.0.1.
For detailed compatibility, please check the following table:
Perforce C/C++ API Version | OpenSSL Release
============================================
2012.1 | 1.0.0
2012.2+ | 1.0.1
Platform Compatibility
This release is certified on the following platforms:
Linux 2.6 Intel (x86, x86_64)
Solaris 10 Intel (x86)
Windows 8, Vista, 7, 2008 Intel (x86, x86_64)
FreeBSD 6.0, 7.0 Intel (x86, x86_64)
Mac OS X 10.6, 10.7, 10.8 (x86_64)
Note: As of 2012.1, a universal build of the Perforce C/C++
API is no longer available for Darwin or Mac OS X.
P4Python is now a 64-bit only library on Darwin. This
has been tested with a universal build of Python and
is known to work.
Compiler Compatibility
To build P4Python from source, you must use a version of
P4Python that has been compiled with the same compiler used to
build the Perforce C++ API. For most platforms, use gcc/g++.
Attempting to use a different compiler or a different version
of the compiler causes linker errors due to differences in
name handling.
On Windows platforms, the P4Python installer was built with
python.org and Visual Studio 2010.
For Python 2.7 support on Windows, Visual Studio 2008 is
required.
Compatibility with Previous Releases of P4Python
P4Python 2013.1 is compatible with previous releases of
P4Python from Perforce Software, unless otherwise specified.
Known Limitations
The Perforce client-server protocol is not designed to support
multiple concurrent queries over the same connection. For this
reason, multi-threaded applications using the C++ API or the
script APIs (P4Perl, P4Ruby, etc.) should ensure that a
separate connection is used for each thread or that only one
thread may use a shared connection at a time.
Compatibility with the P4Python from the Public Depot
Perforce P4Python is significantly different from the version
of P4Python in the Perforce Public Depot. Perforce P4Python
contains several improvements and interface changes
intended to make P4Python consistent with the other scripting
interfaces and with Python in general.
If you are migrating from Public Depot version of P4Python,
edit your scripts to ensure that the scripts comply with the
new interface. The differences are detailed below.
New module name
---------------
The P4Python module has been renamed from p4 to P4. For example:
Old:
>>> import p4
>>> p4c = p4.P4()
New:
>>> import P4
>>> p4 = P4.P4()
By convention, Public Depot P4Python used "p4c" as an instance
variable because "p4" was used as a module name. Because the
module has been renamed "P4", you can use "p4" for your instance
variables. All demos and tests use the new convention.
Deleted methods
---------------
The following methods have been deleted from the P4 class and
are no longer available.
dropped Use connected()
parse_forms Form parsing is now always on
tagged See tagged attribute below
New methods
-----------
The following methods are new to Perforce P4Python.
connected Returns True if the client is connected
format_xxx Converts a dict-based specification into
a string (replace xxx with spec type, for
example: format_client)
identify Returns information about P4Python
parse_xxx Converts a string into a P4.Spec object
(replace xxx with spec type)
run_filelog Runs 'p4 filelog' and returns an array of
P4.DepotFile objects
run_login Runs "p4 login" using current password
run_password Runs "p4 passwd" with old and new password
run_submit Runs "p4 submit"
Attributes
----------
Perforce P4Python provides the following attributes. Attributes
can be set in the P4() constructor or by using their setters and
getters. For example:
>>> import P4
>>> p4 = P4.P4(client="myclient", port="1666")
>>> p4.user = 'me'
Most attributes can be set and read. Attributes are strings unless
noted otherwise.
api_level API compatibility level, INTEGER
charset The character set to use. String,
not a constant as in previous versions
client Client to use (P4CLIENT)
cwd Current Working Directory
debug Debug level (for debugging P4Python), INTEGER
errors Array of errors returned by the server
(Read-Only), LIST
exception_level Determines whether exceptions are thrown,
INTEGER
host Client Host
input Input for next command, can be STRING, LIST
or DICTIONARY
maxlocktime MaxLockTime for commands, INTEGER
maxresults MaxResults for commands, INTEGER
maxscanrows MaxScanRows for commands, INTEGER
p4config_file Returns the config file path (Read-Only)
password Value of P4PASSWD
port Value of P4PORT
prog Name of the script, shown in the server log
server_level Returns the server level (Read-Only)
tagged Boolean value, determines whether to use
tagged mode, INTEGER
ticket_file Returns the name of the ticket file
user Value of P4USER
warnings Array of warnings returned by the server
(Read-Only), LIST
Tagged mode and form parsing
----------------------------
In Perforce P4Python 2007.3 and later, form parsing and tagged
output are enabled by default. (In Public Depot P4Python,
tagged output and form parsing mode were disabled by default,
but most scripts enabled them immediately.)
Form parsing cannot be disabled explicitly, but tagged output can
be enabled or disabled by setting p4.tagged as follows:
p4.tagged = False # Disabled
p4.tagged = True # Enabled
This method can be used to disable form parsing, because
form parsing does not work when tagged output is
disabled.
--------------------------------------------------------------------------
Key to symbols used in change notes below.
* -- requires new p4Python
** -- requires new p4d server program
*** -- requires new P4API
--------------------------------------------------------------------------
Bugs fixed in 2013.1
#628525 *
When using Python 3.X P4Python created a memory leak for
every call. This has now been fixed. Note that the
fix requires upgrading to Python 3.3. All previous version of
Python 3.X are not supported and P4Python 2013.1 will not
compile with these releases.
#634817 *
Reformatted P4.py to use spaces instead of tabs, following
the Python coding standard.
New functionality in 2012.3
#533539 *
P4Python is now compatible with Python 3.3 and will complete
all test cases.
#564572 (Bug #59272) *
Comments in forms are now preserved in the spec object when using
P4.parse_spec. The comment can be accessed and changed through the
P4.Spec.comment attribute. Comments are used by the P4.format_spec
methods such as P4.format_client(). This is useful for form-out triggers.
#568867 *
When decoding strings in Python 3 from a non-Unicode Perforce server,
P4Python normally assumes that all strings are encoded in UTF8. P4.encoding
can be set to a legal Python encoding to change the decoding of any content
from the Perforce Server. If P4.encoding is set, any decoding error will
cause an exception to be thrown.
The special encoding 'raw' can be used to receive Python bytes
instead of Unicode strings.
P4.encoding is only available when compiled with Python 3.
Bugs fixed in 2012.3
#564572 (Bug #32834) *
In Python 3 it was impossible to reset the charset to None or ''.
This is now fixed.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
New functionality in 2012.2
#524819 (Bug #59800) *
P4Python now supports Apple Mountain Lion (10.8).
#503392 (Bug #56081) *
P4.run_print() would return None for a non-existing file.
Now it returns [] for consistency.
#503375 (Bug #56479) *
Added P4.run_tickets() method to list local tickets.
Note that P4.run('tickets') still gives the old error
message "Must upgrade to 2004.2 p4 to access tickets."
#498110 (Bug #56512) * ** ***
Support for the new progress indicator API. P4Python
supplies a new progress attribute, which can take an
instance of P4.Progress class or subclass. Progress
information is currently only supported for submits and
sync -q. Details can be found in the documentation.
#491236 (Bug #57828) *
New convenience method P4.iterate_<specs>() that allows
easy iteration through some or all spec objects such as
clients or changes. Details can be found in the documentation.
Bugs fixed in 2012.2
#513715 (Bug #59191) *
Fixed a bug where P4Python would leak memory when calling
an OutputHandler, and would leak more memory if the
OutputHandler returned HANDLED.
#512425 (Bug #58722) *
P4#parse_client could raise the exception "Unknown field name
'StreamAtChange'." when parsing a stream client workspace.
Internal spec definition has been updated to resolve this.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
New functionality in 2012.1
#403096 (Bug #51898) * ** ***
Enable "action resolve" to support resolves of branches,
deletes and file types. The existing P4.Resolver class
has been extended with a new method actionResolve() that
will be invoked if an "action resolve" is required.
Details can be found in the documentation.
#411866 (Bug #51896) * ** ***
P4Python supports SSL connections if compiled with SSL
support. Instructions on how to compile with SSL support can
be found at the top of this document under "Building P4Python
from Source" and in the documentation.
P4.identify() will then report the version of the OpenSSL
library used for building the Perforce C++ API (not the
version P4Python is linked against).
Bugs fixed in 2012.1:
#510916 (Bug #59060) *
Fixed a bug where P4Python would increment the reference
count of an OutputHandler each time run was called.
#446148 (Bug #55062) *
Fixed a test hardness due an incompatibility with Python 2.6
#397007 (Bug #49820) *
A fatal server error would leave P4Python in an undefined
state which would result in incorrect output for
successive commands. P4Python will now disconnect and
clean up when encountering a fatal error.
#420204 (Bug #52909) *
Python would crash with a segmentation fault if a custom
Resolver object was used to resolve binary files. Fixed.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
New functionality in 2011.1
#328169 (Bug #45862) * **
Enable streams in P4Python by default. With this change,
streams specific specs such as streams depots are listed.
Disable the listing of streams specific specs by either
setting the api_level to a value below 70 or by disabling
stream handling explicitly through the P4.streams attribute:
p4.streams = False
#318056 *
All run methods now support keyword arguments in order
to disable 'tagged' mode or to provide an OutputHandler
for a single command only without having to wrap the command
in a 'with' block:
p4.run_counter('mycounter', tagged = False)
p4.run_files('//...', handler = MyOutputHandler() )
More than one keyword argument can be provided if required.
All attributes that can be changed for an active connection
can be provided as keyword arguments.
#317619 (Bug #42251) *
P4Python supports a callback interface by providing a
P4.handler attribute. Set P4.handler to an instance of a
subclass of P4.OutputHandler to enable callbacks.
When a handler is defined, P4Python will invoke the handler
for every response it receives from the Perforce Server
immediately instead of collecting all results together in
an array first. This can be used to make applications more
scalable and more responsive if large results are expected.
See the documentation for details on the OutputHandler class.
#331330 (Bug #43211) *
P4Python now allows setting P4 registry values on Windows and
Mac OS. P4.set_env(name, value) sets an entry and P4.set_env(name)
deletes the entry. This is equivalent to running
'p4 set name=value' from the command line.
Bugs fixed in 2011.1
#385159 (Bug #49324) ***
On Windows Vista, Windows 7, or Windows 2008, a client running as
Administrator would fail to properly process file names in
non-ASCII character sets (such as Shift-JIS).
#328989 (Bug #44038) *
Prevent users from assigning non-string values to spec
objects such as labels or client workspaces. Assigning
values other than strings could crash P4Python.
#328975 (Bug #45395) *
Updated the stored spec templates for user, client and change
and added streams. These are required, for example,
for form-triggers that do not connect to the server first.
#328952 (Bug #45956) *
Under some circumstances P4Python would try to raise
a P4Error, which has been renamed to P4Exception.
This is now fixed.
#328223 (Bug #44820) *
P4.identify() reports the platform on Mac OS as DARWIN in line
with all other Perforce products.
#328187 (Bug #44819) *
P4.identify() now reports P4Python as P4PYTHON in line with
all other Perforce products.
#326428 (Bug #46255) *
P4.Map.reverse would return a P4API.P4Map object. It now
returns an instance of P4.Map instead.
#323887 (Bug #46151) *
P4.run_filelog() would throw an exception for rare
circumstances where no digest is defined for for a deleted
revision that was later readed. This is now fixed.
#312206 (Bug #44742) *
Info messages were not shown when an exception was thrown.
This is because all messages of type info get silently
swallowed. They will still not show in the output with this
change, but they will be logged in the P4.message list.
Info messages like this will be forwarded to the OutputHandler
if present.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
New functionality in 2010.2
#257896 (Bug #38952) *
P4Python now comes in a Perforce standardized directory
structure: p4python-<year>.<release>.<patchlevel>[-BETA].
Source and binary distributions created via 'python setup.py'
will follow this naming scheme.
#257263 (Bug #37856) *
Python 3.1 is now fully supported. It also has full support
for Unicode-enabled Perforce Servers. This also means that
P4.charset can be set to multibyte charsets such as UTF16.
#257099 (Bug #38766) * ***
Errors and warnings are now instances of P4Message.
This object has the additional methods generic(),
severity() and (unique) msgid(), which makes parsing
of error messages easier.
P4.warnings and P4.errors still return the errors and
warnings as strings for backwards compatibility.
#239278 (Bug #38210) *
Added new SetTrack() and GetTrack() methods.
For more details about server performance tracking see:
http://kb.perforce.com/article/883
Bugs fixed in 2010.2
#285704 (Bug #43213) *
The connect() context would silently swallow exceptions
thrown within the block. This means problems within the
following code would get missed unless explicitly caught
within the block:
with p4.connect():
# do something with p4
# automatically disconnected
This is now fixed.
#287034 (Bug #43415) *
Running 'print' on a file that started with '---' would
crash Python. This is now fixed.
There is still an oddity when p4.track = 1 and a user runs
p4.run_print() on a file that only has lines starting with
'--- '. In that case, the output of the print is lost.
Disable tracking by setting p4.track = 0 (the default) will
solve this problem.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
New functionality in 2010.1
#235589 (Bug #35946) *
Compatibility with Python 3. This change makes P4Python
incompatible with Python 2.5 and prior, but retains
compatibility with Python 2.6 (Python 2.7 also works
but is unsupported).
Python 3.1 is currently only experimental because of
Unicode and 8-bit ASCII support. P4Python 2010.1 with
Python 3.1 at the moment only supports 7-bit ASCII
on non-Unicode servers and UTF8 on Unicode servers.
#231765 *
Added new P4.server_unicode attribute that allows script
writers to test whether or not a Perforce Server is in
internationalized (unicode) mode.
P4.server_case_insensitive() has been changed from a method
to an attribute (that is, no brackets)
P4.server_level, P4.server_unicode and
P4.server_case_insensitive all will send a "info" command to
the server upon invocation if no previous command was sent
before. Previously, these commands would throw an exception
instead.
#230480 *
New read-only string attributes PATCHLEVEL and OS
so that script writers can test the installation of P4Python
without having to parse the output of P4.identify()
Bugs fixed in 2010.1
#242158 (Bug #38677) *
P4.identify() now correctly report 'NTX64' for 64-bit
builds on Windows.
#230649 (Bug #37434) *
All keyword arguments passed in the constructor are now
evaluated correctly.
#235706 *
Support for P4.run_print() for more than one file.
Previously, P4.run_print() would throw an exception
when trying to print more than one file.
#235718 (Bug #37841) *
P4.RAISE_ERROR has been renamed to P4.RAISE_ERRORS
for consistency with P4Ruby. P4.RAISE_ERROR is still
available for backwards compatibility.
#235730 (Bug #37186) *
Under rare circumstances P4.run_filelog() would throw an
"Index out of range" error for "fileSize" fields. This is
now prevented.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
New functionality in 2009.2
#214490 (Bug #35417 ) *
New P4.server_case_sensitive() method enables scripts to
detect whether the server is case-sensitive. Can be called
only after a command has been issued to the server.
#214611 (Bug #032917) *
Throw a P4Exception if user attempts to change the port after
a connection is established.
#215413 (Bug #31789) *
Throw an exception if a user tries to set a charset wider
than one byte. Previously, all commands subsequent to
setting a multi-byte charset returned empty strings.
Bugs fixed in 2009.2
#227423 (Bug #37143) *
The build script removed the release notes when invoked. Fixed.
#214614 (Bug #34866) *
The P4.connected() method now correctly resets the flag when
detecting a dropped connection.
#215406 *
P4.__enter__() now correctly returns self, which permits the
following idiom to work correctly:
with p4.connect() as p:
# use p here as an alias
#209643 (Bug #36223) *
P4Python now builds with the latest API on Windows using
Visual Studio 2008.
Previously, the build failed because of a link error.
#222723 (Bug #36558) *
The Map class removed '-' and '+' from the path if the
form Map.insert(lhs, rhs) was used, even if these characters
did not appear at the beginning of the path.
Now dashes and pluses are preserved within the path.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
New functionality in 2009.1
#191476 (Bug #26731) *
Support for the Python "with" statement.
P4.connect() now returns a Contect Management object that can
be used in a "with" statement with a block. When the block is
finished, the connection is automatically disconnected:
import P4
p4 = P4.P4()
with p4.connect():
# execute statements here
# p4 is now disconnected
Also, there are two new methods, P4.while_tagged() and
P4.at_exception_level() that, when used in a "with" statement,
set the tagged mode and exception_level for the block and then
reset it back to the original state. For example:
with p4.at_exception_level(P4.RAISE_ERROR): # no exceptions
# for warnings
p4.run_sync("//depot/main/...")
Bugs fixed in 2009.1
#192108 (Bug #32920) *
P4Python now correctly parsse jobs when the jobspec contains
fields with names ending in numbers.
#191458 (Bug #32834) *
Charset can now be reset to the empty string ''.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
New functionality in 2008.2
#164805 (Bug #30704) *
P4Python now builds under CYGWIN.
#163103 (Bug #30363) *
#166832 *
A new class P4.Map has been defined in P4Python
that allows users to create, and work with, Perforce mappings
without requiring a connection to a server. Methods in the
P4.Map class are:
P4.Map() Constructor.
P4.Map.join() Class method. Joins two maps to create a
third.
P4.Map.clear() Empties the map
P4.Map.count() Returns the number of entries in the map
P4.Map.is_empty() Returns True if the map is empty
P4.Map.insert() Adds new entries to the map
P4.Map.translate() Translates a string through the map
P4.Map.includes() Returns True if the supplied string is
visible through the map
P4.Map.reverse() Swap left and right sides of the mapping
P4.Map.lhs() Returns the left-hand-side of the map
P4.Map.rhs() Returns the right-hand-side of the map
P4.Map.as_array() Returns the map as an array
Bugs fixed in 2008.2
#176515 (Bug #31367) *
Using P4.run_print() in untagged mode throws an exception:
IndexError: list index out of range
This is now fixed. P4.run_print() can be used both in tagged and
untagged mode.
#157855 (Bug #29933) *
P4Python now correctly loads the value of P4CHARSET from the
environment.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
New functionality in 2008.1
#157600 *
Added support for P4.run_resolve(). The default for
run_resolve() is now to accept the merge hint provided by the
server unless the hint is "e", indicating a conflict. In this
case, run_resolve() will skip the resolve.
P4.run_resolve() can also accept a "resolver" keyword argument,
which should point to an instance of a subclass of P4.Resolver.
The subclass should overwrite the method
P4.Resolver.resolve(self, mergeData) and return a string
indicating how the resolve should proceed.
To get the old behaviour of "resolve", run the
command P4.run("resolve"). You will need to set P4.input to the
correct response in this case.
#152008 (Bug #28761) *
Added support for Python 2.4.
#152362 (Bug #29024) *
The 'P4.env( var )' method has been added to the
P4 class. This instance method enables the caller to
interrogate the Perforce environment, including reading Perforce
variables from P4CONFIG files and, on Windows, the registry.
P4.cwd now loads any P4CONFIG file settings that are appropriate
to the new working directory.
#153547 (Bug #29310) *
P4Python now supports Mac OSX 10.5.
Bugs fixed in 2008.1
#175062 (Bug #31637) *
P4Python sometimes incorrectly decrements the reference count
of None when calling p4.run_filelog(). In certain
circumstances, this could cause Python to deallocate None,
causing a fatal error. This problem has been fixed.
#168966 (Bug #31180) *
P4Python did not release its output variable correctly. This
caused a crash on 64 bit versions of Python when the P4 object
went out of scope. This is now fixed.
#166644 (Bug #30723) *
P4Python connections were not being correctly cleaned up when
they were discarded due to a reference counting problem.
This problem has been corrected.
#161025 (Bug #30076) *
Fixed a serious memory leak problem in P4Python. Basically,
all results returned from P4.run() had too many reference
counts, which prevented the Python garbage collector from
being able to clean up these objects. Now P4Python is memory
neutral, as can be checked with the debug version of Python,
which shows the total number of reference counts.
#157844 (Bug #28653) *
Fixed an error with p4.run_filelog() when tagged output is
off. The "df" variable is now correctly initialized on
line 333 of P4.py.
#156847 (Bug #28770) *
Calling print to retrieve the contents of a file no longer
truncates content.
#155969 (Bug #29703) *
When trying to create an illegal field in a Spec, P4Python
would try to raise a P4Error, only to fail because the wrong
number of arguments was provided to the Exception. This has
been fixed.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Bugs fixed in 2007.3
#149927 (Bug #28703) *
The presence of deleted revisions in a file's history could
lead to P4Python throwing an error message. This occurred
because deleted revisions do not have 'digest' or 'fileSize'
fields. This problem has been corrected.
#146116 (Bug #28260) *
The P4Python test harness, p4test.py, was omitted from the
source distribution in error. This problem has been corrected.
#146024 (Bug #28077) *
P4.Revision doesn't have a depot_file, or depotFile attribute
as its counterparts in P4Perl and P4Ruby do. This is now fixed.