~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

PEP8 and comment cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib.osutils import file_kind, supports_executable, pathjoin
27
27
from bzrlib.trace import mutter
28
28
 
 
29
 
29
30
ROOT_PARENT = "root-parent"
30
31
 
 
32
 
31
33
def unique_add(map, key, value):
32
34
    if key in map:
33
35
        raise DuplicateKey(key=key)
34
36
    map[key] = value
35
37
 
 
38
 
36
39
class TreeTransform(object):
37
40
    """Represent a tree transformation."""
38
41
    def __init__(self, tree):
287
290
        self.unversion_file(trans_id)
288
291
 
289
292
    def set_executability(self, executability, trans_id):
290
 
        """Schedule setting of the 'execute' bit"""
 
293
        """Schedule setting of the 'execute' bit
 
294
        To unschedule, set to None
 
295
        """
291
296
        if executability is None:
292
297
            del self._new_executability[trans_id]
293
298
        else:
373
378
                return None
374
379
        return self.get_tree_file_id(trans_id)
375
380
 
376
 
 
377
381
    def inactive_file_id(self, trans_id):
378
382
        """Return the inactive file_id associated with a transaction id.
379
383
        That is, the one in the tree or in non_present_ids.
786
790
    else:
787
791
        return pathjoin(parent, child)
788
792
 
 
793
 
789
794
class FinalPaths(object):
790
795
    """Make path calculation cheap by memoizing paths.
791
796