Rev 2322: Switch to the fast form for path2id in http://bazaar.launchpad.net/%7Ebzr/bzr/dirstate
John Arbash Meinel
john at arbash-meinel.com
Thu Feb 15 22:32:48 GMT 2007
At http://bazaar.launchpad.net/%7Ebzr/bzr/dirstate
------------------------------------------------------------
revno: 2322
revision-id: john at arbash-meinel.com-20070215223149-fu9dp59wij4p8dkl
parent: john at arbash-meinel.com-20070215222834-dx28dfubjs9d0kd8
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dirstate
timestamp: Thu 2007-02-15 16:31:49 -0600
message:
Switch to the fast form for path2id
modified:
bzrlib/workingtree_4.py workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
-------------- next part --------------
=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py 2007-02-15 22:28:34 +0000
+++ b/bzrlib/workingtree_4.py 2007-02-15 22:31:49 +0000
@@ -310,7 +310,7 @@
fileid_utf8 = file_id.encode('utf8')
if path is not None:
# path lookups are faster
- row = state.get_row(path)
+ row = state._get_row(path)
if file_id:
if row[0][3] != fileid_utf8:
raise BzrError('integrity error ? : mismatching file_id and path')
@@ -903,7 +903,10 @@
"""Return the id for path in this tree."""
# TODO: jam 20070215 This should be heavily optimized for dirstate
# I'm taking the *very* lazy way out
- return self._get_inventory().path2id(path)
+ row = self._dirstate._get_row(path.encode('utf8'))
+ if row == (None, None):
+ return None
+ return row[0][3].decode('utf8')
def unlock(self):
"""Unlock, freeing any cache memory used during the lock."""
More information about the bazaar-commits
mailing list