/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: Aaron Bentley
  • Date: 2009-12-07 21:46:28 UTC
  • mfrom: (4871 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4873.
  • Revision ID: aaron@aaronbentley.com-20091207214628-yifwgux0fn4x3bo4
Merge bzr.dev into merge-i-lock.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2300
2300
        new_desired_files = desired_files
2301
2301
    else:
2302
2302
        iter = accelerator_tree.iter_changes(tree, include_unchanged=True)
2303
 
        unchanged = dict((f, p[1]) for (f, p, c, v, d, n, k, e)
2304
 
                         in iter if not (c or e[0] != e[1]))
 
2303
        unchanged = [(f, p[1]) for (f, p, c, v, d, n, k, e)
 
2304
                     in iter if not (c or e[0] != e[1])]
 
2305
        if accelerator_tree.supports_content_filtering():
 
2306
            unchanged = [(f, p) for (f, p) in unchanged
 
2307
                         if not accelerator_tree.iter_search_rules([p]).next()]
 
2308
        unchanged = dict(unchanged)
2305
2309
        new_desired_files = []
2306
2310
        count = 0
2307
2311
        for file_id, (trans_id, tree_path) in desired_files:
2430
2434
        tt.create_directory(trans_id)
2431
2435
 
2432
2436
 
2433
 
def create_from_tree(tt, trans_id, tree, file_id, bytes=None):
2434
 
    """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
    """
2435
2445
    kind = tree.kind(file_id)
2436
2446
    if kind == 'directory':
2437
2447
        tt.create_directory(trans_id)
2442
2452
                bytes = tree_file.readlines()
2443
2453
            finally:
2444
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))
2445
2460
        tt.create_file(bytes, trans_id)
2446
2461
    elif kind == "symlink":
2447
2462
        tt.create_symlink(tree.get_symlink_target(file_id), trans_id)