-=[ Mr. Bumblebee ]=-
_Indonesia_

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


Qc@@sdZddlmZddlmZddlZddlZddlmZee	dddl
mZmZddl
mZmZdd	lmZdd
lmZddlZ
ddlmZddl
mZdd
lmZmZmZmZmZmZmZddlm Z m!Z!ddl"m#Z#ddl$m%Z%m&Z&dZ'dZ(dZ)de*fdYZ+de+fdYZ,de+fdYZ-de+fdYZ.de
j/j0e1j2fdYZ3de3e
j/j4fdYZ5d e1j6fd!YZ7e7Z8d"e1j9fd#YZ:d$ej;e:fd%YZ<d$ej;e:fd&YZ<e8j=d'd(d)e8j=d*d(d+e8j=d,d(d-e8j=d.d/d0e8j>d,dS(1sWorkingTree object and friends.

A WorkingTree represents the editable working copy of a branch.
Operations which represent the WorkingTree are also done here,
such as renaming or adding files.  The WorkingTree has an inventory
which is updated by these operations.  A commit produces a
new revision based on the workingtree and its inventory.

At the moment every WorkingTree has its own branch.  Remote
WorkingTrees aren't supported.

To get a WorkingTree, call bzrdir.open_workingtree() or
WorkingTree.open(dir).
i(tabsolute_import(tStringION(tlazy_imports
from bisect import bisect_left
import collections
import errno
import itertools
import operator
import stat
import re

from bzrlib import (
    branch,
    conflicts as _mod_conflicts,
    controldir,
    errors,
    filters as _mod_filters,
    generate_ids,
    globbing,
    graph as _mod_graph,
    ignores,
    inventory,
    merge,
    revision as _mod_revision,
    revisiontree,
    rio as _mod_rio,
    shelf,
    transform,
    transport,
    ui,
    views,
    xml5,
    xml7,
    )
(tbzrdirtsymbol_versioning(tneeds_read_locktneeds_write_lock(tgettext(tLogicalLockResult(tneeds_tree_write_lock(tosutils(t	file_kindtisdirtnormpathtpathjointrealpathtsafe_unicodet	splitpath(tmuttertnote(tCURRENT_REVISION(tdeprecated_passedtDEPRECATED_PARAMETERs BZR merge-modified list format 1sBZR conflict list format 1it	TreeEntrycB@s eZdZdZdZRS(s;An entry that implements the minimum interface used by commands.

    This needs further inspection, it may be better to have
    InventoryEntries without ids - though that seems wrong. For now,
    this is a parallel hierarchy to InventoryEntry, and needs to become
    one of several things: decorates to that hierarchy, children of, or
    parents of it.
    Another note is that these objects are currently only used when there is
    no InventoryEntry available - i.e. for unversioned objects.
    Perhaps they should be UnversionedEntry et al. ? - RBC 20051003
    cC@st|to|j|jkS(N(t
isinstanceRt	__class__(tselftother((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt__eq__}scC@sdS(Ns???((R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytkind_characters(t__name__t
__module__t__doc__RR(((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRps	t
TreeDirectorycB@s eZdZdZdZRS(s5See TreeEntry. This is a directory in a working tree.cC@st|to|j|jkS(N(RR!R(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@sdS(Nt/((R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRs(RRR RR(((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR!s	tTreeFilecB@s eZdZdZdZRS(s8See TreeEntry. This is a regular file in a working tree.cC@st|to|j|jkS(N(RR#R(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@sdS(Nt((R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRs(RRR RR(((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR#s	tTreeLinkcB@s eZdZdZdZRS(s3See TreeEntry. This is a symlink in a working tree.cC@st|to|j|jkS(N(RR%R(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@sdS(NR$((R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRs(RRR RR(((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR%s	tWorkingTreecB@seZdZdZdeedsdsdsdZedZ	edZ
dZeddd	d
ZdZ
dZd
ZdZdZdZdZdZedsedZedsdZedseedZeedZedsdZedZdZdZdZdZ dZ!dZ"dsedZ#dsee$j%d Z&dsed!Z'ed"Z(dsed#Z)d$Z*d%Z+e,dsd&Z-e,dsd'Z.d(Z/d)Z0dsed*Z1d+Z2e3d,Z4e5ed-Z6e3ed.Z7e3d/Z8e9j:e$j;d0Z<d1Z=d2Z>d3Z?d4Z@e3ed5ZAe3d6ZBe3d7ZCd8ZDe5dsdsdsed9ZEd:ZFe5dsd;ZGdsd<ZHd=ZId>ZJd?ZKd@ZLdsdAZMdBZNdCZOedsedDZPdsedEZQe3edFZRe,dGZSdHZTe5edsdsdseedIZUe5dJZVdKZWdLZXdMZYdNZZdOZ[dPZ\dQZ]dRZ^dSZ_dTZ`e,dUZadVZbdWZcdXZddYZedZZfd[Zgd\Zhe3edseed]Zie3dsdsedsed^Zje5d_Zke5d`ZldaZme3dbZndcZoddZpeqZrdsdsdseredeZse3dsdsdsedfZtdgZudhZvdiZwdjdkZxdjdlZye3dmZzdnZ{doZ|dsdpZ}dqZ~drZRS(tsWorking copy tree.

    :ivar basedir: The root of the tree on disk. This is a unicode path object
        (as opposed to a URL).
    cC@s
tj|S(N(tviewst
DisabledViews(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_make_viewsst.cC@s||_||_|s*tjdnt|}td|t|r[||_n|jj|_t	||_
||_d|_
|j|_dS(sConstruct a WorkingTree instance. This is not a public API.

        :param branch: A branch to override probing for the branch.
        sQPlease use bzrdir.open_workingtree or WorkingTree.open() to obtain a WorkingTree.sopening working tree %rN(t_formatRterrorstBzrErrorRRRt_branchtopen_branchRtbasedirt
_transporttNonet_rules_searcherR)R'(RR0tbrancht	_internalR1R+t_bzrdir((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt__init__s
		
		cC@s
|jjS(N(Rtuser_transport(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR8scC@s|jS(N(R1(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytcontrol_transportscC@s|jj|S(sTrue if filename is the name of a control file in this tree.

        :param filename: A filename within the tree. This is a relative path
            from the root of this tree.

        This is true IF and ONLY IF the filename is part of the meta data
        that bzr controls in this tree. I.E. a random .bzr directory placed
        on disk will not be a control file for this tree.
        (Rtis_control_filename(Rtfilename((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR:s
tfgetcC@s|jS(N(R.(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt<lambda>stdocsThe branch this WorkingTree is connected to.

            This cannot be set - it is reflective of the actual disk structure
            the working tree has been constructed from.
            cC@s
|jjS(s%See `Tree.has_versioned_directories`.(R+tsupports_versioned_directories(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pythas_versioned_directoriesscC@stjdkrtStS(Ntwin32(tsystplatformtFalsetTrue(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_supports_executablescC@st|jdS(sBreak a lock if one is present from another instance.

        Uses the ui factory to ask for confirmation if the lock may be from
        an active process.

        This will probe the repository for its lock as well.
        N(tNotImplementedErrort
break_lock(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRHscC@s
|jjS(N(R+trequires_rich_root(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRIscC@stS(N(RD(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytsupports_tree_referencescC@s
|jjS(N(R+tsupports_content_filtering(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRKscC@s
|jjS(N(R'tsupports_views(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRLscC@s
|jjS(s]Retrieve the config stack for this tree.

        :return: A ``bzrlib.config.Stack``
        (R4tget_config_stack(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRM	scC@sC|dkrtj}ntjj|d|}|jd|S(s0Open an existing working tree at path.

        t_unsupportedtunsupportedN(R2R
tgetcwdt
controldirt
ControlDirtopentopen_workingtree(tpathRNtcontrol((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRSscC@sC|dkrtj}ntjj|\}}|j|fS(sOpen an existing working tree which has its root about path.

        This probes for a working tree at path and searches upwards from there.

        Basically we keep looking up until we find the control directory or
        run into /.  If there isn't one, raises NotBranchError.
        TODO: give this a new exception.
        If there is one, it is returned, along with the unused portion of path.

        :return: The WorkingTree that contains 'path', and the rest of path
        N(R2R
RPRQRRtopen_containingRT(RURVtrelpath((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRWs
c	C@s|dkrd}n|dks3t|dkrtj|d}|jr|r|jj}|r|}tj|}tt	d|qn||fS|dkr|d}n+|}g|D]}t
j||^q}tj|d}||j||d|fS(sOpen the WorkingTree that contains a set of paths.

        Fail if the paths given are not all in a single tree.

        This is used for the many command-line interfaces that take a list of
        any number of files and that require they all be in the same tree.
        u.is'Ignoring files outside view. View is %st
apply_viewN(
R2tlenR&RWRLR'tlookup_viewtview_display_strRRR
Rtsafe_relpath_files(	t	file_listtdefault_directorytcanonicalizeRYttreet
view_filestview_strtseedtf((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytopen_containing_paths-s&
	

"c	@s|dkrdSjr4|r4jj}ng}g}|rXfd}n	j}x^|D]V}|tj|}|rtj||rtj	||n|j
|qhW|S(sConvert file_list into a list of relpaths in tree.

        :param self: A tree to operate on.
        :param file_list: A list of user provided paths or None.
        :param apply_view: if True and a view is set, apply it or check that
            specified files are within it
        :return: A list of relative paths.
        :raises errors.PathNotChild: When a provided path is in a different self
            than self.
        c@stjj|S(N(R
tcanonical_relpathR0(tp(R(s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR=esN(R2RLR'R[RXR
tdereference_patht
is_inside_anyR,tFileOutsideViewtappend(	RR^R`RYRbtnew_listtfixerR;RX((Rs6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR]Ps	
cC@stj|dtS(szOpen an unsupported working tree.

        Only intended for advanced situations like upgrading part of a bzrdir.
        RN(R&RSRE(RU((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytopen_downleveloscC@sbd}d}tj|}tjj|d|d|}g|D]}|dk	rF|^qFS(NcS@s,g|jdD]}|dkr|^qS(NR$s.bzr(tlist_dir(t	transporttd((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytlist_currentyscS@s<y|j}Wntjk
r-tdfSXt|fSdS(N(RTR,t
NoWorkingTreeRER2(RRa((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytevaluate{s
RuRs(Rqt
get_transportRQRRtfind_bzrdirsR2(tlocationRsRutttiteratorttr((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
find_treesws			cC@s d|jjt|ddfS(Ns
<%s of %s>R0(RRtgetattrR2(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt__repr__scC@st|j|S(N(RR0(RR;((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytabspathscC@sy|jd}Wn$tk
r:|jjjtjSXy|j|SWntjk
rbnXy|jjj|SWnKtj	tjfk
r|jjj
|rn|jjjtjSXdS(sReturn RevisionTree for the current last revision.

        If the left most parent is a ghost then the returned tree will be an
        empty tree - one obtained by calling
        repository.revision_tree(NULL_REVISION).
        iN(tget_parent_idst
IndexErrorR4t
repositoryt
revision_treet
_mod_revisiont
NULL_REVISIONR,tNoSuchRevisiontRevisionNotPresentthas_revision(Rtrevision_id((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
basis_trees 
cC@s|jdS(N(t_flush_ignore_list_cache(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_cleanupscC@stj|j|S(sReturn the local path portion from a given path.

        The path may be absolute or relative. If its a relative path it is
        interpreted relative to the python current working directory.
        (R
RXR0(RRU((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRXscC@stj|j|S(N(R
tlexistsR(RR;((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pythas_filenamescC@s|j||d|dS(Ntfilteredi(tget_file_with_stat(Rtfile_idRUR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytget_filescC@s|dkr|j|}n|j|dt}||j}|r{|jr{|j|}tj||}n||fS(sSee Tree.get_file_with_stat.RN(	R2tid2pathtget_file_bynameRDtfilenoRKt_content_filter_stackt_mod_filterstfiltered_input_file(RRRURt_fstattfile_objt
stat_valuetfilters((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@s;|j|d|d|}z|jSWd|jXdS(NRUR(Rtreadtclose(RRRURtmy_file((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
get_file_textscC@sW|j|}t|d}|rO|jrO|j|}tj||S|SdS(Ntrb(RtfileRKRRR(RR;RRUReR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@s8|j||d|}z|jSWd|jXdS(sSee Tree.get_file_lines()RN(Rt	readlinesR(RRRURR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytget_file_linesscC@stj|j}tj|kr-g}n	|g}y|jjd}Wntjk
rbn7Xx3tj	|D]"}|j
d}|j|qsW|S(sSee Tree.get_parent_ids.

        This implementation reads the pending merges list and last_revision
        value and uses that to decide what the parents list should be.
        spending-mergess
(Rtensure_nullt_last_revisionRR1t	get_bytesR,t
NoSuchFileR
tsplit_linestrstripRl(Rtlast_revtparentstmerges_bytestlR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRs		cC@st|jdS(s Return the id of this trees rootN(RGtget_root_id(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@s |j}|j|||S(sDuplicate this working tree into to_bzr, including all state.

        Specifically modified files are kept as modified, but
        ignored and unknown files are discarded.

        If you want to make a new line of development, see ControlDir.sprout()

        revision
            If not None, the cloned tree will have its last revision set to
            revision, and difference between the source trees last revision
            and this one merged in.
        (tcreate_workingtreetcopy_content_into(Rt
to_controldirRtresult((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytclonescC@s|j|j|dkr2tj||n}y|j|}Wn)tjk
rp|jj	j|}nXtj|||t
jkrg}n	|g}|j|dS(s?Copy the current content and user files of this tree into tree.N(
tset_root_idRR2tmergettransform_treeRR,RR4RRRtset_parent_ids(RRaRt
other_treetnew_parents((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRs		cC@s|j|j|S(N(RR(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
id2abspath&scc@st}x|D]\}}|j|krS|jdkr|j|jqqn|jdkr|j|rtj|j|j|j}|j|jn||fVqWdS(s/See if directories have become tree-references.t	directoryN(	tsett	parent_idtkindtaddRt_directory_is_tree_referencet	inventoryt
TreeReferencetname(RRztblocked_parent_idsRUtie((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_check_for_tree_references)s	cC@sBtt|jd|d|}|js1|S|j|SdS(sSee Tree.iter_entries_by_dir()tspecific_file_idst
yield_parentsN(tsuperR&titer_entries_by_dirRJR(RRRRz((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR9s	cC@sSytjj|j|SWn/tk
rN}|jtjkrGqOdSnXdS(sSee Tree.get_file_sizeN(tosRUtgetsizeRtOSErrorterrnotENOENTR2(RRte((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
get_file_sizeEscC@sxt|D]\}}||dkr
t|j|}yt|||<Wqtk
r}|jtjkrtj	|qqXq
q
WdS(sSee MutableTree._gather_kinds.N(
t	enumerateR2R
RRRRRR,R(RtfilestkindstposRetfullpathR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
_gather_kindsQscC@s<|j|g}|j|dt|dkp4|dS(sAdd revision_id as a parent.

        This is equivalent to retrieving the current list of parent ids
        and setting the list to its value plus revision_id.

        :param revision_id: The revision id to add to the parent list. It may
            be a ghost revision as long as its not the first parent to be
            added, or the allow_leftmost_as_ghost parameter is set True.
        :param allow_leftmost_as_ghost: Allow the first parent to be a ghost.
        tallow_leftmost_as_ghostiN(RRRZ(RRRR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytadd_parent_tree_id]scC@sI|j|dg}t|dkr2t}n|j|d|dS(scAdd revision_id, tree tuple as a parent.

        This is equivalent to retrieving the current list of parent trees
        and setting the list to its value plus parent_tuple. See also
        add_parent_tree_id - if you only have a parent id available it will be
        simpler to use that api. If you have the parent already available, using
        this api is preferred.

        :param parent_tuple: The (revision id, tree) to add to the parent list.
            If the revision_id is a ghost, pass None for the tree.
        :param allow_leftmost_as_ghost: Allow the first parent to be a ghost.
        iiRN(RRZRER(Rtparent_tupleRt
parent_ids((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytadd_parent_treems
	cG@sh|j}t}x3|D]+}||kr1qn|j|t}qW|rd|j|dtndS(NR(RRDRlRER(Rtrevision_idsRtupdatedtrev_id((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytadd_pending_merges


c	C@s|j|}y||}Wn5tk
rV}t|ddtjkrPdSnX||j}|dkr|j||S|dkr|j|rd}n|dddfS|dkrt	j
|}ddd|fS|dddfSdS(	sSee Tree.path_content_summary.RtmissingRRstree-referencetsymlinkN(RNNN(RRR}R2RRtst_modet_file_content_summaryRR
treadlink(	RRUt_lstatt_mapperRtstat_resultRRttarget((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytpath_content_summarys$	cC@s7|j}|j||}d|||j||fS(NR(tst_sizet!_is_executable_from_path_and_statt_sha_from_stat(RRURtsizet
executable((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRs	cC@sRt|dkrN|d}|rN|jjj|rNtj|qNndS(sCommon ghost checking functionality from set_parent_*.

        This checks that the left hand-parent exists if there are any
        revisions present.
        iN(RZR4RRR,tGhostRevisionUnusableHere(RRRtleftmost_id((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_check_parents_for_ghostss

cC@s9|d}|jjddj|d|jjdS(Nispending-mergess
tmode(R1t	put_bytestjoinRt_get_file_mode(RRtmerges((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_set_merges_from_parent_idss
cC@st|dkr|S|jjj}|j|}|d }x:|dD].}||krL||krL|j|qLqLW||krtd||n|S(sCheck that all merged revisions are proper 'heads'.

        This will always return the first revision_id, and any merged revisions
        which are
        iis6requested to set revision_ids = %s, but filtered to %s(RZR4Rt	get_graphtheadsRlR(RRtgraphRtnew_revision_idsR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_filter_parent_ids_by_ancestrys

cC@s|j|d|x|D]}tj|qW|j|}t|dkrf|j|dn|jtj|j|dS(sSet the parent ids to revision_ids.

        See also set_parent_trees. This api will try to retrieve the tree data
        for each element of revision_ids from the trees repository. If you have
        tree data already available, it is more efficient to use
        set_parent_trees rather than set_parent_ids. set_parent_ids is however
        an easier API to use.

        :param revision_ids: The revision_ids to set as the parent ids of this
            working tree. Any of these may be ghosts.
        RiN(RRtcheck_not_reserved_idRRZtset_last_revisionRR(RRRR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRs

cC@s1|j}|d }||}|j|dS(Ni(RR(Rtrev_listRtleftmostR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytset_pending_mergess

cC@st|jdS(sSet the merge modified hashes.N(RGtset_merge_modified(Rtmodified_hashes((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@sdS(sGet a sha digest from the tree's stat cache.

        The default implementation assumes no stat cache is present.

        :param path: The path.
        :param stat_result: The stat result being looked up.
        N(R2(RRUR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRsc
C@sddlm}m}||jd|}|rP|jrPtj|n|dkrttj	|j
}n||_tj|jrtj
|n|jj|d|j|j|_|jjj|j|_||_|dkr|jn|j|||j|jkr1tjnt|_|dkrR||_n	||_|jdt|_t|_|j}	|j|	S(svMerge from a branch into this working tree.

        :param branch: The branch to merge from.
        :param to_revision: If non-None, the merge will merge to to_revision,
            but not beyond it. to_revision does not need to be in the history
            of the branch when it is supplied. If None, to_revision defaults to
            branch.last_revision().
        i(tMergertMerge3Mergert	this_treet
last_revisionN( tbzrlib.mergeRRR4thas_changesR,tUncommittedChangesR2RRR	tother_rev_idtis_nullt	NoCommitstfetchtother_basisRRRtother_brancht	find_basetset_base_revisiontbase_rev_idtPointlessMergeRDtbackup_filest
merge_typetset_interesting_filest	show_baset	reprocesstdo_mergetset_pending(
RR4tto_revisiont
from_revisionRtforceRRtmergert	conflicts((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytmerge_from_branchs:		
		
		
cC@st|jdS(s{Return a dictionary of files modified by a merge.

        The list is initialized by WorkingTree.set_merge_modified, which is
        typically called after we make some automatic updates to the tree
        because of a merge.

        This returns a map of file_id->sha1, containing only files which are
        still in the working inventory and have that text hash.
        N(RGtmerge_modified(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR$4s
cC@sW|dkr*tjtjj|}ntj|j||j||d|S(sSee MutableTree.mkdir().RN(	R2tgenerate_idstgen_file_idRRUtbasenametmkdirRR(RRUR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR(@s
cC@s@|dk	r|j|}n|j|}tj|}|S(N(R2RRR
R(RRRURR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytget_symlink_targetIs
cC@st|jdS(N(RGtsubsume(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR*QscC@s1|jjjjr!|j|_n|j|_dS(N(R.RR+RJt _directory_may_be_tree_referenceRt"_directory_is_never_tree_reference(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt"_setup_directory_is_tree_referenceTscC@stS(N(RD(RRX((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR,\scC@s |otj|j|dS(Nu/.bzr(R
RR(RRX((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR+_scC@st|jdS(suExtract a subtree from this tree.

        A new branch will be created, relative to the path for this tree.
        N(RGtextract(RRtformat((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR.nscC@st|jdS(s&Write the in memory meta data to disk.N(RGtflush(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR0uscC@stj|j|S(N(R
RR(RRX((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_kindyscC@st|jdS(sList all files as (path, class, kind, id, entry).

        Lists, but does not descend into unversioned directories.
        This does not include files that have been deleted in this
        tree. Skips the control directory.

        :param include_root: if True, return an entry for the root
        :param from_dir: start from this directory or None for the root
        :param recursive: whether to recurse into subdirectories or not
        N(RGt
list_files(Rtinclude_roottfrom_dirt	recursive((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR2|scC@st|jdS(sRename files.

        to_dir must be known to the working tree.

        If to_dir exists and is a directory, the files are moved into
        it, keeping their old names.

        Note that to_dir is only the last component of the new name;
        this doesn't change the directory.

        For each entry in from_paths the move mode will be determined
        independently.

        The first mode moves the file in the filesystem and updates the
        working tree metadata. The second mode only updates the working tree
        metadata without touching the file on the filesystem.

        move uses the second mode if 'after == True' and the target is not
        versioned but present in the working tree.

        move uses the second mode if 'after == False' and the source is
        versioned but no longer in the working tree, and the target is not
        versioned but present in the working tree.

        move uses the first mode if 'after == False' and the source is
        versioned and present in the working tree, and the target is not
        versioned and not present in the working tree.

        Everything else results in an error.

        This returns a list of (from_path, to_path) pairs for each
        entry that is moved.
        N(RGtmove(Rt
from_pathstto_dirtafter((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR6s"cC@st|jdS(sRename one file.

        This can change the directory or the filename or both.

        rename_one has several 'modes' to work. First, it can rename a physical
        file and change the file_id. That is the normal mode. Second, it can
        only change the file_id without touching any physical file.

        rename_one uses the second mode if 'after == True' and 'to_rel' is
        either not versioned or newly added, and present in the working tree.

        rename_one uses the second mode if 'after == False' and 'from_rel' is
        versioned but no longer in the working tree, and 'to_rel' is not
        versioned but present in the working tree.

        rename_one uses the first mode if 'after == False' and 'from_rel' is
        versioned and present in the working tree, and 'to_rel' is not
        versioned and not present in the working tree.

        Everything else results in an error.
        N(RGt
rename_one(Rtfrom_reltto_relR9((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR:scC@s2tg|jD]}|j|s|^qS(sReturn all unknown files.

        These are files in the working directory that are not versioned or
        control files or ignored.
        (titertextrast
is_ignored(Rtsubp((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytunknownss	cC@st|jdS(s*Remove the file ids in file_ids from the current versioned set.

        When a file_id is unversioned, all of its children are automatically
        unversioned.

        :param file_ids: The file ids to stop versioning.
        :raises: NoSuchId if any fileid is not currently versioned.
        N(RGt	unversion(Rtfile_ids((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRBs	cC@s|jz|jj}|j}	|jj|||d|d|}
|jj}||kr|jj}|jjr|j}
|
r|
d}|j	|}	qn|	jz|jj}t
j|j||	d|ddd|d||	j
}|j
}|dk	r:||kr:|j|nWd|	jXg}|jjtjkr|j|jj|fn|jd}|jg|D]}||j	|f^q|j|n|
SWd|jXdS(	Ntpossible_transportstlocaliRtpbtchange_reporterRi(t	lock_readR4tlast_revision_infoRtpullRR+tfast_deltasRRRtmerge_innerR2RRtunlockR	RRRltextendtset_parent_trees(Rtsourcet	overwritet
stop_revisionRGRDRERtold_revision_infoRtcounttnew_revision_infoRRtbasis_idtnew_basis_treet
basis_root_idtnew_root_idtparent_treesRtparent((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRJsT
	

&cC@s;t|j|d}z|j|Wd|jXdS(s*See MutableTree.put_file_bytes_non_atomic.twbN(RRtwriteR(RRtbyteststream((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytput_file_bytes_non_atomicscC@st|jdS(sYield all unversioned files in this WorkingTree.

        If there are any unversioned directories then only the directory is
        returned, not all its children.  But if there are unversioned files
        under a versioned subdirectory, they are returned.

        Currently returned depth-first, sorted by name within directories.
        This is the same order used by 'osutils.walkdirs'.
        N(RGR>(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR>s
cc@sDx=|jD]/}|j|}|dk	r
||fVq
q
WdS(s"Yield list of PATH, IGNORE_PATTERNN(R>R?R2(RR@tpat((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
ignored_files+scC@st|dd}|dk	r"|St}|jtj|jtj|jtj	r|j
tj	}z|jtj|Wd|jXn||_
|S(saReturn list of ignore patterns.

        Cached in the Tree object after the first call.
        t
_ignoresetN(R}R2Rtupdatetignorestget_runtime_ignorestget_user_ignoresRtbzrlibtIGNORE_FILENAMERtparse_ignore_fileRRc(Rt	ignoresettignore_globsRe((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytget_ignore_list2s		cC@sd|_d|_dS(s7Resets the cached ignore list to force a cache rebuild.N(R2Rct_ignoreglobster(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRGs	cC@sCt|dddkr3tj|j|_n|jj|S(sCheck whether the filename matches an ignore pattern.

        Patterns containing '/' or '\' need to match the whole path;
        others match against only the last component.  Patterns starting
        with '!' are ignore exceptions.  Exceptions take precedence
        over regular patterns and cause the filename to not be ignored.

        If the file is ignored, returns the pattern which caused it to
        be ignored, otherwise None.  So this can simply be used as a
        boolean if desired.RnN(R}R2tglobbingtExceptionGlobsterRmRntmatch(RR;((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR?LscC@st|j|S(N(RR(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR[scC@st|jdS(sSee Tree.stored_kindN(RGtstored_kind(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRr^sc	C@s|j|}ytj|}WnFtk
rj}t|ddtjkrdd}d}t}qn_X|j	}t
j|}|js|dk	o|j
}n"ttj|otj|@}|||fS(NR(RRtlstatRR}R2RRRDRR
tfile_kind_from_stat_modeRFRtbooltstattS_ISREGtS_IEXEC(	RtentryRURRRRRR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_comparison_databs		"cC@s|jS(N(R(RRyR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
_file_sizevscC@s
|jS(sReturn the last revision of the branch for this tree.

        This format tree does not support a separate marker for last-revision
        compared to the branch.

        See MutableTree.last_revision
        (R(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR	yscC@stj|jjS(shelper for get_parent_ids.(RRR4R	(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@st|jdS(sCheck if this tree is locked.N(RGt	is_locked(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR|scC@st|jdS(sLock the tree for reading.

        This also locks the branch, and can be unlocked via self.unlock().

        :return: A bzrlib.lock.LogicalLockResult.
        N(RGRH(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRHscC@st|jdS(stSee MutableTree.lock_tree_write, and WorkingTree.unlock.

        :return: A bzrlib.lock.LogicalLockResult.
        N(RGtlock_tree_write(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR}scC@st|jdS(soSee MutableTree.lock_write, and WorkingTree.unlock.

        :return: A bzrlib.lock.LogicalLockResult.
        N(RGt
lock_write(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR~scC@st|jdS(N(RGtget_physical_lock_status(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@st|jdS(s-Change the last revision in the working tree.N(RGR(Rtnew_revision((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@sutj|r&|jjd|tStj|y|jj|Wn'tjk
rp|jj	|gnXt
S(sTemplate method part of set_last_revision to perform the change.

        This is used to allow WorkingTree3 instances to not affect branch
        when their last revision is set.
        i(RRR4tset_last_revision_infoRDRtgenerate_revision_historyR,Rt_set_revision_historyRE(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_change_last_revisions
c
@st|tr|g}ng}tt}|dkrKtj}ngfd}xX|D]P}	j|	}
j|
}	t|	dkrmj	|	||	qmqmWt
}t|dkrdS|jdt|r|rxj
jdtdtdtd|D]\}}}
}}}}}|dtkrqj|d	q/|
r/|d	dk	r/tj||d	r/j|d	q/q/Wnfd
}x|D]}j|}d}|sd|f}n|r^j|r d}nd
}tjj|}|j|d||dn|j|d|dfd|f}|s[j|tjr<tjrttjdkr|rtjd|f}q9||}qX|kr||}qXtjd|f}q[|dk	r[d|f}q[n|dk	rt|qqWj|dS(s-Remove nominated files from the working tree metadata.

        :files: File paths relative to the basedir.
        :keep_files: If true, the files will also be kept.
        :force: Delete files and directories, even if they are changed and
            even if the directories are not empty.
        c@ssxlj|D][\}}xL|D]D\}}}}}}j|rZj|q#j|q#WqWdS(N(twalkdirstpath2idRRl(Rtparent_infot
file_infosRXR'RRstfileid(t	all_filestfiles_to_backupR(s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytrecurse_directory_to_add_filess
iNtreversetinclude_unchangedtrequire_versionedtwant_unversionedtspecific_filesic@s9jj|}tjj|d||fS(Ns removed %s (but kept a copy: %s)(Rt_available_backup_nameR
trenameR(tfile_to_backuptbackup_name(tabs_pathR(s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytbackupss%s is not versioned.tIt?s       s
s
removed %ss
deleted %ss%s does not exist.( Rt
basestringRR2RBtstdoutRRXRZRtlisttsortREtiter_changesRRDRlR
RjRR?tkind_markerRR]RRRtlistdirtrmtreet
delete_anyRtapply_inventory_delta(RRtverbosetto_filet
keep_filesR t	inv_deltatunknown_nested_filesRR;RRRUtcontent_changet	versionedRRRRRRetfidtmessaget
new_statustkind_ch((RRRRs6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytremovesz
		

+
	 


cC@s7ddlm}|dkr;|j}|j|}nd}ztj||||||}|dkrt|jdkrg}	|j	}
|
t
jkr|dkr|j}|jn|	j|
|fn|j
|	||n|||dtdtWd|dk	r2|jnX|S(Ni(tresolveit
ignore_missesR5(tbzrlib.conflictsRR2RRHt	transformtrevertRZRR	RRRlRORERM(Rt	filenamestold_treetbackupsRFtreport_changesRRR"RZR	((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR2s.
		$


cC@sq|j}tj||}z.|js1dS|jj||jWd|jXtd|jj	dS(s6Store uncommitted changes from the tree in the branch.Ns*Uncommitted changes stored in branch "%s".(
RtshelftShelfCreatort
shelve_allR4tstore_uncommittedRtfinalizeRtnick(Rttarget_treet
shelf_creator((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRPscC@sg|jj|}|dkr"dSz3|j}t|_|j|jjdWd|jXdS(s:Restore uncommitted changes from the branch into the tree.N(	R4t
get_unshelverR2tmake_mergerREtignore_zeroRRR(Rt	unshelverR!((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytrestore_uncommitted^s	
cC@st|jdS(sSee Tree.revision_tree.

        WorkingTree can supply revision_trees for the basis revision only
        because there is only one cached inventory in the bzr directory.
        N(RGR(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRlscC@s;|dkrtdntj|}|j|dS(sSet the root id for this tree.s(WorkingTree.set_root_id with fileid=NoneN(R2t
ValueErrorR
tsafe_file_idt_set_root_id(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRts
cC@st|jdS(sSet the root id for this tree, in a format specific manner.

        :param file_id: The file id to assign to the root. It must not be
            present in the current inventory or an error will occur. It must
            not be None, but rather a valid file id.
        N(RGR(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR~scC@st|jdS(sSee Branch.unlock.

        WorkingTree locking just uses the Branch locking facilities.
        This is current because all working trees have an embedded branch
        within them. IF in the future, we were to make branch data shareable
        between multiple working trees, i.e. via shared storage, then we
        would probably want to lock both the local tree, and the branch.
        N(RGRM(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRMs	cC@s|jjdk	r1|j||jk}n|jt}zM|r_|jj|}n||jkrwd}n|j||||SWd|j	XdS(sUpdate a working tree along its branch.

        This will update the branch if its bound too, which means we have
        multiple trees involved:

        - The new basis tree of the master.
        - The old basis tree of the branch.
        - The old basis tree of the working tree.
        - The current working tree state.

        Pathologically, all three may be different, and non-ancestors of each
        other.  Conceptually we want to:

        - Preserve the wt.basis->wt.state changes
        - Transform the wt.basis to the new master basis.
        - Apply a merge of the old branch basis to get any 'local' changes from
          it into the tree.
        - Restore the wt.basis->wt.state changes.

        There isn't a single operation at the moment to do that, so we:

        - Merge current state -> basis tree of the master w.r.t. the old tree
          basis.
        - Do a 'normal' merge of the old branch basis if it is relevant.

        :param revision: The target revision to update to. Must be in the
            revision history.
        :param old_tip: If branch.update() has already been run, the value it
            returned (old tip of the branch or None). _marker is used
            otherwise.
        N(
R4tget_bound_locationR2R~t_markerR}RDRdt_update_treeRM(RRGRDtrevisiontold_tipRt
update_branch((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRds!

	c
C@sd}y|jd}Wntk
r6tj}nX|dkrU|jj}n|patj}tj|r||kr|j}|jj	j
|}tj|j||d|d|d|}|r|j
||fttd|Sn|tj|kr|jj	j
|}	|	j}
|j}|jzB|jdksn|j|
kr|j|
|jnWd|jX|jj	j}|j|jj|}
|jj	j
|
}tj|j|	|d|d|d|}|j|||	fg}|jd}x0|D](}|j||jj	j
|fq6Wtj|s|j||jj	j
|fn|j||dd}n|S(sUpdate a tree to the master branch.

        :param old_tip: if supplied, the previous tip revision the branch,
            before it was changed to the master branch's tip.
        iRRGRs(Rerun update after fixing the conflicts.Ni(RRRRR2R4R	RRRRRRLRRRRRRHRR0RMRtfind_unique_lcaRRlRO(RRRGRRtnb_conflictsRt	base_treeRtto_treet
to_root_idtbasisRRRZRR[((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRsb

	
$
		

 
cC@stj|j|dS(N(R,tUnsupportedOperationt
set_conflicts(Rtarg((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@stj|j|dS(N(R,Rt
add_conflicts(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@st|jdS(N(RGR"(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR""sR$c	c@s|j|}|jdr+|d }nt|d}|j|}tj||}y|j}t}WnUtk
r}|j	t	j
kptjdko|j	t
ksnd}t}nXy|j}	t}
Wntk
rd}	t}
nXx|
s|r|r,|\\}}}
nd\\}}}
|s||dkrt|
dkrt|
d}|t|
kr|jj|
|dr|
|=qqn|
rd}n&|rd}nt|	dd|}|dkrjg|
D]-\}}}}}||||ddf^q}|df|fVy|j}Wqtk
rft}qXq|dkrg|	dD]0\}}}}}}||dd||f^q}|	dd|	ddf|fVy|j}	Wqtk
rt}
qXqg}xftjt|	d|
d	tjdtjdD],\}}t|}t|d
kr|\}}|j|d|d|d
|d|d|d
fqDt|dd
kr|j|dd|dd|dd
|ddddfqDt|ddkrd|j|dd|dddd|dd|dd
fqDtdqDW|	d|fVy|j}	Wntk
rt}
nXy|j}Wqtk
rt}qXqWdS(sWalk the directories of this tree.

        returns a generator which yields items in the form:
                ((curren_directory_path, fileid),
                 [(file1_path, file1_name, file1_kind, (lstat), file1_id,
                   file1_kind), ... ])

        This API returns a generator, which is only valid during the current
        tree transaction - within a single lock_read or lock_write duration.

        If the tree is not locked, it may cause an error to be raised,
        depending on the tree implementation.
        R"iiRAR$is.bzrtunknowntkeyiiiiisunreachable codeN(NN((NNN(s.bzrs.bzr(RtendswithRZt	_walkdirsR
RtnextRDRRRRBRCtERROR_PATH_NOT_FOUNDR2REt
StopIterationtbisect_leftRR:tcmpt	itertoolstgroupbytsortedtoperatort
itemgetterRRlRG(Rtprefixtdisk_topt
top_strip_lentinventory_iteratort
disk_iteratortcurrent_diskt
disk_finishedRtcurrent_invtinv_finishedtcur_disk_dir_relpathtcur_disk_dir_path_from_toptcur_disk_dir_contentt
bzrdir_loct	directionRXR'RRvttop_pathtdirblocktdkindRtsubiteratort
path_elementstinv_rowtdisk_row((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR%s





				7

>!

+
 


cC@st|jdS(s@Walk the directories of this tree.

        :param prefix: is used as the directrory to start with.
        :returns: a generator which yields items in the form::

            ((curren_directory_path, fileid),
             [(file1_path, file1_name, file1_kind, None, file1_id,
               file1_kind), ... ])
        N(RGR(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRs
cC@stj}tj}tjd}x|jD]}|jdksa|j|jdkrt|j|q4nt	|j
|jd}zBx;|D]&}|j|r|j|PqqW|j|Wd|jXq4W|j
||j|||fS(sAutomatically resolve text conflicts according to contents.

        Only text conflicts are auto_resolvable. Files with no conflict markers
        are considered 'resolved', because bzr always puts conflict markers
        into files that have text conflicts.  The corresponding .THIS .BASE and
        .OTHER files are deleted, as per 'resolve'.

        :return: a tuple of ConflictLists: (un_resolved, resolved).
        s^(<{7}|={7}|>{7})s
text conflictRRN(t_mod_conflictstConflictListtretcompileR"t
typestringRRRlRSRtsearchRtremove_filesR(Rtun_resolvedtresolvedtconflict_retconflictRtline((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytauto_resolves&




cC@sdS(s(Validate internal structures.

        This is meant mostly for the test suite. To give it a chance to detect
        corruption after actions have occurred. The default implementation is a
        just a no-op.

        :return: None. An exception should be raised if there is an error.
        N((R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt	_validates	cC@st|jdS(s,Check that the working state is/isn't valid.N(RGtcheck_state(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR
scC@st|jdS(sReset the state of the working tree.

        This does a hard-reset to a last-known-good state. This is a way to
        fix if something got corrupted (like the .bzr/checkout/dirstate file)
        N(RGtreset_state(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@s4|jdkr-tt|j||_n|jS(sSee Tree._get_rules_searcher.N(R3R2RR&t_get_rules_searcher(Rtdefault_searcher((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@s ddlm}|||jS(s-Return the ShelfManager for this WorkingTree.i(tShelfManager(tbzrlib.shelfRR1(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytget_shelf_managersN(RRR R)RRDR2R7tpropertyR8R9R:R4R@RFRHRIRJRKRLRMtstaticmethodRSRWRERfR]RoR|R~RRRRXRRR
tfstatRRRRRRRRRRRRRR	RRRRRRRsRtRRRRRRRRRR#R$R(R)R*R-R,R+R.R0R1R2R6R:RARBRJR`R>RbRmRR?RRrRzR{R	RR|RHR}R~RRRRRRRRRRRMtobjectRRdRRRR"RRRR	R
RRR(((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR&s 							
						!			"														
*							
$		6											
									u		
				0	U			y!			tInventoryWorkingTreecB@seZdZdedBdBedBdBdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZedZedZdZdZdZeedZdZdZdZedZedZedZdZ edZ!edZ"dZ#dZ$dZ%ed Z&d!Z'ed"Z(ed#Z)edBd$Z*d%Z+dBd&Z,d'Z-d(Z.dBd)Z/d*Z0ed+Z1d,Z2ee3d-Z4d.Z5ed/Z6ed0Z7e8d1Z9edBd2Z:edBe;d3Z<edBed4Z=eed5Z>d6e?fd7YZ@ed8ZAd9ZBd:ZCd;ZDed<ZEd=ZFd>ZGd?d@ZHe8dAZIRS(CsBase class for working trees that are inventory-oriented.

    The inventory is held in the `Branch` working-inventory, and the
    files are in a directory on disk.

    It is possible for a `WorkingTree` to have a filename which is
    not listed in the Inventory and vice versa.
    R*c
C@stt|jd|d|d|jd|d|d|||_|j|dkrnt|_d|_	n|j
|dtdS(	sConstruct a InventoryWorkingTree instance. This is not a public API.

        :param branch: A branch to override probing for the branch.
        R0R4R1R5R+R6tdirtyN(RRR7R1t_control_filest_detect_case_handlingR2RDt_inventory_is_modifiedt
_inventoryt_set_inventory(RR0R4RRR5R+R6((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR7s	
	cC@s||_||_dS(sSet the internal cached inventory.

        :param inv: The inventory to set.
        :param dirty: A boolean indicating whether the inventory is the same
            logical inventory as whats on disk. If True the inventory is not
            the same and should be written to disk or data will be lost, if
            False then the inventory is the same as that on disk and any
            serialisation would be unneeded overhead.
        N(RR(RtinvR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRs
	cC@s`|jjd}y|j|jjWntjk
rHt|_	n
Xt
|_	|jdS(N(Rtget_workingtree_transportR2RvR+tcase_sensitive_filenameR,RREtcase_sensitiveRDR-(Rtwt_trans((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR$s
	cC@s tjj|j|dtdS(Ntworking(txml5t
serializer_v5twrite_inventoryRRE(RRtout_file((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
_serialize/scC@stjj|S(N(R"R#tread_inventory(tselttin_file((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_deserialize3scC@s|jj|jjdS(sBreak a lock if one is present from another instance.

        Uses the ui factory to ask for confirmation if the lock may be from
        an active process.

        This will probe the repository for its lock as well.
        N(RRHR4(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRH6s
cC@s
|jjS(N(RR|(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR|AscC@s"|jstj|ndS(N(R|R,tObjectNotLocked(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_must_be_lockedDscC@sb|js|jn|jjy|jjt|jSWn|jjnXdS(sLock the tree for reading.

        This also locks the branch, and can be unlocked via self.unlock().

        :return: A bzrlib.lock.LogicalLockResult.
        N(R|t_reset_dataR4RHRRRM(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRHHs



cC@sb|js|jn|jjy|jjt|jSWn|jjnXdS(stSee MutableTree.lock_tree_write, and WorkingTree.unlock.

        :return: A bzrlib.lock.LogicalLockResult.
        N(R|R-R4RHRR~RRM(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR}Ys



cC@sb|js|jn|jjy|jjt|jSWn|jjnXdS(soSee MutableTree.lock_write, and WorkingTree.unlock.

        :return: A bzrlib.lock.LogicalLockResult.
        N(R|R-R4R~RRRM(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR~hs



cC@s
|jjS(N(RR(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRwscC@s!|j|dt|jdS(s)Write inventory as the current inventory.RN(RRER0(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_write_inventoryzscC@sddlm}m}m}m}||j}x|D]\}}}	}
tjj|}|dkrqq;n|
dkr|j	||||	q;|
dkr|j	||||	q;|
dkr|j	||||	q;t
jd|
q;W|j|dS(Ni(t	InventorytInventoryDirectoryt
InventoryFilet
InventoryLinkR$RRRsunknown kind %r(
tbzrlib.inventoryR/R0R1R2RRRUR'RR,R-R.(Rtnew_inventory_listR/R0R1R2RRURR[RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
set_inventorys"cC@s>|j}t|}|jj||d|jjdS(s9Write the basis inventory XML to the basis-inventory fileRN(t_basis_inventory_nameRR1tput_fileRR(RtxmlRUtsio((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_write_basis_inventoryscC@sSt|_|jjd}z|j|}Wd|jX|j|dtdS(s0Reset transient data that cannot be revalidated.RNR(RDRR1tgetR*RR(RReR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR-s	cC@s|j}|jj}t|_|j|jj=||j_|j|j|jj<x9|D]1}||}|j|krW|jj|_qWqWWdS(sSet the root id for this tree, in a format specific manner.

        :param file_id: The file id to assign to the root. It must not be
            present in the current inventory or an error will occur. It must
            not be None, but rather a valid file id.
        N(RtrootRRERt_byidR(RRRtorig_root_idRRy((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRs		

cC@sg|D]\}}|^q}x|D]}tj|q&W|j|d||j|}t|dkrtj}d}n|d\}}|j|r|dkr|j|q|j	}	|j
||	}
|j|
n|j|dS(s!See MutableTree.set_parent_trees.RiN(
RRRRRZRR2Rt_cache_basis_inventorytroot_inventoryt _create_basis_xml_from_inventoryR:R(Rtparents_listRtrevRaRRtleftmost_parent_idtleftmost_parent_treeRR8((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyROs$
			cC@sy|jjj|}|jddd}d|ksFd|krv|jjjj||}|j||}n|j|Wntj	tj
fk
rnXdS(s*Cache new_revision as the basis inventory.s
iis
revision_id="s
format="7"N(R4Rt_get_inventory_xmltsplitt_serializertread_inventory_from_stringRAR:R,RR(RRR8t	firstlineR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR?scC@sdS(Nsbasis-inventory-cache((R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR6scC@s||_tjj|S(s5Create the text that will be saved in basis-inventory(Rtxml7t
serializer_v7twrite_inventory_to_string(RRR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRAs	cC@s|jd|jtdS(NR"(t_put_riot
to_stanzastCONFLICT_HEADER_1(RR"((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@sWt|j}|jtt||jtjt|dtjj	dS(NR(
RR"RdRRRRRtConflicttsort_key(Rt
new_conflictstconflict_set((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR	scC@sy|jjd}Wntjk
r3tjSXzly)|jtdkr_tjnWnt	k
rtjnXt
j|}tjj|SWd|j
XdS(NR"s
(R1R;R,RRRRRPtConflictFormatErrorRt_mod_riot	RioReadertfrom_stanzasR(Rtconfiletreader((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR"s
cC@s|j}|jj|S(s Read the cached basis inventory.(R6R1R(RRU((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytread_basis_inventory!scC@se|jrtj|n|jjd}z|j|}Wd|jX|j|dt|S(sRead the working inventory.

        :raises errors.InventoryModified: read_working_inventory will fail
            when the current in memory inventory has been modified.
        RNR(	RR,tInventoryModifiedR1R;R*RRRD(RReR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytread_working_inventory&s	cC@s
|jjjS(s Return the id of this trees root(RR<R(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR;scC@sM|j|\}}|j|s(tS|j|}tj|j|S(N(t_unpack_file_idthas_idRDRR
RR(RRRtinv_file_idRU((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR_@s
cC@s8||jkrtS|j|\}}|j|S(N(RRER^R_(RRRR`((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
has_or_had_idHscC@s:t}x*|jD]\}}|j|jqW|S(sIterate through file_ids for this tree.

        file_ids are in a WorkingTree if they are in the working inventory
        and the working file exists.
        (RRRR(RtretRUR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytall_file_idsNs	cC@s#|j|r|j|ndS(s-Change the last revision in the working tree.N(RR?(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRYscC@sgS(s)Return the references needed to perform a check of this tree.
        
        The default implementation returns no refs, and is only suitable for
        trees that have no local caching and can commit on ghosts at any time.

        :seealso: bzrlib.check for details about check_refs.
        ((R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_get_check_refs_scC@s|j}|jzW|d|jf}tt|j|dkrbtjdn|jWd|j	XdS(sCheck the tree for consistency.

        :param references: A dict with keys matching the items returned by
            self._get_check_refs(), and values from looking those keys up in
            the repository.
        ttreesis#Mismatched basis inventory content.N(
RRHR	RZRRR,t
BzrCheckErrorR	RM(Rt
referencest
tree_basist
repo_basis((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_checkis
!cC@sh|j}i}xB|D]:}|\}}|dkr|jjj|||<qqW|j|dS(s,Check that the working state is/isn't valid.ReN(RdR4RRRj(Rt
check_refstrefstrefRtvalue((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR
|s
 cC@sv|dkr|j}n|s<|jjjtj}n|jjj|d}|j|j|j	|dS(sReset the state of the working tree.

        This does a hard-reset to a last-known-good state. This is a way to
        fix if something got corrupted (like the .bzr/checkout/dirstate file)
        iN(
R2RR4RRRRR.R@R(RRtrt((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@s||jjdkr$tj|nt}|j|j||jd|jj	d|d|j
jt|_
dS(s&Write the in memory inventory to disk.twiRRN(Rt
_lock_modeR,tNotWriteLockedRR&RtseekR1R7RRRDR(RR9((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR0s	
cC@sv|s|j|}nytj|j|jSWn:tk
rq}|jtjkrktj	|nnXdS(sSee Tree.get_file_mtime.N(
RRRsRtst_mtimeRRRR,tFileTimestampUnavailable(RRRUR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytget_file_mtimescC@s0|j|\}}|dkr%tS||jS(N(t_path2inv_file_idR2RDR(RRURRR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt,_is_executable_from_path_and_stat_from_basisscC@s)|j}ttj|o%tj|@S(N(RRuRvRwRx(RRURR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt+_is_executable_from_path_and_stat_from_stats	cC@s|js,|j|\}}||jS|sD|j|}ntj|j|j}tt	j
|o{t	j|@SdS(N(RFR^RRRRsRRRuRvRwRx(RRRURR`R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
is_executablescC@s0|js|j||S|j||SdS(N(RFRxRy(RRUR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@sw|j}xgt|||D]S\}}}|dkrM|j|d|n|j|d|d|t|_qWdS(sSee MutableTree._add.RRN(R@tzipR2tadd_pathRER(RRtidsRRReRR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt_adds	"cC@s||jkry|j}Wntjk
r8qXy>tjj|}|j|krvtj	|j
j||SWqtjk
rqXntj
||dS(sSee WorkingTree.revision_id.N(R	R[R,RRKRLRIRtrevisiontreetInventoryRevisionTreeR4RtBadInventoryFormattNoSuchRevisionInTree(RRR8R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRscC@sg}x|jD]}y|j|}Wn)tjk
rW|jjj|}nX|jzty|j|}Wntjk
rwnX|dkrwn||j	|f}||kr|j
|nWd|jXqWtj
|jjj}|j|}	g}
x*|D]"}||	kr|
j
|qqW|jjjj}|j|}
||f}|j||
|
g|j|D]\}}|d|f^q}|S(spSee Tree.annotate_iter

        This implementation will use the basis tree implementation if possible.
        Lines not in the basis are attributed to CURRENT_REVISION

        If there are pending merges, lines added by those merges will be
        incorrectly attributed to CURRENT_REVISION (but after committing, the
        attribution will be correct).
        RNi(RRR,RR4RRHRtNoSuchIdtget_file_revisionRlRMt
_mod_graphtGraphttextsRt
get_annotatorRtadd_special_textt
annotate_flat(RRtdefault_revisiontmaybe_file_parent_keysRtparent_treeRtparent_text_keyRRtfile_parent_keysRt	annotatorttexttthis_keyRtannotations((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt
annotate_iters>

/cC@sB|jtj||}|jj||d|jjdS(NR(R,RVtrio_fileR1R7RR(RR;tstanzastheaderR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRN!	s
c@s)fd}|jd|tdS(Nc3@sAx:jD],\}}tjd|jdd|Vq
WdS(NRtutf8thash(t	iteritemsRVtStanzatdecode(RR(R(s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytiter_stanzas)	ssmerge-hashes(RNtMERGE_MODIFIED_HEADER_1(RRR((Rs6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR'	scC@sy|jjd}Wntjk
r-iSXzi}y)|jtdkr_tjnWntk
rtjnXx{tj	|D]j}t
j|jddt}|j
|sqn|jd}||j|kr|||<qqW|SWd|jXdS(s{Return a dictionary of files modified by a merge.

        The list is initialized by WorkingTree.set_merge_modified, which is
        typically called after we make some automatic updates to the tree
        because of a merge.

        This returns a map of file_id->sha1, containing only files which are
        still in the working inventory and have that text hash.
        smerge-hashess
RtwarnRN(R1R;R,RRRtMergeModifiedFormatErrorRRVRWR
RRDR_t
get_file_sha1R(Rthashfiletmerge_hashestsRt	text_hash((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR$/	s(
c@sfd|j|jkr?tj||dny|j|j}Wn)tjk
rtj||dnX|jtj|}|dkrtj||dn|j
jjstj
|n|jz|j}|jj}||_tj||_|jj||j||j|jx7|jD])}|j
j|j
||j|q^WWd|jX|jjdS(Nc@sMxF|jjD]5}||j|j<|jdkr||qqWdS(NR(tchildrentvaluesR=RR(RRytchild_entry(tadd_children(s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRS	ssTrees have the same roots"Tree is not contained by the others"Parent directory is not versioned.(RR,tBadSubsumeSourceRXR0tPathNotChildRR
tdirnameR2R4Rtsupports_rich_roottSubsumeTargetNeedsUpgradeR}RR@R<RR'RRR.RRRMRt
retire_bzrdir(RRtother_tree_pathtnew_root_parentRt
other_rootR((Rs6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR*Q	s:

	c@sjfd}j|}||}|dkrRjj}n|j|j|}y|j}Wn tj	k
r|j
}nX|jstjn|j
}|jjx'jD]}	|jj|	qWjjj|}
|
j|jkrE|j|
}|j|n|}|jtj}|jjj}
tjdd}|
|}|
j|d|_|j|j |
|j ||S(suExtract a subtree from this tree.

        A new branch will be created, relative to the path for this tree.
        c@sLtj|}jjj}x'|D]}|j|}|jq%W|S(N(R
RR4Rtroot_transportRtensure_base(RUtsegmentsRqR(R(s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytmkdirs	s
troot_idN(!R0RR2Rtcloning_metadirRtinitialize_on_transporttfind_repositoryR,tNoRepositoryPresenttcreate_repositoryRtRootNotRicht
create_branchRJR4RRRRtbasetset_branch_referenceRRRRR@RR/tremove_recursive_idRRR.(RRR/Rtsub_pathtbranch_transportt
branch_bzrdirtrepot
new_branchRttree_transportttree_bzrdirtwttmy_invt	child_invtnew_root((Rs6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR.{	sD

	

	


cc@s|jstj|n|d	krY|tkrYddd|j|jjfVntj	}|j
}|jjj
jddd}itd6td6td6}|d	k	r|j|\}}	|	d	krd	S||j|}
n|j}|jj}	|j}
tj|
}|jtj|}|	d
|
|fg}xK|r|d\}	}
}
}x(|r|j}||krqhn|
d|}|
d|}||	}|jdkr|jj|}nd	}|rd}n|j|drd}ntj|\}}||ks/|r8d
}ne|}|
d|}|
d|}|j |	|}|r{d}n"|j|drd}nd
}||}|r|d|||j|fVnUy#|d||d	||fVWqht!k
r|d||d	t"fVqhXqh|dkr4qhn|rhtj|}|jtj|}|j#|j|||fPqhqhW|j$qIWd	S(sList all files as (path, class, kind, id, entry).

        Lists, but does not descend into unversioned directories.
        This does not include files that have been deleted in this
        tree. Skips the control directory.

        :param include_root: if True, return an entry for the root
        :param from_dir: start from this directory or None for the root
        :param recursive: whether to recurse into subdirectories or not
        R$tVRR"iiRRNuiRR(%R|R,R+R2RERR@R<R
RR1RRqRtrsplitR!R#R%RwR0RRRRtcollectionstdequetpopleftRRR;R?tnormalized_filenamet	get_childtKeyErrorRRltpop(RR3R4R5RRttransport_base_dirt
fk_entriesRtfrom_dir_idtfrom_dir_abspathRtstacktfrom_dir_relpathRetfptfaptdir_ietf_ietctf_normt
can_accesstfktnew_children((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR2	s
#				
		
					#

cC@sg}g}t}|d
kr0tdnt|trKtn|j|}t|stj	d|tj
|n|j|stj	d|tj|n|j
|\}}	|	d
krtj	d|tjd|n||	}
|
jdkr6tj	d|tj
|nx|D]}t|d}|j
|\}
}|d
krtj	||tjd|n|
|}|j}t||}tjd|d|d|d	|d
|d|d|	}|j||j||fq=W|j||}|j}y)t|rJt|_n|j|Wn||_nX|j||S(sRename files.

        to_dir must exist in the inventory.

        If to_dir exists and is a directory, the files are moved into
        it, keeping their old names.

        Note that to_dir is only the last component of the new name;
        this doesn't change the directory.

        For each entry in from_paths the move mode will be determined
        independently.

        The first mode moves the file in the filesystem and updates the
        inventory. The second mode only updates the inventory without
        touching the file on the filesystem.

        move uses the second mode if 'after == True' and the target is
        either not versioned or newly added, and present in the working tree.

        move uses the second mode if 'after == False' and the source is
        versioned but no longer in the working tree, and the target is not
        versioned but present in the working tree.

        move uses the first mode if 'after == False' and the source is
        versioned and present in the working tree, and the target is not
        versioned and not present in the working tree.

        Everything else results in an error.

        This returns a list of (from_path, to_path) pairs for each
        entry that is moved.
        s"You must supply a target directoryR$RURiR;tfrom_idt	from_tailtfrom_parent_idR<tto_tailtto_parent_idN(RR2t	TypeErrorRRRRRR,tBzrMoveFailedErrort
NotADirectoryRtNotInWorkingDirectoryRwtNotVersionedErrorRRRRRt_RenameEntryRlt_determine_mv_modeRRZREt_moveR.(RR7R8R9trename_entriest
rename_tuplest
invs_to_writetto_abstto_invt	to_dir_idt	to_dir_ieR;Rtfrom_invRt
from_entryRR<trename_entrytoriginal_modified((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR6,
sf#	


			
		
cC@sg}t|d}|j|\}}|dkr|jj}|j|}|dkrtj||tjd|n|j	|j
}	|j|	n|j|\}}
||
}	|	j
}tjj|\}}
|j|\}}tjd|d|d|d|d|d|
d	|}|j||j||}|dkrtj||tjd|ntd
||||||j||j|dS(sRename one file.

        This can change the directory or the filename or both.

        rename_one has several 'modes' to work. First, it can rename a physical
        file and change the file_id. That is the normal mode. Second, it can
        only change the file_id without touching any physical file.

        rename_one uses the second mode if 'after == True' and 'to_rel' is not
        versioned but present in the working tree.

        rename_one uses the second mode if 'after == False' and 'from_rel' is
        versioned but no longer in the working tree, and 'to_rel' is not
        versioned but present in the working tree.

        rename_one uses the first mode if 'after == False' and 'from_rel' is
        versioned and present in the working tree, and 'to_rel' is not
        versioned and not present in the working tree.

        Everything else results in an error.
        iRUR;RRRR<RRs[rename_one:
  from_id   {%s}
  from_rel: %r
  to_rel:   %r
  to_dir    %r
  to_dir_id {%s}
N(RRwR2R4RRR,tBzrRenameFailedErrorRR@tcopyRR^RRRURGRRRlRRRRR.(RR;R<R9RRRRRRtfrom_inv_idRR8RRRR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR:
s>
		

RcB@seZeedZRS(c

C@sU||_||_||_||_||_||_||_|	|_||_dS(N(	R;RRRR<RRt	change_idtonly_change_inv(
RR;RRRR<RRRR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR7
s								(RRRDR7(((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR
sc
	C@sL|j}x<|D]4}|j}|j}|j}|j|}t}	t}
|dkr|tj||tj	d|n|dk	r
t}|r|j
}|jz%|j|st
|_t
}nWd|jXn|s
tj||tjd|q
n|rU|j|sLtj||tjd|ddnt
}	n|j|r}|j|r}t
}	n|j|r|j|rt}	n|jr|j|jkr|j|rt}	n\|j|r)|j|r)tj||tjd||fntj|||	|_qW|S(sDetermines for each from-to pair if both inventory and working tree
        or only the inventory has to be changed.

        Also does basic plausability tests.
        RUNtextras!New file has not been created yettpaths(R@R;RR<RRDR2R,RRRRHR_RERRMtAlreadyVersionedErrorRRRtlowerRtPathsDoNotExisttRenameFailedFilesExistR(
RRR9RRR;RR<tto_idRRtallowedR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR
sZ	
			
	
			
	
cC@sSg}xF|D]>}y|j|Wn|j|nX|j|q
WdS(sMoves a list of files.

        Depending on the value of the flag 'only_change_inv', the
        file will be moved on the file system or not.
        N(t_move_entryt_rollback_moveRl(RRtmovedRy((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR(s

cC@sx|D]}yG|jtj|j|j|j|j|j|j|j	|j
Wqtjk
r}tjddd|qXqWdS(s?Try to rollback a previous move in case of an filesystem error.R$syRollback failed. The working tree is in an inconsistent state. Please consider doing a 'bzr revert'. Error message is: %sN(
R
R&RR<RRRR;RRRR,R(RRRyR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR8s
cC@s|j}|j|j}|j|j}||krWtj|j|jdn|jsytj||Wqt	k
r}tj|j|j|dqXn|j
r|j|j}|j|n|j|j
|j|jdS(Ns Source and target are identical.i(R@RR;R<R,RRR
RRRRRRRR(RRyRtfrom_rel_abst
to_rel_absRR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR
Gs 			cC@sx5|D]-}|jj|stj||qqWx3|D]+}|jj|r?|jj|q?q?Wt|r|j|jndS(s*Remove the file ids in file_ids from the current versioned set.

        When a file_id is unversioned, all of its children are automatically
        unversioned.

        :param file_ids: The file ids to stop versioning.
        :raises: NoSuchId if any fileid is not currently versioned.
        N(RR_R,RRRZR.(RRCR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRBZs


	cC@s |j|\}}||jS(sSee Tree.stored_kind(R^R(RRRR`((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRruscc@ssxl|jD]^\}}|jdkr.q
n|j|}t|sOq
ng}xtj|D]}|jj|rqen||jkreyt	j
|\}}WnFtk
r|jt	j
}|d|}	tj|	t	j
nX||kr(|r(||jkr5|j|q5q8|j|qeqeW|jx"|D]}t||}
|
VqMWq
WdS(sYield all unversioned files in this WorkingTree.

        If there are any unversioned directories then only the directory is
        returned, not all its children.  But if there are unversioned files
        under a versioned subdirectory, they are returned.

        Currently returned depth-first, sorted by name within directories.
        This is the same order used by 'osutils.walkdirs'.
        RR"N(RRRRRRRR:RR
RtUnicodeDecodeErrortencodet_fs_encR,tBadFilenameEncodingRlRR(RRUt	dir_entrytdirabstfltsubft	subf_normRtpath_os_encRXR@((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR>zs4
	

R$c
c@sMd}|j|\}}|dkr0g}n|d|d|dfg}x|rHg}|j}|d}|dr|dd}nd}||}	|	jdkrxI|	jD]8\}
}|j||
|
|jd|j|jfqWn|d|	jf|fVx4t|D]&}|d|kr|j|qqWqNWdS(s@Walk the directories of this tree.

        :param prefix: is used as the directrory to start with.
        :returns: a generator which yields items in the form::

            ((curren_directory_path, fileid),
             [(file1_path, file1_name, file1_kind, None, file1_id,
               file1_kind), ... ])
        RR$iiR"iN(RwR2RRtsorted_childrenRlRtreversed(
RRt
_directoryRttop_idtpendingRt
currentdirtrelrootRyRtchildtdir((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRs*
		


cC@s0|jj||jjd|jjdS(sUpdate the feature flags for this branch.

        :param updated_flags: Dictionary mapping feature names to necessities
            A necessity can be None to indicate the feature should be removed
        R/N(R+t_update_feature_flagsR9Rt	as_string(Rt
updated_flags((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytupdate_feature_flagssN(JRRR RR2RDR7RRR&R*RHR|R,RHR}R~RR	R.R5R:R-RROR?R6RARRRR"R[R]RR_RaRcRRdRjR
RR0RvRxRyRzRR~RRRRNRR$RR*R.RER2R6R:RRRRRR
RBRrR>RR%(((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRs		
												
									
			
		1	"*1cHA					,'tWorkingTreeFormatRegistrycB@s5eZdZddZdZdZdZRS(s"Registry for working tree formats.cC@s,tt|j|d|_d|_dS(N(RR&R7R2t_default_formatt_default_format_key(Rtother_registry((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR7s	cC@s=|jdk	r6|jdkr6|j|j|_n|jS(s"Return the current default format.N(R(R2R'R;(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytget_defaultscC@s||_d|_dS(sSet the default format.N(R'R2R((RR/((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytset_defaults	cC@s||_d|_dS(s,Set the default format by its format string.N(R(R2R'(Rt
format_string((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytset_default_keys	N(RRR R2R7R*R+R-(((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR&s
		tWorkingTreeFormatcB@seZdZeZeZeZdZeZd
Z
d
d
d
edZdZdZ
dZdZdZdZd	ZRS(sAn encapsulation of the initialization and open routines for a format.

    Formats provide three things:
     * An initialization routine,
     * a format string,
     * an open routine.

    Formats are placed in an dict by their format string for reference
    during workingtree opening. Its not required that these be instances, they
    can be classes themselves with class methods - it simply depends on
    whether state is needed for a given format or not.

    Once a format is deprecated, just deprecate the initialize and open
    methods on the format class. Do not deprecate the object, as the
    object will be created every time regardless.
    tFoRMaTcC@st|jdS(sInitialize a new working tree in controldir.

        :param controldir: ControlDir to initialize the working tree in.
        :param revision_id: allows creating a working tree at a different
            revision than the branch is at.
        :param from_branch: Branch to checkout
        :param accelerator_tree: A tree which can be used for retrieving file
            contents more quickly than the revision tree, i.e. a workingtree.
            The revision tree will be used for cases where accelerator_tree's
            content is different.
        :param hardlink: If true, hard-link files from accelerator_tree,
            where possible.
        N(RGt
initialize(RRQRtfrom_branchtaccelerator_treethardlink((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR0scC@s|j|jkS(N(R(RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR%scC@s||kS(N((RR((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt__ne__(scC@st|jdS(s-Return the short description for this format.N(RGtget_format_description(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR5+scC@stS(sIs this format supported?

        Supported formats can be initialized and opened.
        Unsupported formats may not support initialization or committing or
        some other features depending on the reason for not being supported.
        (RE(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytis_supported/scC@stS(s/True if this format supports content filtering.(RD(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRK8scC@stS(s*True if this format supports stored views.(RD(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRL<scC@s|jS(sGet the control directory format for creating branches.

        This is to support testing of working tree formats that can not exist
        in the same control directory as a branch.
        (t_matchingbzrdir(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytget_controldir_for_branch@sN(RRR RDRItupgrade_recommendedt%requires_normalized_unicode_filenamesRtmissing_parent_conflictsR2R?R0RR4R5R6RKRLR8(((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR.s 							tWorkingTreeFormatMetaDircB@sMeZdZdZedZedZeddZ	dZ
RS(s?Base class for working trees that live in bzr meta directories.cC@s!tj|tjj|dS(N(R.R7Rt	BzrFormat(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR7Ls
cC@sPy |jd}|jdSWn)tjk
rKtjd|jnXdS(s=Return format name for the working tree object in controldir.R/RN(RR2RR,RRtR(tklassRQRq((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytfind_format_stringPs
cC@s"|j|}|jtd|S(s<Return the format for the working tree object in controldir.sworking tree(R?t_find_formattformat_registry(R>RQR,((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pytfind_formatYscC@sEtj|d|d|d|tjj|d|d|d|dS(Ntallow_unsupportedtrecommend_upgradeR0(R.tcheck_support_statusRR=(RRCRDR0((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRE`s
cC@s|jS(sGet the control directory format for creating branches.

        This is to support testing of working tree formats that can not exist
        in the same control directory as a branch.
        (R7(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR8hsN(RRR R7tclassmethodR?RBRER2RER8(((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR<Is		cB@sDeZdZdZedZedZeddZ	RS(s?Base class for working trees that live in bzr meta directories.cC@s!tj|tjj|dS(N(R.R7RR=(R((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR7ts
cC@sPy |jd}|jdSWn)tjk
rKtjd|jnXdS(s=Return format name for the working tree object in controldir.R/RN(RR2RR,RRtR(R>RQRq((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR?xs
cC@s"|j|}|jtd|S(s<Return the format for the working tree object in controldir.sworking tree(R?R@RA(R>RQR,((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyRBscC@sEtj|d|d|d|tjj|d|d|d|dS(NRCRDR0(R.RERR=(RRCRDR0((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyREs
N(
RRR R7RFR?RBRER2RE(((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyR<qs		s(Bazaar Working Tree Format 4 (bzr 0.15)
sbzrlib.workingtree_4tWorkingTreeFormat4s(Bazaar Working Tree Format 5 (bzr 1.11)
tWorkingTreeFormat5s(Bazaar Working Tree Format 6 (bzr 1.14)
tWorkingTreeFormat6sBazaar-NG Working Tree format 3sbzrlib.workingtree_3tWorkingTreeFormat3(?R t
__future__Rt	cStringIORRRBtbzrlib.lazy_importRtglobalsRhRRtbzrlib.decoratorsRRtbzrlib.i18nRtbzrlib.lockRtbzrlib.mutabletreeR	R
tbzrlib.osutilsRRR
RRRRtbzrlib.traceRRtbzrlib.revisionRtbzrlib.symbol_versioningRRRRPRRRR!R#R%tmutabletreetMutableTreeRQtControlComponentR&tMutableInventoryTreeRtControlComponentFormatRegistryR&RAtControlComponentFormatR.R=R<t
register_lazyR-(((s6/usr/lib/python2.7/dist-packages/bzrlib/workingtree.pyt<module>sj	 4	M	T( 	
	
	
	


Copyright © 2017 || Recoded By Mr.Bumblebee