123
120
ERROR_PATH_NOT_FOUND = 3 # WindowsError errno code, equivalent to ENOENT
126
@deprecated_function(zero_thirteen)
127
def gen_file_id(name):
128
"""Return new file id for the basename 'name'.
130
Use bzrlib.generate_ids.gen_file_id() instead
132
return generate_ids.gen_file_id(name)
135
@deprecated_function(zero_thirteen)
137
"""Return a new tree-root file id.
139
This has been deprecated in favor of bzrlib.generate_ids.gen_root_id()
141
return generate_ids.gen_root_id()
144
123
class TreeEntry(object):
145
124
"""An entry that implements the minimum interface used by commands.
434
413
def _cleanup(self):
435
414
self._flush_ignore_list_cache()
438
@deprecated_method(zero_eight)
439
def create(branch, directory):
440
"""Create a workingtree for branch at directory.
442
If existing_directory already exists it must have a .bzr directory.
443
If it does not exist, it will be created.
445
This returns a new WorkingTree object for the new checkout.
447
TODO FIXME RBC 20060124 when we have checkout formats in place this
448
should accept an optional revisionid to checkout [and reject this if
449
checking out into the same dir as a pre-checkout-aware branch format.]
451
XXX: When BzrDir is present, these should be created through that
454
warnings.warn('delete WorkingTree.create', stacklevel=3)
455
transport = get_transport(directory)
456
if branch.bzrdir.root_transport.base == transport.base:
458
return branch.bzrdir.create_workingtree()
459
# different directory,
460
# create a branch reference
461
# and now a working tree.
462
raise NotImplementedError
465
@deprecated_method(zero_eight)
466
def create_standalone(directory):
467
"""Create a checkout and a branch and a repo at directory.
469
Directory must exist and be empty.
471
please use BzrDir.create_standalone_workingtree
473
return bzrdir.BzrDir.create_standalone_workingtree(directory)
475
416
def relpath(self, path):
476
417
"""Return the local path portion from a given path.
773
714
return (kind, None, None, None)
775
@deprecated_method(zero_eleven)
777
def pending_merges(self):
778
"""Return a list of pending merges.
780
These are revisions that have been merged into the working
781
directory but not yet committed.
783
As of 0.11 this is deprecated. Please see WorkingTree.get_parent_ids()
784
instead - which is available on all tree objects.
786
return self.get_parent_ids()[1:]
788
716
def _check_parents_for_ghosts(self, revision_ids, allow_leftmost_as_ghost):
789
717
"""Common ghost checking functionality from set_parent_*.
1546
1474
# - RBC 20060907
1547
1475
self._write_inventory(self._inventory)
1549
@deprecated_method(zero_eight)
1550
def iter_conflicts(self):
1551
"""List all files in the tree that have text or content conflicts.
1552
DEPRECATED. Use conflicts instead."""
1553
return self._iter_conflicts()
1555
1477
def _iter_conflicts(self):
1556
1478
conflicted = set()
1557
1479
for info in self.list_files():
2097
2019
"""Set the root id for this tree."""
2098
2020
# for compatability
2099
2021
if file_id is None:
2100
symbol_versioning.warn(symbol_versioning.zero_twelve
2101
% 'WorkingTree.set_root_id with fileid=None',
2106
file_id = osutils.safe_file_id(file_id)
2023
'WorkingTree.set_root_id with fileid=None')
2024
file_id = osutils.safe_file_id(file_id)
2107
2025
self._set_root_id(file_id)
2109
2027
def _set_root_id(self, file_id):
2651
2569
return path[:-len(suffix)]
2654
@deprecated_function(zero_eight)
2655
def is_control_file(filename):
2656
"""See WorkingTree.is_control_filename(filename)."""
2657
## FIXME: better check
2658
filename = normpath(filename)
2659
while filename != '':
2660
head, tail = os.path.split(filename)
2661
## mutter('check %r for control file' % ((head, tail),))
2664
if filename == head:
2670
2572
class WorkingTreeFormat(object):
2671
2573
"""An encapsulation of the initialization and open routines for a format.