-=[ Mr. Bumblebee ]=-
_Indonesia_
ó
¦îNc @@ sª d d l m Z d d l Z d d l Z d d l m Z m Z d d l m Z d d l m
Z
d Z e Z
e j d k r‚ e Z
n d d „ Z d e d
„ Z d „ Z d S( i ( t absolute_importN( t Popent PIPE( t NoDiff3( t check_text_patht restructuredtextt ntt c C@ s‡ t | d t | ƒ d t d t d t d t ƒ} | j | ƒ \ } } | j ƒ } | d k rz t d | d | ƒ ƒ ‚ n | | | f S( s Spawn a process, and wait for the result
If the process is killed, an exception is raised
:param args: The command line, the first entry should be the program name
:param input: [optional] The text to send the process on stdin
:return: (stdout, stderr, status)
t bufsizet stdint stdoutt stderrt close_fdsi s %s killed by signal %i( R t lenR t
_do_close_fdst communicatet waitt Exception( t argst inputt processR
R t status( ( s0 /usr/lib/python2.7/dist-packages/bzrlib/patch.pyt write_to_cmd$ s !c C@ sv d d d d d g } | r+ | j d ƒ n | d k rM | j d | f ƒ n | j | ƒ t | | ƒ \ } } } | S( s6 Apply a patch to a file, to produce another output file. This is should
be suitable for our limited purposes.
:param patch_contents: The contents of the patch to apply
:type patch_contents: str
:param filename: the name of the file to apply the patch to
:type filename: str
:param output_filename: The filename to produce. If None, file is modified in-place
:type output_filename: str or NoneType
:param reverse: If true, apply the patch in reverse
:type reverse: bool
:return: 0 on success, 1 if some hunks failed
t patchs -fs -ss --posixs --binarys --reverses -oN( t appendt Nonet extendR ( t patch_contentst filenamet output_filenamet reverseR R
R R ( ( s0 /usr/lib/python2.7/dist-packages/bzrlib/patch.pyR 6 s
c C@ s
d „ } t | ƒ t | ƒ t | ƒ d d d g } | | d ƒ | | d ƒ | | d ƒ | j | | | f ƒ y t | ƒ \ } } } Wn1 t k
r¿ } | j t j k r¹ t ‚ qÀ ‚ n X| d k rÛ t | ƒ ‚ n t | d
ƒ }
z |
j | ƒ Wd |
j
ƒ X| S( Nc S@ s | j d | f ƒ d S( Ns -L( R ( R t label( ( s0 /usr/lib/python2.7/dist-packages/bzrlib/patch.pyt add_labelP s t diff3s -Es --merget TREEt ANCESTORs MERGE-SOURCEi i t wb( i i ( R R R t OSErrort errnot ENOENTR R t opent writet close( t out_filet mine_patht
older_patht
yours_pathR R t outputR R t et f( ( s0 /usr/lib/python2.7/dist-packages/bzrlib/patch.pyR! O s,
( t
__future__R R&