/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Andrew Bennetts
  • Date: 2009-12-03 05:57:41 UTC
  • mfrom: (4857 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4869.
  • Revision ID: andrew.bennetts@canonical.com-20091203055741-vmmg0fmjgjw2pwvu
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2434
2434
        tt.create_directory(trans_id)
2435
2435
 
2436
2436
 
2437
 
def create_from_tree(tt, trans_id, tree, file_id, bytes=None):
2438
 
    """Create new file contents according to tree contents."""
 
2437
def create_from_tree(tt, trans_id, tree, file_id, bytes=None,
 
2438
    filter_tree_path=None):
 
2439
    """Create new file contents according to tree contents.
 
2440
    
 
2441
    :param filter_tree_path: the tree path to use to lookup
 
2442
      content filters to apply to the bytes output in the working tree.
 
2443
      This only applies if the working tree supports content filtering.
 
2444
    """
2439
2445
    kind = tree.kind(file_id)
2440
2446
    if kind == 'directory':
2441
2447
        tt.create_directory(trans_id)
2446
2452
                bytes = tree_file.readlines()
2447
2453
            finally:
2448
2454
                tree_file.close()
 
2455
        wt = tt._tree
 
2456
        if wt.supports_content_filtering() and filter_tree_path is not None:
 
2457
            filters = wt._content_filter_stack(filter_tree_path)
 
2458
            bytes = filtered_output_bytes(bytes, filters,
 
2459
                ContentFilterContext(filter_tree_path, tree))
2449
2460
        tt.create_file(bytes, trans_id)
2450
2461
    elif kind == "symlink":
2451
2462
        tt.create_symlink(tree.get_symlink_target(file_id), trans_id)