[Pkg-bazaar-commits] ./bzr/unstable r15: files that have been deleted are not considered present in the WorkingTree
mbp at sourcefrog.net
mbp at sourcefrog.net
Fri Apr 10 07:24:57 UTC 2009
------------------------------------------------------------
revno: 15
committer: mbp at sourcefrog.net
timestamp: Wed 2005-03-09 18:29:44 +1100
message:
files that have been deleted are not considered present in the WorkingTree
modified:
bzrlib/branch.py
bzrlib/tree.py
-------------- next part --------------
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py 2005-03-09 07:14:22 +0000
+++ b/bzrlib/branch.py 2005-03-09 07:29:44 +0000
@@ -663,6 +663,10 @@
A foo
>>> b.commit("add foo")
>>> b.show_status()
+ >>> os.unlink(b._rel('foo'))
+ >>> b.show_status()
+ D foo
+
:todo: Get state for single files.
=== modified file 'bzrlib/tree.py'
--- a/bzrlib/tree.py 2005-03-09 04:46:15 +0000
+++ b/bzrlib/tree.py 2005-03-09 07:29:44 +0000
@@ -153,6 +153,12 @@
def _get_store_filename(self, file_id):
return self._rel(self.id2path(file_id))
+ def has_id(self, file_id):
+ # files that have been deleted are excluded
+ if not self.inventory.has_id(file_id):
+ return False
+ return os.access(self._rel(self.inventory.id2path(file_id)), os.F_OK)
+
def get_file_size(self, file_id):
return os.stat(self._get_store_filename(file_id))[ST_SIZE]
More information about the Pkg-bazaar-commits
mailing list