-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pyc

ó
î:ïNc@@sKdZddlmZddlZddlZddlmZddlZddlm	Z	m
Z
mZmZm
Z
mZddlmZmZddlmZd„Zd	„Zd
idd
6dd6Zedd„Zedd„Zeddd„Zd„Zddd„Zdefd„ƒYZeƒZdd„Zdd„Z dS(sCommit message editor support.i(tabsolute_importN(tcall(tcmdlinetconfigtosutilsttracet	transporttui(tBzrErrortBadCommitMessageEncoding(tHookscc@sõytjddfVWntk
r)nXtjƒjdƒ}|dk	r_|tjƒfVnx6dD].}|tjkrftj|d|fVqfqfWtj	dkrÆxGdD]}|dfVq®Wn+x(d
ddd
dgD]}|dfVqÜWdS(sFReturn a sequence of possible editor binaries for the current platformt
BZR_EDITORs$BZR_EDITORteditortVISUALtEDITORt$twin32swordpad.exesnotepad.exes/usr/bin/editortvitpicotnanotjoeN(R
R(swordpad.exesnotepad.exe(
tostenvirontKeyErrorRtGlobalStacktgettNonetconfig_filenametsystplatform(tetvarnameR((s4/usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pyt_get_editor&s


cC@sÈx«tƒD] \}}tj|ƒ}yt||gƒ}WnHtk
r†}|dk	r
tjd||t|ƒfƒq
q
‚nX|dkr—t	S|dkr©q
q
Pq
Wt
dtjƒƒ‚dS(s4Try to execute an editor to edit the commit message.s2Could not start editor "%s" (specified by %s): %s
iistCould not start any editor.
Please specify one with:
 - $BZR_EDITOR
 - editor=/some/path in %s
 - $VISUAL
 - $EDITORN(
R RtsplitRtOSErrorRRtwarningtstrtTrueRRR(tfilenamet	candidatetcandidate_sourcetedargstxR((s4/usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pyt_run_editor=s$s%(bar)s %(msg)s %(bar)st-itbars+This line and the following will be ignoredtmsgcC@sL|dk	r$|jtjƒƒ}n|jtjƒdƒ}t|||ƒS(s€Let the user edit a commit message in a temp file.

    This is run if they don't give a message or
    message-containing file on the command line.

    :param infotext:    Text to be displayed at bottom of message
                        for the user's reference;
                        currently similar to 'bzr status'.

    :param ignoreline:  The separator to use above the infotext.

    :param start_message:   The text to place above the separator, if any.
                            This will not be removed from the message
                            after the user has edited it.

    :return:    commit message or None.
    treplaceN(RtencodeRtget_user_encodingtedit_commit_message_encoded(tinfotextt
ignorelinet
start_message((s4/usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pytedit_commit_message^scC@s@d}zét|||ƒ\}}|s+dStj|ƒ}tjtj|ƒƒ}|j|ƒ}t|ƒsqdS|j|ƒ}||kr«t	j
jddiƒs«dSnt}	g}
d\}}t
|dƒ}
zºy™x’tjtjƒƒ|
ƒD]u}|jƒ}|	s'|dkrôt}	q'qôn|r=||kr=Pn|d7}|dkr\|}n|
j|ƒqôWWntk
rŠtƒ‚nXWd|
jƒXt|
ƒdkr°dS|
|3|
djd	ƒsád
dj|
ƒd	fSdj|
ƒSWd|dk	r;ytj|ƒWq;tk
r7}tjd||ƒq;XnXdS(
sðLet the user edit a commit message in a temp file.

    This is run if they don't give a message or
    message-containing file on the command line.

    :param infotext:    Text to be displayed at bottom of message
                        for the user's reference;
                        currently similar to 'bzr status'.
                        The string is already encoded

    :param ignoreline:  The separator to use above the infotext.

    :param start_message:   The text to place above the separator, if any.
                            This will not be removed from the message
                            after the user has edited it.
                            The string is already encoded

    :return:    commit message or None.
    u)Commit message was not edited, use anywaysbzrlib.msgeditor.unchangedtitrUiNiÿÿÿÿs
s%s%ss failed to unlink %s: %s; ignored(ii(Rt&_create_temp_file_with_commit_templateRtbasenameRtget_transport_from_pathtdirnamet	get_bytesR+Rt
ui_factorytconfirm_actiontFalsetfiletcodecst	getreaderR1tstripR%tappendtUnicodeDecodeErrorR	tclosetlentendswithtjoinRtunlinktIOErrorRR#(R3R4R5tmsgfilenamethasinfoR:t
msg_transporttreference_contenttedited_contenttstartedR.tlastlinetnlinestftlinet
stripped_lineR((s4/usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pyR2xsf		"	
	
c	C@s¼ddl}|jddd|dtƒ\}}tj|dƒ}zb|dk	re|jd|ƒn|dk	r|d	krt}|jd
||fƒnt}Wd|jƒX||fS(sCreate temp file and write commit template in it.

    :param infotext: Text to be displayed at bottom of message for the
        user's reference; currently similar to 'bzr status'.  The text is
        already encoded.

    :param ignoreline:  The separator to use above the infotext.

    :param start_message: The text to place above the separator, if any.
        This will not be removed from the message after the user has edited
        it.  The string is already encoded

    :return:    2-tuple (temp file name, hasinfo)
    iNtprefixsbzr_log.tdirttexttws%s
R7s

%s

%s(	ttempfiletmkstempR%RtfdopenRtwriteR@RG(	R3R4R5ttmpdirR\t
tmp_filenoRMtmsgfileRN((s4/usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pyR9Ós
cC@sOddlm}ddlm}|ƒ}||d|d|dtƒ|jƒS(soPrepare a template file for a commit into a branch.

    Returns a unicode string containing the template.
    i(tStringIO(tshow_tree_statustspecific_filestto_filetverbose(Rct
bzrlib.statusRdR%tgetvalue(tworking_treeReRcRdt
status_tmp((s4/usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pytmake_commit_message_templateøs
	
sutf-8cC@sŠddlm}ddlm}t||ƒ}|j|dƒ}|r†|ƒ}||jƒ|||d|ƒ|d|jƒ}n|S(sXPrepare a template file for a commit into a branch.

    Returns an encoded string.
    i(Rc(tshow_diff_treesR/t
path_encodings
(Rctbzrlib.diffRmRlR0t
basis_treeRi(RjRetdifftoutput_encodingRcRmttemplatetstream((s4/usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pyt$make_commit_message_template_encoded
s	tMessageEditorHookscB@seZdZd„ZRS(sÊA dictionary mapping hook name to a list of callables for message editor
    hooks.

    e.g. ['commit_message_template'] is the list of items to be called to
    generate a commit message template
    cC@s=tj|ddƒ|jdddƒ|jddd
ƒdS(sJCreate the default hooks.

        These are all empty initially.
        sbzrlib.msgeditorthookstset_commit_messages4Set a fixed commit message. set_commit_message is called with the bzrlib.commit.Commit object (so you can also change e.g. revision properties by editing commit.builder._revprops) and the message so far. set_commit_message must return the message to use or None if it should use the message editor as normal.iitcommit_message_templatesšCalled when a commit message is being generated. commit_message_template is called with the bzrlib.commit.Commit object and the message that is known so far. commit_message_template must return a new message to use (which could be the same as it was given). When there are multiple hooks registered for commit_message_template, they are chained with the result from the first passed into the second, and so on.ii
N(ii(ii
(R
t__init__tadd_hook(tself((s4/usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pyRz-s		(t__name__t
__module__t__doc__Rz(((s4/usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pyRv%scC@s.d}x!tdD]}|||ƒ}qW|S(s¢Sets the commit message.
    :param commit: Commit object for the active commit.
    :return: The commit message or None to continue using the message editor
    RxN(RRw(tcommitR5thook((s4/usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pyRxHscC@s.d}x!tdD]}|||ƒ}qW|S(sáGenerate a commit message template.

    :param commit: Commit object for the active commit.
    :param start_message: Message to start with.
    :return: A start commit message or None for an empty start commit message.
    RyN(RRw(R€R5R((s4/usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pyt generate_commit_message_templateSss--------------(!Rt
__future__RRBRt
subprocessRRtbzrlibRRRRRRt
bzrlib.errorsRR	tbzrlib.hooksR
R R+tDEFAULT_IGNORE_LINERR6R2R9RlRuRvRwRxR‚(((s4/usr/lib/python2.7/dist-packages/bzrlib/msgeditor.pyt<module>s2.		["	 	

Copyright © 2017 || Recoded By Mr.Bumblebee