Edit File: rcvs.pyo
� ]�7ec�����������@���s����d��Z��d�d�l�m�Z�m�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�m �Z �d�Z �d�e�f�d�������YZ�d�Z�d �Z �d �e�f�d�������YZ�d�e �f�d �������YZ�d����Z�d����Z�e�d�k�r��e����n��d�S(���s$���Remote CVS -- command line interfacei����(���t���CVSt���FileN(���t���CommandFrameWorki���t���MyFilec�����������B���sk���e��Z�d�����Z�d����Z�d�d���Z�g��d���Z�d����Z�d�d���Z�d����Z�d����Z �d ����Z �d ����Z�RS(���c���������C���sl��|��j��s�|��j����n��|��j�s,�|��j����n��|��j�s|�|��j�sR�|��j�sK�d�Sd�Sqh|��j�s_�d�S|��j�|��j�k�ru�d�Sd�Sn��|��j�s��|��j�r��|��j�r��d�Sd�Sqh|��j�r��d�G|��j�Gd �GHd �Sd�Sn��|��j�s��|��j �r��d�Sd�Sn��|��j �r |��j�|��j�k�rd �Sd�Sn��|��j�|��j �k�r8|��j �|��j�k�r1d�Sd �Sn0�|��j �|��j�k�rNd�S|��j�|��j�k�rdd �Sd�Sd�S(���s��Return a code indicating the update status of this file. The possible return values are: '=' -- everything's fine '0' -- file doesn't exist anywhere '?' -- exists locally only 'A' -- new locally 'R' -- deleted locally 'U' -- changed remotely, no changes locally (includes new remotely or deleted remotely) 'M' -- changed locally, no changes remotely 'C' -- conflict: changed locally as well as remotely (includes cases where the file has been added or removed locally and remotely) 'D' -- deleted remotely 'N' -- new remotely 'r' -- get rid of entry 'c' -- create entry 'u' -- update entry (and probably others :-) t���0t���Nt���?t���ct���Ct���Rt���rs���warning:s���was lostt���Ut���At���Dt���ut���=t���MN(���t���lseent���getlocalt���rseent ���getremotet���eseent���lsumt���rsumt���edeletedt���filet���enewt���esum(���t���self(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���action0���sT���� � � � � c���������C���s ��|��j�����}�|�d�k�r�d��S|�G|��j�GH|�d�k�rA�|��j����n��|�d�k�r\�d�|��j�GHn��|�d�k�r��t�|��j���d�|��_�n��|�d�k�r��d�|��_�nm�|�d�k�rd�|��_�|��j�|��_�d�|��_�d�|��_�|��j �|��_ �t�j�|��j���d�\�|��_ �|��_�d �|��_�n��d��S(���NR���R���R���R���s+���%s: conflict resolution not yet implementedR ���i����R ���R���R���i���i����t����(���R���R���(���R���R���(���R���R���t���gett���removeR���t���rrevt���erevR���R���R���R���t���ost���statt���emtimet���ectimet���extra(���R���t���code(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���updatey���s,����� "R���c���������C���sc���|��j�����}�|�d�k�r)�|��j�|���d�S|�d�k�rD�d�|��j�GHn�|�d�k�r_�d�|��j�GHn��d��S( ���NR���R���i���R ���s*���%s: committing removes not yet implementedR���s+���%s: conflict resolution not yet implemented(���R���R���(���R���t���putR���(���R���t���messageR(���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���commit����s���� c���������C���sE��|��j�����d�}�|��j�}�x;�|�D]3�\�}�}�|�d�k�rA�|�}�q �|�d�|�|�}�q �W|�|��j�k�r|�|��j�|��j�k�r|�d��S|�d�}�|��j�}�|��j�j�|�|�f���}�t�j�|���j ����}�|��j�|�k�r��d��Sd�d��l �} �| �j����} �| �j�|���| �j ����d�|�|�|�f�GHt�j�d�|�| �j�|�f���}�|�rAd�d �GHn��d��S( ���NR���s���-rt��� i���i����s���diff %s -r%s %ss ���diff %s %s %sR���iF���(���R���R!���R���R���R���t���proxyR���t���md5t���newt���digestt���tempfilet���NamedTemporaryFilet���writet���flushR#���t���systemt���name(���R���t���optst���flagst���revt���ot���at���fnt���datat���sumR2���t���tft���sts(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���diff����s.���� ! c���������C���s���|��j�����d�k�S(���NR���(���R���(���R���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���commitcheck����s����c���������C���s����d�G|��j��Gd�GHt�|��j����j����}�|��j�sD�|��j�j�|��j����n��|��j�j�|��j��|�|���}�|�rm�|�GHn��|��j�|��j�j�|��j����|��j ���d��S(���Ns���Checking ins���...( ���R���t���opent���readR���R.���t���lockR*���t���setentryt���headR���(���R���R+���R>���t���messages(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyR*�������s���� c���������C���sX���|��j��j�|��j���}�t�|��j�d���}�|�j�|���|�j����|��j�|��j�|��j���d��S(���Nt���w( ���R.���R���R���RD���R4���t���closeRG���R!���R���(���R���R>���t���f(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyR�������s ���� c���������C���s���|��j��j�|��j�|���GHd��S(���N(���R.���t���logR���(���R���t ���otherflags(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRM�������s����c���������C���sX���d�|��_��|��j�|��_�d�\�|��_�|��_�d�|��_�d�|��_�d�|��_�d�|��_��d�|��_�d��S(���Ni����R���i���(���i����i����( ���R���R���R���R%���R&���R"���R���R���R'���(���R���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���add����s���� c���������C���se���d�|��_��|�|��_�t�j�|��j���d�\�|��_�|��_�|�|��_�d�|��_�d�|��_ �d�|��_��d�|��_ �d��S(���Ni����i����i���R���(���R���R���R#���R$���R���R%���R&���R"���R���R���R'���(���R���R"���R���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRG�������s���� " (���t���__name__t ���__module__R���R)���R,���RB���RC���R*���R���RM���RO���RG���(����(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyR���.���s��� I s���/usr/lib/sendmail -tso���To: %s Subject: CVS changes: %s ...Message from rcvs... Committed files: %s Log message: %s t���RCVSc�����������B���sq���e��Z�e�Z�d�����Z�d����Z�d�d���Z�d�d���Z�d����Z�d����Z �d����Z �d����Z�d ����Z�d �d���Z �RS(���c���������C���s���t��j�|����d��S(���N(���R����t���__init__(���R���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRS�������s����c���������C���s+���x$�|��j��|�d���D]�}�|�j����q�Wd��S(���Ni���(���t���whichentriesR)���(���R���t���filest���e(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyR)�������s����R���c���������C���s����|��j��|���}�|�s�d��Sd�}�x#�|�D]�}�|�j����s&�d�}�q&�q&�W|�sT�d�GHd��S|�si�t�d���}�n��g��}�x0�|�D](�}�|�j�|���rv�|�j�|�j���qv�qv�W|��j�|�|���d��S(���Ni���i����s���correct above errors firsts���One-liner: (���RT���RC���t ���raw_inputR,���t���appendR���t���mailinfo(���R���RU���R+���t���listt���okRV���t ���committed(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyR,�������s"����� c���������C���s����d�}�t��|�t�j�|���t�j�|���|�f�}�d�d�GH|�GHd�d�GHt�d�|���}�t�j�t�j�|�����d�k�r��t�j�t�d���}�|�j �|���|�j ����}�|�r��d �t�|���GHq��d �GHn�d�GHd��S( ���Ns���sjoerd@cwi.nl, jack@cwi.nlt���-iF���s���OK to mail to %s? t���yt���yet���yesRJ���s���Sendmail exit status %ss ���Mail sent.s ���No mail sent.(���R^���R_���R`���(���t���MAILFORMt���stringt���joinRW���t���lowert���stripR#���t���popent���SENDMAILR4���RK���t���str(���R���RU���R+���t���towhomt���mailtextR[���t���pRA���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRY�����s���� c���������C���s(���x!�|��j��|���D]�}�|�j����q�Wd��S(���N(���RT���t���report(���R���RU���RV���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRl���!��s����c���������C���s+���x$�|��j��|���D]�}�|�j�|���q�Wd��S(���N(���RT���RB���(���R���RU���R8���RV���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRB���%��s����c���������C���sC���|�s�t��d���n��g��}�x$�|��j�|�d���D]�}�|�j����q+�Wd��S(���Ns!���'cvs add' needs at least one filei���(���t���RuntimeErrorRT���RO���(���R���RU���RZ���RV���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRO���)��s ����c���������C���s���|�s�t��d���n��t��d���d��S(���Ns ���'cvs rm' needs at least one files���'cvs rm' not yet imlemented(���Rm���(���R���RU���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���rm0��s����c���������C���sZ���d�}�x&�|�D]�\�}�}�|�d�|�|�}�q �Wx$�|��j��|���D]�}�|�j�|���q?�Wd��S(���NR���R-���(���RT���RM���(���R���RU���R8���R9���R;���R<���RV���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRM���5��s ����i����c���������C���s���|�rk�g��}�xE|�D]Q�}�|��j��j�|���r;�|��j��|�}�n�|��j�|���}�|�|��j��|�<|�j�|���q�Wn��|��j��j����}�xX�|��j�j����D]G�}�|��j��j�|���r��q��n��|��j�|���}�|�|��j��|�<|�j�|���q��W|�rJxl�t�j�t�j ���D]U�}�|��j��j�|���r��|��j �|���r��|��j�|���}�|�|��j��|�<|�j�|���q��q��Wn��|�j����|��j�r�x/�|�D]$�}�|�j�d��k�rd|��j�|�_�qdqdWn��|�S(���N( ���t���entriest���has_keyt ���FileClassRX���t���valuesR.���t ���listfilesR#���t���listdirt���curdirt���ignoredt���sortt���None(���R���RU���t ���localfilestooRZ���R���RV���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRT���<��s8���� (���RP���RQ���R���Rq���RS���R)���R,���RY���Rl���RB���RO���Rn���RM���RT���(����(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRR�������s��� t���rcvsc�����������B���s����e��Z�d��Z�d�Z�d�Z�d����Z�d����Z�d����Z�d����Z�d����Z �d����Z �d ����Z�d ����Z�d�Z �e�Z�e �Z�d����Z�d �Z�e�Z�e�Z�d����Z�d�Z�e�Z�e�Z�d����Z�d����Z�e�Z�d����Z�d�Z�RS(���s ���d:h:p:qvLsM���usage: rcvs [-d directory] [-h host] [-p port] [-q] [-v] [subcommand arg ...]s<���If no subcommand is given, the status of all files is listedc���������C���s&���t��j�|����d�|��_�t����|��_�d�S(���s���Constructor.N(���R���RS���Rx���R.���RR���t���cvs(���R���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRS���e��s���� c���������C���s&���|��j��r�|��j��j����n��d��|��_��d��S(���N(���R.���t���_closeRx���(���R���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRK���k��s���� c���������C���s��|��j�����t�j�t�j���}�x��|�D]��}�|�t�j�k�s#�|�t�j�k�rM�q#�n��|�d�k�r_�q#�n��t�j�j�|���sw�q#�n��t�j�j�|���r��q#�n��d�G|�Gd�GHt�j�|���z3�t�j�j�d���r��|��j ����j ����n �|��j����Wd��t�j�t�j���d�G|�Gd�GHXq#�Wd��S(���NR����s���--- entering subdirectorys���---s���--- left subdirectory(���RK���R#���Rt���Ru���t���pardirt���patht���isdirt���islinkt���chdirt ���__class__t���runt���recurse(���R���t���namesR7���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyR����p��s&���� c���������C���s ���|�|��_��d��S(���N(���R8���(���R���R8���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���options���s����c���������C���sE���d�d��l��}�|�j�|��j���|��_�|��j�j�|��j���|��j�j����d��S(���Ni����(���t ���rcsclientt ���openrcsclientR8���R.���R{���t���setproxyt ���getentries(���R���R����(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���ready���s����c���������C���s���|��j��j�g����d��S(���N(���R{���Rl���(���R���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���default���s����c���������C���s���|��j��j�|���d��S(���N(���R{���Rl���(���R���R8���RU���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt ���do_report���s����c���������C���s����t��}�x>�|�D]6�\�}�}�|�d�k�r.�d�}�n��|�d�k�r �d�}�q �q �W|��j�j�|���|��j�j����|�r�|�r�|��j����n��d�S(���s���update [-l] [-R] [file] ...s���-li���s���-Ri����N(���t ���DEF_LOCALR{���R)���t ���putentriesR����(���R���R8���RU���t���localR;���R<���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt ���do_update���s����� � s���-lRc���������C���sV���d�}�x)�|�D]!�\�}�}�|�d�k�r �|�}�q �q �W|��j��j�|�|���|��j��j����d�S(���s���commit [-m message] [file] ...R���s���-mN(���R{���R,���R����(���R���R8���RU���R+���R;���R<���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt ���do_commit���s����� s���m:c���������C���s���|��j��j�|�|���d�S(���s���diff [difflags] [file] ...N(���R{���RB���(���R���R8���RU���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���do_diff���s����s���cbitwcefhnlr:sD:S:c���������C���s0���|�s�d�GHd�S|��j��j�|���|��j��j����d�S(���s���add file ...s%���'rcvs add' requires at least one fileN(���R{���RO���R����(���R���R8���RU���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���do_add���s ����c���������C���s0���|�s�d�GHd�S|��j��j�|���|��j��j����d�S(���s���remove file ...s(���'rcvs remove' requires at least one fileN(���R{���R ���R����(���R���R8���RU���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt ���do_remove���s ����c���������C���s���|��j��j�|�|���d�S(���s���log [rlog-options] [file] ...N(���R{���RM���(���R���R8���RU���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���do_log���s����s���bhLNRtd:s:V:r:(���RP���RQ���t���GlobalFlagst���UsageMessaget���PostUsageMessageRS���RK���R����R����R����R����R����R����t���flags_updatet���do_upt���flags_upR����t���flags_committ���do_comt ���flags_comR����t ���flags_difft���do_dift ���flags_difR����R����t���do_rmR����t ���flags_log(����(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyRz���]��s6��� c���������C���s,���y�t��j�|����Wn�t��j�k �r'�n�Xd��S(���N(���R#���t���unlinkt���error(���R=���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyR ������s����c����������C���s)���t�����}��z�|��j����Wd��|��j����Xd��S(���N(���Rz���R����RK���(���R ���(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���main���s���� t���__main__(���t���__doc__t���cvslibR����R���R/���R#���Rb���t���syst���cmdfwR���R����R���Rg���Ra���RR���Rz���R ���R����RP���(����(����(����s'���/usr/lib64/python2.7/Demo/pdist/rcvs.pyt���<module>���s ��� �lp