~bzr/bzr/bzr.1.5

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-07 07:27:16 UTC
  • mfrom: (3408.2.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080507072716-lr54bdt55km4feso
(mbp) Remove code deprecated prior to 1.1 and its tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
from bzrlib.progress import DummyProgress, ProgressPhase
40
40
from bzrlib.symbol_versioning import (
41
41
        deprecated_function,
42
 
        zero_fifteen,
43
 
        zero_ninety,
44
42
        )
45
43
from bzrlib.trace import mutter, warning
46
44
from bzrlib import tree
1834
1832
        tt.set_executability(entry.executable, trans_id)
1835
1833
 
1836
1834
 
1837
 
@deprecated_function(zero_fifteen)
1838
 
def find_interesting(working_tree, target_tree, filenames):
1839
 
    """Find the ids corresponding to specified filenames.
1840
 
    
1841
 
    Deprecated: Please use tree1.paths2ids(filenames, [tree2]).
1842
 
    """
1843
 
    working_tree.lock_read()
1844
 
    try:
1845
 
        target_tree.lock_read()
1846
 
        try:
1847
 
            return working_tree.paths2ids(filenames, [target_tree])
1848
 
        finally:
1849
 
            target_tree.unlock()
1850
 
    finally:
1851
 
        working_tree.unlock()
1852
 
 
1853
 
 
1854
 
@deprecated_function(zero_ninety)
1855
 
def change_entry(tt, file_id, working_tree, target_tree, 
1856
 
                 trans_id_file_id, backups, trans_id, by_parent):
1857
 
    """Replace a file_id's contents with those from a target tree."""
1858
 
    if file_id is None and target_tree is None:
1859
 
        # skip the logic altogether in the deprecation test
1860
 
        return
1861
 
    e_trans_id = trans_id_file_id(file_id)
1862
 
    entry = target_tree.inventory[file_id]
1863
 
    has_contents, contents_mod, meta_mod, = _entry_changes(file_id, entry, 
1864
 
                                                           working_tree)
1865
 
    if contents_mod:
1866
 
        mode_id = e_trans_id
1867
 
        if has_contents:
1868
 
            if not backups:
1869
 
                tt.delete_contents(e_trans_id)
1870
 
            else:
1871
 
                parent_trans_id = trans_id_file_id(entry.parent_id)
1872
 
                backup_name = get_backup_name(entry, by_parent,
1873
 
                                              parent_trans_id, tt)
1874
 
                tt.adjust_path(backup_name, parent_trans_id, e_trans_id)
1875
 
                tt.unversion_file(e_trans_id)
1876
 
                e_trans_id = tt.create_path(entry.name, parent_trans_id)
1877
 
                tt.version_file(file_id, e_trans_id)
1878
 
                trans_id[file_id] = e_trans_id
1879
 
        create_by_entry(tt, entry, target_tree, e_trans_id, mode_id=mode_id)
1880
 
        create_entry_executability(tt, entry, e_trans_id)
1881
 
 
1882
 
    elif meta_mod:
1883
 
        tt.set_executability(entry.executable, e_trans_id)
1884
 
    if tt.final_name(e_trans_id) != entry.name:
1885
 
        adjust_path  = True
1886
 
    else:
1887
 
        parent_id = tt.final_parent(e_trans_id)
1888
 
        parent_file_id = tt.final_file_id(parent_id)
1889
 
        if parent_file_id != entry.parent_id:
1890
 
            adjust_path = True
1891
 
        else:
1892
 
            adjust_path = False
1893
 
    if adjust_path:
1894
 
        parent_trans_id = trans_id_file_id(entry.parent_id)
1895
 
        tt.adjust_path(entry.name, parent_trans_id, e_trans_id)
1896
 
 
1897
 
 
1898
1835
def get_backup_name(entry, by_parent, parent_trans_id, tt):
1899
1836
    return _get_backup_name(entry.name, by_parent, parent_trans_id, tt)
1900
1837